arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.00784cs.CL
收藏

DuoDecoding:基于硬件感知的异构推测解码与动态多序列起草

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

Fudan University(复旦大学);Shanghai AI Laboratory(上海人工智能实验室)

Kai Lv, Honglin Guo, Qipeng Guo, Xipeng Qiu

AI总结:

DuoDecoding通过将起草与目标模型分别部署于CPU和GPU实现异构并行解码,结合硬件感知的最优起草预算与动态多序列起草,在保持质量的同时显著降低生成延迟与首个词元时间。

摘要:

大型语言模型(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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑