The Evolution of Attention in Large Language Models: Mechanisms, Trade-offs, and Emerging Trends
Organizations: Alibaba Token Hub, Alibaba Group
Abstract
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.
Figures & tables
| Survey perspective | Primary organizing principle |
|---|---|
| General / efficient Transformers [ 86 , 154 ] | Architecture families, computational complexity, and approximation patterns. |
| Long-context LLMs [ 65 , 164 , 89 ] | Context extension, length extrapolation, training, retrieval, and application strategies. |
| Efficient attention [ 149 ] | Sparse and linear attention algorithms, efficiency, and deployment. |
| State space models [ 122 ] | SSM lineage, state organization and dynamics, applications, and benchmarks. |
| KV-cache management [ 80 ] | Cache selection, compression, eviction, quantization, and execution efficiency. |
| Memory-centric LLM architectures [ 193 ] | Representation form, update dynamics, and persistence across a broad range of implicit and explicit memory mechanisms. |
| Term or symbol | Meaning in this survey |
|---|---|
| Core terminology and abbreviations | |
| Contextual memory | Model-internal, input-dependent information retained or made available while processing the current sequence; it excludes pretrained parameters and external retrieval corpora. |
| KV | Key–value representation associated with a token, compressed entry, or other explicit memory unit. |
| Softmax Attention | The broader explicit-memory lineage in which contextual information is retained as separately addressable representations and read through normalized query–key interactions. |
| Sparse Attention | A research line centered on restricting the eligible token-, block-, or entry-level candidate set; most methods retain a Softmax Readout over that set. |
| Linear Attention | A family that represents history through one or more recurrent associative states rather than retaining the complete token-wise KV history. |
| Research line | Memory substrate | Rep. | Upd. | Acc. | Read. | Int. |
|---|---|---|---|---|---|---|
| Softmax Attention | Explicit memory units | P | P | S | S | S |
| Sparse Attention | Explicit token/block KV | S | S | P | S | S |
| Linear Attention | Associative recurrent state | P | P | S | S | S |
| State Space Models | Structured recurrent state | P | P | S | S | S |
| Hybrid Architectures | Heterogeneous memory substrates | P | S | S | S | S |
| Retain category | Period | Unified form | Representative methods |
|---|---|---|---|
| No decay | 2020–2025 | Linear Transformer, DeltaNet, DeltaProduct | |
| Fixed head-wise scalar | 2023–2024 | RetNet, Lightning Attention-2 | |
| Fixed channel-wise vector | 2024 | RWKV-5 | |
| Input-dependent head-wise scalar | 2024 | GDN | |
| Input-dependent channel-wise vector | 2023–2026 | GLA, RWKV-6/7, HGRN2, KDA, GDN2, EDA |
| Erase category | Period | Unified form | Representative methods |
|---|---|---|---|
| No explicit erase | 2020–2024 | Linear Transformer, RetNet, GLA, RWKV-5/6, HGRN2, Lightning Attention-2 | |
| Coupled corrective erase | 2021–2025 | DeltaNet, GDN, KDA, DeltaProduct | |
| Decoupled erase | 2025–2026 | and need not be aligned and/or | RWKV-7, GDN2, EDA |
| Write category | Period | Unified form | Representative methods |
|---|---|---|---|
| Direct write | 2020–2024 | Linear Transformer, RetNet, GLA, RWKV-5/6, Lightning Attention-2 | |
| Corrective write | 2021–2025 | DeltaNet, GDN, KDA, DeltaProduct | |
| Erase–write decoupling | 2025–2026 | Separate control of erase and write address or content | RWKV-7, GDN2, EDA |
| Method | Decay | Erase | Write | Year | Unified update rule |
|---|---|---|---|---|---|
| Linear Transformer [ 74 ] | No decay | No explicit erase | Direct | 2020 | |
| DeltaNet [ 140 , 179 ] | No decay | Coupled corrective | Corrective | 2021 | |
| RetNet [ 148 ] | Fixed head-wise | No explicit erase | Direct | 2023 | |
| GLA [ 178 ] | Input-dependent channel-wise | No explicit erase | Direct | 2023 | , |
| RWKV-5 [ 124 ] | Fixed channel-wise | No explicit erase | Direct | 2024 | |
| RWKV-6 [ 124 ] | Input-dependent channel-wise | No explicit erase | Direct | 2024 | , |
| Method | Per-token objective | Resulting update |
| Linear Transformer [ 74 ] | ||
| RetNet [ 148 ] | ||
| GLA [ 178 ] | ||
| HGRN2 [ 127 ] | ||
| DeltaNet [ 140 , 179 ] | ||
| GDN [ 177 ] | , optimized at |
| Aspect | SSE | SDM |
|---|---|---|
| Unified state | , ; each row is a -dimensional memory unit | |
| State organization | fixed groups with rows per group | Flat row table without group boundaries |
| Write selection | Group Top- plus within-group coefficients | Independent PKM write router selecting Top- rows |
| Read selection | Read over selected groups and row support | Independent PKM read router selecting Top- rows |
| Read/write relation | Shared group structure; strongly related supports | Independent read and write routers |
| Capacity expansion | Increase the number of groups | Directly increase the number of flat rows |
| Aspect | Log-Linear Attention | DLA | MHLA |
|---|---|---|---|
| Segmentation basis | Position-dependent Fenwick or power-of-two schedule | Content-dependent State Information Score | Fixed token-block partition |
| Segment form | Multiscale contiguous intervals | Unequal-length semantic intervals | Flat, usually equal-granularity blocks |
| Number of states | Determined by the number of retained blocks | ||
| State management | Hierarchical binary-carry merging | Dynamic creation and information-based merging | Independent block summaries without intrinsic merging |
| Temporal resolution | Fine for recent and coarse for distant history | Allocated according to semantic change | Approximately uniform across blocks |
| Cross-state Integration | Query-dependent integration of temporal-scale readouts | Integration of readouts from dynamically constructed segment states | Query-block-dependent integration of block-summary readouts |
| Kernel choice | State control | Computational interface |
|---|---|---|
| Learned time-invariant dynamics: S4, S4D, S5 [ 56 , 57 , 146 ] | Shared operators govern input writing, temporal propagation and readout. | Convolution or structured scans process sequences; recurrent decoding applies the same learned dynamics to the evolving state. |
| Selective dynamics: Mamba [ 55 ] | Input-generated step sizes and write/read maps regulate the effective operators. | A selective scan processes the input-dependent recurrence. |
| SSD kernel: Mamba-2 [ 28 ] | A head-wise scalar transition combines with input-dependent write and read directions. | Recurrent and structured-matrix views support block computation and state-based decoding. |
| Design question | SSM mechanism | Computational or state effect |
|---|---|---|
| How should the state propagate and adapt? | Structured dynamics and input-dependent controls. | Temporal propagation, selective writing and readout. |
| How should the recurrence be computed? | SSD recurrent and matrix views; block computation. | Structured sequence computation and a fixed-size decoding state. |
| How should the state communicate? | Multichannel interfaces: S5, Mamba-3 MIMO and MIMOMamba. | Richer input–output interaction with the retained state. |
| How should heads and updates be organized? | HADES head organization; MuonSSM update geometry. | Complementary temporal roles; conditioned input-injection directions. |
| Layer allocation | Training strategy | Period | Representative methods |
|---|---|---|---|
| Predefined allocation | From-scratch training | 2024–2026 | Griffin [ 29 ] ; Jamba [ 85 ] ; Samba [ 138 ] ; Zamba [ 51 ] ; Zamba2 [ 50 ] ; HySparse [ 43 ] ; HySparse2 [ 165 ] |
| Direct diagnosis selection | Pretrained-model transfer | 2024–2026 | LightTransfer [ 191 ] ; Priming [ 20 ] |
| Alignment-based selection | Pretrained-model transfer | 2025–2026 | Jet-Nemotron / PostNAS [ 59 ] ; HypeNet / HALO [ 23 ] |
| Iterative distillation-guided selection | Pretrained-model transfer | 2025 | KL-Guided Layer Selection [ 83 ] |
| Head allocation | Period | Allocation characteristic | Representative methods |
|---|---|---|---|
| Fixed head allocation | 2024–2025 | A predefined ratio is used across Hybrid layers. | Hymba [ 39 ] ; Falcon-H1 [ 194 ] |
| Function-aware head selection | 2024–2026 | Heads with retrieval or long-range functions retain full attention, while the remaining heads use streaming, sparse, or recurrent paths. | DuoAttention [ 169 ] ; HydraHead [ 151 ] |
| Input-adaptive head routing | 2026 | A test-time router assigns heads to full-attention or sparse-attention modes according to the input, allowing the overall sparsity ratio to vary dynamically. | Elastic Attention [ 153 ] |
| Depth-adaptive head allocation | 2026 | The hybrid ratio is varied across depth. | Head-wise Hybridization [ 143 ] |
| Fusion interface | Unified form | Period | Representative methods |
|---|---|---|---|
| Readout-level branch fusion | 2022–2026 | Block-Recurrent Transformer [ 67 ] ; Memorizing Transformer [ 166 ] ; Infini-attention [ 113 ] ; DART [ 126 ] | |
| Output-level branch fusion | 2025 | Titans-MAG [ 13 ] |
| Token allocation | Unified selection rule | Period | Representative methods |
|---|---|---|---|
| Temporal-boundary allocation | : deterministic allocation by token age, position, or local-window boundary | 2024–2025 | LoLCATs [ 190 ] ; Native Hybrid Attention [ 40 ] |
| Content-score allocation | : recent tokens remain local; departing tokens enter salient historical KV or a compressed state according to self-recall error or self-saliency | 2025–2026 | LoLA [ 94 ] ; STILL [ 98 ] |
| Learned operation allocation | : a learned or search-derived policy assigns a Softmax or Linear/Recurrent operation | 2026 | NAtS-L [ 35 ] |
| Period | Records | Single-family | Hybrid | Cross-layer |
|---|---|---|---|---|
| 2022–2023 | 6 | 6 (100%) | 0 | 0 |
| 2024–2025 | 25 | 16 (64%) | 9 (36%) | 0 |
| 2026 * | 27 | 10 (37%) | 17 (63%) | 5 (19%) |
| Model endpoint | Release | Model size | Attention structure |
|---|---|---|---|
| MiMo-V2.6-Pro | 2026-09 | 1.02T (42B active) | 60 SWA-GQA + 10 global-GQA layers [ 91 ] |
| DeepSeek-V4.1-Flash (max) | 2026-09 | 552B (8B active prefill; 16B active decode) | CSA2 with SWA; cross-layer KV/index/top- reuse |
| K2-Horizon-375B-A23B | 2026-09 | 375B (23B active) | full GQA |
| GLM-5.3-Flash | 2026-08 | 320B (18B active) | 34 KDA + 11 compressed-indexer DSA layers |
| GLM-5.3 (max) | 2026-08 | 744B (40B active) | MLA-based DSA; IndexShare/IndexCache |
| Qwen3.8-Flash-Next | 2026-08 | 176B; 125B main (6B active) | 3 GDN : 1 QSA |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Release | Model lineage | Release record | Attention / mixer composition | Hybrid | Source |
|---|---|---|---|---|---|
| 2026-09 | MiMo | MiMo-V2.6-Pro-RL | SWA-GQA + global GQA (6:1) | Yes | [ 91 ] |
| 2026-09 | DeepSeek | DeepSeek-V4.1-Flash | SWA + CSA2 | Yes | [ 34 ] |
| 2026-09 | MiniCPM | MiniCPM5-2B family | Full GQA | No | [ 120 ] |
| 2026-09 | K2 | K2-Horizon-375B-A23B | Full GQA | No | [ 69 ] |
| 2026-08 | Qwen | Qwen3.8-2.4T-A95B | Gated DeltaNet + full GQA (3:1) | Yes | Model card ; config |
| 2026-08 | Qwen | Qwen3.8-27B | Gated DeltaNet + gated full GQA (3:1) | Yes | [ 134 ] |
Attention Mechanisms
Attention mechanisms let neural networks weight information from other tokens or regions according to relevance, enabling context-dependent processing.
See all 513 papers