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

基于推测的快速大语言模型协同解码

Fast Large Language Model Collaborative Decoding via Speculation

Southeast University(东南大学)

Jiale Fu, Yuchu Jiang, Junkai Chen, Jiaming Fan, Xin Geng, Xu Yang

AI总结:

本文提出CoS框架,通过结合推测解码与多模型交替提议验证机制,在保证生成质量的同时,将大语言模型协同解码速度提升了1.11至2.23倍。

摘要:

大语言模型(LLM)协同解码技术通过在每个生成步骤结合多个模型的输出来提升输出质量,但会产生高昂的计算成本。在本文中,我们提出了基于推测的协同解码(CoS),这是一种在不损害性能的前提下加速协同解码的新框架。受Speculative Decoding(推测解码)启发——在该方法中,小型提议模型顺序生成token,而较大的目标模型并行验证它们——我们的方法基于两个关键洞察:(1)验证分布可以是提议模型和目标模型的联合分布,(2)交替让每个模型充当提议者和验证者可进一步提升效率。我们将该方法推广到n个模型之间的协作,并从理论上证明CoS绝不会慢于标准协同解码,通常能实现更快的速度。大量实验表明,CoS比标准协同解码快1.11x-2.23x,且不损害生成质量。我们的代码可在https://github.com/Kamichanw/CoS/获取。

英文摘要:

Large Language Model (LLM) collaborative decoding techniques improve output quality by combining the outputs of multiple models at each generation step, but they incur high computational costs. In this paper, we introduce Collaborative decoding via Speculation (CoS), a novel framework that accelerates collaborative decoding without compromising performance. Inspired by Speculative Decoding--where a small proposal model generates tokens sequentially, and a larger target model verifies them in parallel, our approach builds on two key insights: (1) the verification distribution can be the combined distribution of both the proposal and target models, and (2) alternating each model as the proposer and verifier can further enhance efficiency. We generalize this method to collaboration among n models and theoretically prove that CoS is never slower than standard collaborative decoding, typically achieving faster speed. Extensive experiments demonstrate CoS is 1.11x-2.23x faster than standard collaborative decoding without compromising generation quality. Our code is available at https://github.com/Kamichanw/CoS/.

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

↑