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

通过层次化推测解码实现快速推理

Fast Inference via Hierarchical Speculative Decoding

Harvard University(哈佛大学);Google Research(谷歌研究);Tel Aviv University(特拉维夫大学);Google DeepMind(谷歌DeepMind)

Clara Mohri, Haim Kaplan, Tal Schuster, Yishay Mansour, Amir Globerson

AI总结:

本文提出层次化推测解码(HSD),通过堆叠多个草稿模型形成层次结构,以多项式时间选择最优延迟配置,实现比最佳单草稿基线高达1.2倍的推理加速。

摘要:

Transformer语言模型以自回归方式生成文本,这使得推理延迟与生成的令牌数量成正比。推测解码通过利用一个小型草稿模型提出令牌,并由较大的目标模型并行验证这些令牌,从而在不牺牲输出质量的情况下减少这种延迟。然而,在实践中,可能存在一组潜在的草稿模型——从较快但不太准确,到较慢但更可靠。我们引入了层次化推测解码(HSD),一种将这些草稿模型堆叠成层次结构的算法,其中每个模型提出令牌,下一个更大的模型在单次前向传递中验证它们,直到最终由目标模型验证令牌。我们推导了任何此类层次结构的预期延迟表达式,并表明选择延迟最优的层次结构可以在多项式时间内完成。实验上,HSD相比最佳单草稿基线实现了高达1.2倍的加速,证明了我们的算法在降低生成延迟方面超越以往技术的实用性。

英文摘要:

Transformer language models generate text autoregressively, making inference latency proportional to the number of tokens generated. Speculative decoding reduces this latency without sacrificing output quality, by leveraging a small draft model to propose tokens that the larger target model verifies in parallel. In practice, however, there may exist a set of potential draft models- ranging from faster but less inaccurate, to slower yet more reliable. We introduce Hierarchical Speculative Decoding (HSD), an algorithm that stacks these draft models into a hierarchy, where each model proposes tokens, and the next larger model verifies them in a single forward pass, until finally the target model verifies tokens. We derive an expression for the expected latency of any such hierarchy and show that selecting the latency-optimal hierarchy can be done in polynomial time. Empirically, HSD gives up to 1.2x speed-up over the best single-draft baseline, demonstrating the practicality of our algorithm in reducing generation latency beyond previous techniques.

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

↑