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

用于更快速LLM推理的级联投机起草

Cascade Speculative Drafting for Even Faster LLM Inference

University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Ziyi Chen, Xiaocong Yang, Jiacheng Lin, Chenkai Sun, Kevin Chen-Chuan Chang, Jie Huang

AI总结:

针对投机解码中自回归生成慢及时间分配不均的问题,提出结合垂直级联与水平级联的CS Drafting算法,在保持输出分布一致的同时显著提升了LLM推理速度。

摘要:

为提升大型语言模型(LLM)推理效率而引入的投机解码,通过让较小的模型生成草稿来运行。随后,较大的目标模型审查该草稿以与其输出对齐,目标模型的任何接受都会减少目标模型的运行次数,最终提高效率。然而,投机解码中的起草过程包含缓慢的自回归生成,并且无论token的重要性如何,都分配相同的时间来生成token。这些低效因素共同导致了投机解码的次优性能。为进一步改进LLM推理,我们引入了级联投机起草(CS Drafting),这是一种结合了两种级联的投机执行算法。垂直级联消除了神经模型的自回归生成,而水平级联优化了起草中的时间分配以提高效率。结合这两种级联,CS Drafting在我们的实验中与基线相比实现了更大的加速,同时保持了与目标模型相同的输出分布。

英文摘要:

Introduced to enhance the efficiency of large language model (LLM) inference, speculative decoding operates by having a smaller model generate a draft. A larger target model then reviews this draft to align with its output, and any acceptance by the target model results in a reduction of the number of the target model runs, ultimately improving efficiency. However, the drafting process in speculative decoding includes slow autoregressive generation and allocates equal time to generating tokens, irrespective of their importance. These inefficiencies collectively contribute to the suboptimal performance of speculative decoding. To further improve LLM inference, we introduce Cascade Speculative Drafting (CS Drafting), a speculative execution algorithm that incorporates two types of cascades. The Vertical Cascade eliminates autoregressive generation from neural models, while the Horizontal Cascade optimizes time allocation in drafting for improved efficiency. Combining both cascades, CS Drafting achieves greater speedup compared to the baselines in our experiments, while preserving the same output distribution as the target model.

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

↑