Towards Optimal Multi-draft Speculative Decoding
该论文提出了一种优化多草稿推测解码(MDSD)的方法,通过改进草稿采样方法和验证算法,提高了LLM推理效率。
更新于 2026-12-01。作者:Zhengmian Hu、Tong Zheng、Vignesh Viswanathan、Ziyi Chen、Ryan A. Rossi、Yihan Wu、Dinesh Manocha、Heng Huang。
中文摘要
大型语言模型(LLMs)已经成为自然语言处理任务中不可或缺的一部分。然而,自回归采样已成为效率瓶颈。多轮投机解码(MDSD)是一种近期提出的方法,该方法在生成每个标记时,一个小型草稿模型生成多个草稿,目标LLM并行验证它们,确保最终输出符合目标模型分布。MDSD的两个主要设计选择是草稿采样方法和验证算法。对于固定的草稿采样方法,最优接受率是解决最优运输问题的解决方案,但该问题的复杂性使得难以求解最优接受率并衡量现有验证算法与理论上限之间的差距。本文讨论了最优运输问题的对偶,提供了一种高效计算最优接受率的方法。首次,我们测量了MDSD效率在词汇量达到数千的理论上限,并量化了现有验证算法与这一上限之间的差距。我们还根据它们的最佳接受率比较了不同的草稿采样方法。我们的结果表明,草稿采样方法强烈影响最佳接受率,无放回采样优于有放回采样。此外,现有的验证算法在无放回和有放回采样的情况下都没有达到理论上限。我们的发现表明,精心设计的草稿采样方法有可能提高最佳接受率,并使得验证算法更接近理论上限。
英文摘要
Large Language Models (LLMs) have become an indispensable part of natural language processing tasks. However, autoregressive sampling has become an efficiency bottleneck. Multi-Draft Speculative Decoding (MDSD) is a recent approach where, when generating each token, a small draft model generates multiple drafts, and the target LLM verifies them in parallel, ensuring that the final output conforms to the target model distribution. The two main design choices in MDSD are the draft sampling method and the verification algorithm. For a fixed draft sampling method, the optimal acceptance rate is a solution to an optimal transport problem, but the complexity of this problem makes it difficult to solve for the optimal acceptance rate and measure the gap between existing verification algorithms and the theoretical upper bound. This paper discusses the dual of the optimal transport problem, providing a way to efficiently compute the optimal acceptance rate. For the first time, we measure the theoretical upper bound of MDSD efficiency for vocabulary sizes in the thousands and quantify the gap between existing verification algorithms and this bound. We also compare different draft sampling methods based on their optimal acceptance rates. Our results show that the draft sampling method strongly influences the optimal acceptance rate, with sampling without replacement outperforming sampling with replacement. Additionally, existing verification algorithms do not reach the theoretical upper bound for both without replacement and with replacement sampling. Our findings suggest that carefully designed draft sampling methods can potentially improve the optimal acceptance rate and enable the development of verification algorithms that closely match the theoretical upper bound.
解读
一句话总结
该论文提出了一种优化多草稿推测解码(MDSD)的方法,通过改进草稿采样方法和验证算法,提高了LLM推理效率。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:LLM推理过程中,自回归采样效率低下,导致计算资源需求大、延迟高。
- 现有方案不足:多草稿推测解码(MDSD)虽提高了效率,但其草稿采样方法和验证算法存在优化空间。
- 研究目标:提出优化MDSD的草稿采样方法和验证算法,提高解码效率。
问题2:论文的核心创新点是什么?
- 技术创新:将最优接受率问题转化为子集选择问题,并提出了高效计算方法。
- 方法改进:针对不同草稿采样方法,提出了相应的验证算法,并验证了其有效性。
- 优势:与现有方法相比,优化后的MDSD方法在保持解码质量的同时,显著提高了解码效率。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在真实文本分布上测试了不同MDSD方法的接受率,并与理论上限进行了对比。
- 性能提升:实验结果表明,优化后的MDSD方法在保持解码质量的同时,显著提高了解码效率。
- 对比结果:与现有验证算法相比,优化后的MDSD方法在多数情况下达到了更高的接受率。
问题4:这个研究的实际应用价值是什么?
- 应用场景:可应用于需要高效率LLM推理的场景,如聊天机器人、代码生成等。
- 实施建议:根据具体应用场景选择合适的草稿采样方法和验证算法。
- 局限与展望:目前优化方法主要针对单步MDSD,未来可将其扩展到多步MDSD。
来源
机器可读索引:llms.txt