arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.19595cs.CLcs.AI
收藏

大型语言模型中的高效注意力机制:综述

Efficient Attention Mechanisms for Large Language Models: A Survey

Tsinghua University(清华大学)

Yutao Sun, Zhenyu Li, Yike Zhang, Tengyu Pan, Bowen Dong, Yuyi Guo, Jianyong Wang

AI总结:

本文综述了大型语言模型中高效注意力机制的发展,包括线性注意力和稀疏注意力方法,并分析了其在大规模预训练模型中的应用与设计。

摘要:

基于Transformer的架构已成为大型语言模型的主要骨架。然而,自注意力机制的二次时间与内存复杂度仍然是高效长上下文建模的基本障碍。为了解决这一限制,近期研究引入了两种主要的高效注意力机制。线性注意力方法通过核近似、递归公式或快速权重动态实现线性复杂度,从而在减少计算开销的同时实现可扩展的推理。稀疏注意力技术则基于固定模式、分块路由或聚类策略,将注意力计算限制在选定的token子集上,从而在保持上下文覆盖的同时提升效率。本文提供了对这些发展的系统和全面的概述,整合了算法创新和硬件层面的考虑。此外,我们分析了高效注意力在大规模预训练语言模型中的整合,包括完全基于高效注意力构建的架构和结合局部与全局组件的混合设计。通过将理论基础与实际部署策略对齐,本文旨在为推进可扩展和高效语言模型的设计提供基础参考。

英文摘要:

Transformer-based architectures have become the prevailing backbone of large language models. However, the quadratic time and memory complexity of self-attention remains a fundamental obstacle to efficient long-context modeling. To address this limitation, recent research has introduced two principal categories of efficient attention mechanisms. Linear attention methods achieve linear complexity through kernel approximations, recurrent formulations, or fastweight dynamics, thereby enabling scalable inference with reduced computational overhead. Sparse attention techniques, in contrast, limit attention computation to selected subsets of tokens based on fixed patterns, block-wise routing, or clustering strategies, enhancing efficiency while preserving contextual coverage. This survey provides a systematic and comprehensive overview of these developments, integrating both algorithmic innovations and hardware-level considerations. In addition, we analyze the incorporation of efficient attention into largescale pre-trained language models, including both architectures built entirely on efficient attention and hybrid designs that combine local and global components. By aligning theoretical foundations with practical deployment strategies, this work aims to serve as a foundational reference for advancing the design of scalable and efficient language models.

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

↑