JJava Stack Lab
论文雷达 · arXiv AI

投机解码没有你想的那么“投机”

摘要

这篇论文指出,投机解码(speculative decoding)的效率取决于有限的起草计算能在多大程度上预判目标模型实际会走的路径,而这涉及两类不确定性:目标模型的预测和采样的随机性。作者提出 DICE(Draw-Informed Candidate Selection),通过预采样并在起草与验证阶段同步验证所用的随机数,把计算分配给当前采样轮次中更可能被采用的候选续写。该方法无需额外训练起草模型,也不改变目标采样分布,在多种设置下取得目前最优的吞吐表现,相比强基线最高提升 24.6 个百分点。

查看原始标题和摘要

Speculative Decoding Is Less Speculative Than You Think

Speculative decoding accelerates language-model inference by preparing candidate continuations before the target model generates them. Its efficiency depends on how well limited drafting computation anticipates the path the target will actually follow. Anticipating this path involves two sources of uncertainty: the target model's predictions and the randomness of sampling. Yet the former requires a target-model forward pass, while the latter can be fixed before drafting. Building on this observation, we introduce DICE (Draw-Informed Candidate Selection), which pre-samples and synchronizes verification randomness across drafting and verification. By combining these known draws with predictions from an existing drafter, DICE allocates computation toward continuations more likely to be used in the current sampling run. This principle guides node selection throughout draft-tree construction and extends to asynchronous prefetching, where DICE predicts which next-round drafts to prepare. Without additional drafter training or changes to the target sampling distribution, DICE achieves state-of-the-art decoding throughput across diverse settings, with speedups of up to 24.6pp over strong b

核心要点

  • 投机解码先让起草模型生成候选续写,再由目标模型验证,从而加速语言模型推理
  • 不确定性来自两部分:目标模型的预测,以及采样的随机性;后者可以在起草前就固定下来
  • DICE 预采样并同步起草与验证阶段的验证随机数,结合现有 drafter 的预测来分配起草计算
  • 该原则用于 draft-tree 构建中的节点选择,并扩展到异步预取,即预测下一轮该准备哪些草稿
  • 无需额外训练 drafter,也不改变目标采样分布,吞吐提升最高达 24.6 个百分点

为什么值得后端工程师关注

对做 LLM 推理服务的后端工程师来说,这提供了一个不改变输出分布、也不需要重训模型的吞吐优化思路:把采样随机性提前固定并用于指导候选筛选与预取,可降低验证阶段的无效计算,适合在现有投机解码或 draft-tree 实现上改造。