arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2412.12094cs.CLcs.AIcs.LG
收藏

SepLLM:通过将一个片段压缩进一个分隔符来加速大型语言模型

SepLLM: Accelerate Large Language Models by Compressing One Segment into One Separator

The University of Hong Kong(香港大学);Center of Excellence for Generative AI, KAUST(阿卜杜拉国王科技大学生成式人工智能卓越中心)

Guoxuan Chen, Han Shi, Jiawei Li, Yihang Gao, Xiaozhe Ren, Yimeng Chen, Xin Jiang, Zhenguo Li, Weiyang Liu, Chao Huang

AI总结:

本文提出即插即用框架SepLLM,通过将分隔符间的片段信息压缩进分隔符词元并消除冗余词元来加速LLM推理,在GSM8K-CoT上减少超50%的KV缓存,并支持处理超400万词元的流式序列。

摘要:

大型语言模型(LLMs)在一系列自然语言处理任务中展现出了卓越的性能。然而,由于其二次复杂度,其庞大的模型规模带来了巨大的挑战,特别是在计算需求和推理速度方面。在这项工作中,我们发现了一个关键模式:与具有语义意义的词元相比,某些看似无意义的分隔符词元(即标点符号)对注意力得分的贡献不成比例地大。这一观察结果表明,这些分隔符词元之间片段的信息可以有效地浓缩到分隔符词元本身中,而不会造成显著的信息损失。基于这一洞察,我们引入了SepLLM,这是一个即插即用的框架,通过压缩这些片段并消除冗余词元来加速推理。此外,我们还实现了高效的内核以加速训练。跨免训练、从头训练和后训练设置的实验结果证明了SepLLM的有效性。值得注意的是,使用Llama-3-8B骨干网络,SepLLM在GSM8K-CoT基准上实现了超过50%的KV缓存减少,同时保持了相当的性能。此外,在流式设置中,SepLLM能够有效处理多达400万词元或更长的序列,同时保持一致的语言建模能力。

英文摘要:

Large Language Models (LLMs) have exhibited exceptional performance across a spectrum of natural language processing tasks. However, their substantial sizes pose considerable challenges, particularly in computational demands and inference speed, due to their quadratic complexity. In this work, we have identified a key pattern: certain seemingly meaningless separator tokens (i.e., punctuations) contribute disproportionately to attention scores compared to semantically meaningful tokens. This observation suggests that information of the segments between these separator tokens can be effectively condensed into the separator tokens themselves without significant information loss. Guided by this insight, we introduce SepLLM, a plug-and-play framework that accelerates inference by compressing these segments and eliminating redundant tokens. Additionally, we implement efficient kernels for training acceleration. Experimental results across training-free, training-from-scratch, and post-training settings demonstrate SepLLM's effectiveness. Notably, using the Llama-3-8B backbone, SepLLM achieves over 50% reduction in KV cache on the GSM8K-CoT benchmark while maintaining comparable performance. Furthermore, in streaming settings, SepLLM effectively processes sequences of up to 4 million tokens or more while maintaining consistent language modeling capabilities.

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

↑