大型语言模型中注意力机制的演变:机制、权衡与新兴趋势

·

研究论文 · 2026/10/01

自注意力为大型语言模型提供了细粒度、依赖查询的上下文访问,但密集的令牌交互导致二次预填充成本和随上下文长度增长的键值缓存。因此,研究涵盖显式记忆压缩、稀疏访问、循环状态构建、结构化状态动态以及异构机制组合。本综述将这些发展视为模型内部的上下文记忆。我们引入一个五维视角——记忆表示、记忆更新、访问、读取和集成——描述表示什么、如何变化、哪些可查询、如何读取以及读取如何形成输出。该视角比较重叠的研究路线,而不强加单一计算模型。我们利用来自14个主要模型谱系和11个高性能开放权重端点的59条发布级记录,重建机制层面的发展和架构采用。第一,显式记忆和循环状态方法保留不同的接口,但越来越多地控制重叠的记忆功能。第二,异构架构越来越多地在网络深度上协调:逐层组合将互补的记忆处理分布到表示阶段,而跨层重用将选定的记忆和路由工件向前传递。因此,深度成为构建和管理上下文记忆的一个维度。第三,这些发展激发了一个有状态的多维记忆路由假设:持久记忆按时间范围、网络深度、基底类型和表示粒度组织,而协调的稀疏写入和稀疏读取决定维护什么以及什么对每个查询有贡献。总体而言,高效序列架构设计越来越关注上下文记忆的组织、生命周期和选择性使用,而不是孤立的注意力算子。

该综述为理解大语言模型中注意力机制的演进提供了系统性的框架和实证基础,有助于研究者把握高效序列架构的设计趋势,并启发新的记忆管理思路。

Self-attention gives LLMs fine-grained, query-dependent access to context, but dense token interactions incur quadratic prefill cost and a key--value cache growing with context length. Research thus spans explicit-memory compression, sparse access, recurrent state construction, structured state dynamics, and heterogeneous mechanism composition. This survey analyzes these developments as model-internal contextual memory. We introduce a five-dimensional lens---Memory Representation, Memory Update, Access, Readout, and Integration---describing what is represented, how it changes, what is query-eligible, how it is read, and how readouts form outputs. This lens compares overlapping research lines without imposing one computational model. We reconstruct mechanism-level developments and architectural adoption using 59 release-level records from 14 major model lineages and 11 high-performing open-weight endpoints. First, explicit-memory and recurrent-state methods retain distinct interfaces but increasingly control overlapping memory functions. Second, heterogeneous architectures increasingly coordinate across network depth: layer-wise composition distributes complementary memory processing across representational stages, while cross-layer reuse carries selected memory and routing artifacts forward. Depth thus becomes a dimension along which contextual memory is constructed and managed. Third, these developments motivate a stateful multidimensional memory-routing hypothesis: persistent memory is organized across temporal scope, network depth, substrate type, and representation granularity, while coordinated Sparse Write and Sparse Read determine what is maintained and what contributes to each query. Overall, efficient sequence architecture design increasingly concerns the organization, lifecycle, and selective use of contextual memory rather than an isolated Attention operator.

阅读原文

参与讨论