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

学习草稿:基于强化学习的自适应推测解码

Learning to Draft: Adaptive Speculative Decoding with Reinforcement Learning

National Key Laboratory for Multimedia Information Processing, Peking University(多媒体信息处理国家级重点实验室,北京大学);School of Computer Science, Peking University(计算机科学学院,北京大学);Microsoft Research Asia(微软亚洲研究院)

Jiebin Zhang, Zhenghan Yu, Liang Wang, Nan Yang, Eugene J. Yu, Zheng Li, Yifan Song, Dawei Zhu, Xingxing Zhang, Furu Wei, Sujian Li

AI总结:

LTD通过强化学习优化草稿-验证循环的吞吐量,实现比现有方法更高的解码效率。

摘要:

推测解码通过使用小型草稿模型为大型目标模型生成候选标记,从而加速大型语言模型(LLM)的推理过程。该技术的效果取决于生成候选标记和验证它们所花费的时间之间的权衡。然而,当前最先进的方法依赖于静态的时间分配,而近期的动态方法则优化代理指标如接受长度,往往忽略了真实的时间成本,并将草稿和验证阶段视为孤立过程。为了解决这些限制,我们引入了学习草稿(LTD),一种新的方法,直接优化每个草稿-验证周期的吞吐量。我们将问题建模为强化学习环境,并训练两个相互适应的策略来动态协调草稿和验证阶段。这促使策略适应彼此并显式最大化解码效率。我们在五个多样化的LLM和四个不同的任务上进行了广泛的评估。我们的结果表明,LTD在2.24倍到4.32倍的速度提升范围内,优于最先进的方法Eagle3多达36.4%。

英文摘要:

Speculative decoding accelerates large language model (LLM) inference by using a small draft model to generate candidate tokens for a larger target model to verify. The efficacy of this technique hinges on the trade-off between the time spent on drafting candidates and verifying them. However, current state-of-the-art methods rely on a static time allocation, while recent dynamic approaches optimize for proxy metrics like acceptance length, often neglecting the true time cost and treating the drafting and verification phases in isolation. To address these limitations, we introduce Learning to Draft (LTD), a novel method that directly optimizes for throughput of each draft-and-verify cycle. We formulate the problem as a reinforcement learning environment and train two co-adaptive policies to dynamically coordinate the draft and verification phases. This encourages the policies to adapt to each other and explicitly maximize decoding efficiency. We conducted extensive evaluations on five diverse LLMs and four distinct tasks. Our results show that LTD achieves speedup ratios ranging from 2.24x to 4.32x, outperforming the state-of-the-art method Eagle3 up to 36.4%.

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

↑