2025-03-04 · 专家 · 机器学习 · 自然语言处理 · 计算机视觉

DuoDecoding: Hardware-aware Heterogeneous Speculative Decoding with Dynamic Multi-Sequence Drafting

提出了DuoDecoding,一种硬件感知的异构推测解码方法,通过动态多序列草稿设计,显著提高了大型语言模型的生成速度。

更新于 2025-03-04。作者:Kai Lv、Honglin Guo、Qipeng Guo、Xipeng Qiu。

中文摘要

大型语言模型(LLMs)在广泛的任务中表现出卓越的性能;然而,它们的逐词自回归生成过程显著降低了推理速度。投机解码提出了一种有前景的先草案后验证框架,能够在保持输出分布保真度的同时减少生成延迟。尽管如此,草案模型引入了额外的计算开销,成为性能瓶颈并增加了首次标记时间(TTFT)。先前缓解草案模型开销的方法主要依赖于启发式方法,并且通常无法达到草案语言模型的质量。为了应对这些挑战,我们提出了DuoDecoding,这是一种新颖的方法,它策略性地在CPU和GPU上分别部署草案和目标模型,从而实现并行解码同时保持草案质量。我们的方法结合了硬件感知的最优草案预算以最小化空闲时间,并采用动态多序列草案来提升草案质量。在七个任务上的大量实验表明,DuoDecoding在生成延迟上实现了高达2.61倍的加速,同时将TTFT降低到传统投机解码的83%。代码可在https://github.com/KaiLv69/DuoDecoding获取。

英文摘要

Large language models (LLMs) exhibit exceptional performance across a wide range of tasks; however, their token-by-token autoregressive generation process significantly hinders inference speed. Speculative decoding presents a promising draft-then-verify framework that reduces generation latency while maintaining output distribution fidelity. Nevertheless, the draft model introduces additional computational overhead, becoming a performance bottleneck and increasing the time to first token (TTFT). Previous approaches to mitigate draft model overhead have primarily relied on heuristics and generally failed to match the quality of the draft language models. To address these challenges, we propose DuoDecoding, a novel approach that strategically deploys the draft and target models on the CPU and GPU respectively, enabling parallel decoding while preserving draft quality. Our method incorporates a hardware-aware optimal draft budget to minimize idle times and employs dynamic multi-sequence drafting to enhance draft quality. Extensive experiments across seven tasks show that DuoDecoding achieves up to 2.61x speedup in generation latency, while reducing TTFT to 83% of that in conventional speculative decoding. The Code is available at https://github.com/KaiLv69/DuoDecoding.

解读

一句话总结

提出了DuoDecoding,一种硬件感知的异构推测解码方法,通过动态多序列草稿设计,显著提高了大型语言模型的生成速度。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源