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

CLaSp:用于自推测解码的上下文层跳过

CLaSp: In-Context Layer Skip for Self-Speculative Decoding

Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(深圳先进技术研究院,中国科学院);University of Chinese Academy of Sciences(中国科学院大学);Singapore University of Technology and Design(新加坡科技设计大学);School of Biomedical Engineering, UNSW Sydney(新南威尔士大学生物医学工程学院)

Longze Chen, Renke Shan, Huiming Wang, Lu Wang, Ziqiang Liu, Run Luo, Jiawei Wang, Hamid Alinejad-Rokny, Min Yang

AI总结:

提出CLaSp,一种用于自推测解码的即插即用上下文层跳过策略,通过动态规划算法动态跳过验证模型中间层构建草稿模型,无需额外训练,在LLaMA3上实现1.3-1.7倍加速且不改变生成文本分布。

摘要:

推测解码(SD)是加速大型语言模型(LLMs)解码过程的一种有前途的方法。SD的效率主要取决于草稿模型和验证模型之间的一致性。然而,现有的草稿方法通常需要训练额外的模块,这在实现和确保各种LLMs之间的兼容性方面可能具有挑战性。在本文中,我们提出了CLaSp,一种用于自推测解码的上下文层跳过策略。与以前的方法不同,CLaSp不需要额外的草稿模块或额外训练。相反,它采用即插即用的机制,通过跳过验证模型的中间层来构建压缩的草稿模型。具体来说,我们开发了一种动态规划算法,通过利用来自最后一个验证阶段的完整隐藏状态作为目标来优化层跳过过程。这使得CLaSp能够在每个验证阶段之后动态调整其层跳过策略,而无需依赖预优化的跳过层集合。在多样化的下游任务上的实验结果表明,CLaSp在LLaMA3系列模型上实现了1.3倍~1.7倍的加速,而不改变生成文本的原始分布。

英文摘要:

Speculative decoding (SD) is a promising method for accelerating the decoding process of Large Language Models (LLMs). The efficiency of SD primarily hinges on the consistency between the draft model and the verify model. However, existing drafting approaches typically require additional modules to be trained, which can be challenging to implement and ensure compatibility across various LLMs. In this paper, we propose CLaSp, an in-context layer-skipping strategy for self-speculative decoding. Unlike prior methods, CLaSp does not require additional drafting modules or extra training. Instead, it employs a plug-and-play mechanism by skipping intermediate layers of the verify model to construct a compressed draft model. Specifically, we develop a dynamic programming algorithm that optimizes the layer-skipping process by leveraging the complete hidden states from the last verification stage as an objective. This enables CLaSp to dynamically adjust its layer-skipping strategy after each verification stage, without relying on pre-optimized sets of skipped layers. Experimental results across diverse downstream tasks demonstrate that CLaSp achieves a speedup of 1.3x ~ 1.7x on LLaMA3 series models without altering the original distribution of the generated text.

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

↑