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

当线性注意力遇上自回归解码:迈向更有效和高效的线性化大型语言模型

When Linear Attention Meets Autoregressive Decoding: Towards More Effective and Efficient Linearized Large Language Models

School of Computer Science, Georgia Institute of Technology(佐治亚理工学院计算机学院);Google DeepMind(谷歌DeepMind)

Haoran You, Yichao Fu, Zheng Wang, Amir Yazdanbakhsh, Yingyan Celine Lin

AI总结:

针对自回归LLMs注意力复杂度高和生成效率低的问题,首次结合线性注意力与投机解码,提出兼容性增强技术,在LLaMA模型上实现困惑度降低6.67和2倍生成加速。

摘要:

自回归大型语言模型(LLMs)在语言任务中取得了令人印象深刻的性能,但面临两个显著的瓶颈:(1)随着token数量增加,注意力模块的复杂度呈二次方增长;(2)由于自回归LLMs在生成时的序列处理特性,导致效率受限。尽管线性注意力和投机解码提供了潜在的解决方案,但它们在增强自回归LLMs方面的适用性及协同潜力仍不确定。我们首次对现有线性注意力方法在自回归LLMs中的有效性进行了全面研究,并将它们与投机解码相结合。我们引入了一种线性注意力增强技术,确保其与投机解码兼容,从而实现更高效的LLMs训练与服务。涉及七种现有线性注意力模型和五种基于编码器/解码器的LLMs的大量实验和消融研究,一致验证了我们增强的线性化LLMs的有效性。值得注意的是,与先前的线性注意力方法相比,我们的方法在LLaMA模型上的困惑度最多降低了6.67,在生成过程中实现了高达2倍的加速。代码和模型可在https://github.com/GATECH-EIC/Linearized-LLM获取。

英文摘要:

Autoregressive Large Language Models (LLMs) have achieved impressive performance in language tasks but face two significant bottlenecks: (1) quadratic complexity in the attention module as the number of tokens increases, and (2) limited efficiency due to the sequential processing nature of autoregressive LLMs during generation. While linear attention and speculative decoding offer potential solutions, their applicability and synergistic potential for enhancing autoregressive LLMs remain uncertain. We conduct the first comprehensive study on the efficacy of existing linear attention methods for autoregressive LLMs, integrating them with speculative decoding. We introduce an augmentation technique for linear attention that ensures compatibility with speculative decoding, enabling more efficient training and serving of LLMs. Extensive experiments and ablation studies involving seven existing linear attention models and five encoder/decoder-based LLMs consistently validate the effectiveness of our augmented linearized LLMs. Notably, our approach achieves up to a 6.67 reduction in perplexity on the LLaMA model and up to a 2$\times$ speedup during generation compared to prior linear attention methods. Codes and models are available at https://github.com/GATECH-EIC/Linearized-LLM.

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

↑