Not All Attention Is Equal: A Quantitative Survey of the EEI Trade-off
Abstract
Attention mechanisms have driven machine learning for a decade, from neural machine translation to language models that do general-purpose reasoning. This survey covers four connected threads: their formulation for sequence-to-sequence tasks, adaptation to computer vision, efficiency innovations that address the quadratic bottleneck, and advances in interpretability. We define three criteria: efficiency, expressiveness, and interpretability, and compare twenty-one methods using an EEI scoring framework. Scores come from a single rater with an assumed +/-1-point perturbation range. A deterministic Monte Carlo analysis with 200,000 samples shows that, under this perturbation model, rank changes of more than one position occur in 67-70% of samples on average. A rank-matched null model reproduces a similar stability profile, so the results support coarse tier-level comparisons rather than fine-grained rankings. The survey traces attention from Bahdanau-Luong alignment through the Transformer and into vision architectures. It reviews fixed and learned sparse attention, linear attention, IO-aware exact algorithms including FlashAttention, and state-space alternatives including Mamba. It also covers induction heads, superposition, and the attention-SSM duality. We further provide a structured narrative review, a benchmark synthesis with cross-study caveats, a five-problem research gap analysis, and a 2015-2026 evolution timeline. We conclude by framing attention research as an expansion of the efficiency-expressiveness-interpretability frontier and identifying future directions including unified efficiency benchmarks, learned routing for hybrid architectures, length generalization, and scalable mechanistic interpretability.
Figures & tables
| Vision | FlashAttn | Mamba/SSM | Quant. EEI | 2025–26 | |
|---|---|---|---|---|---|
| Tay et al. (2022) | × | × | × | × | × |
| This survey | ✓ | ✓ | ✓ | ✓ | ✓ |
| Source | Retrieved | Source-level retained |
|---|---|---|
| arXiv | 820 | 48 |
| IEEE Xplore | 140 | 15 |
| ACL Anthology | 210 | 22 |
| ACM Digital Library | 95 | 9 |
| Total retrieved | 1,265 | — |
| Unique after dedup. | 1,123 | 94 |
| Method | E | Ex | I | Family |
| Attention mechanisms | ||||
| Transformer (Vaswani et al., 2017) | 4 | 10 | 6 | Full Attention |
| GQA (Ainslie et al., 2023) | 7 | 9 | 6 | Dense (KV-efficient) |
| MQA (Shazeer, 2019) | 7 | 8 | 6 | Dense (KV-efficient) |
| Longformer (Beltagy et al., 2020) | 8 | 7 | 7 | Sparse/Window |
| BigBird (Zaheer et al., 2020) | 7 | 8 | 7 | Sparse/Window |
| Method | E | Ex | I | LRA Avg. | Speedup |
| Transformer | 4 | 10 | 6 | 54.39 | 1.0 |
| FlashAttention-2/3 | 8 | 10 | 6 | — | * |
| GQA | 7 | 9 | 6 | — | — |
| MQA | 7 | 8 | 6 | — | — |
| PagedAttention | 8 | 10 | 6 | — | — |
| Ring Attention | 7 | 10 | 6 | — | — |
| Method | Equal | Retrieval | Deployment |
|---|---|---|---|
| Transformer | 69% | 66% | 26% |
| FlashAttention-2/3 | 65% | 51% | 77% |
| GQA | 78% | 80% | 82% |
| MQA | 77% | 81% | 79% |
| PagedAttention | 65% | 51% | 77% |
| Ring Attention | 74% | 57% | 82% |
| Variant | Score Function | Complexity | Parameters | Expressiveness | Hardware |
|---|---|---|---|---|---|
| Bahdanau (Additive) | High (W,U,v) | High: learned nonlinear | Low: no single batched | ||
| Luong (Multiplicative) | None | Moderate: linear | High: dot product | ||
| Vaswani (Scaled Dot-Product) | None | Moderate + scaling | Very High: tensor cores |
| Category | Subcategory | Representative Works | Mechanism | Complexity |
| Dense | Full Softmax | Vaswani et al., 2017 | pairwise | |
| Multi-Head | Vaswani et al., 2017 | projected heads | ||
| GQA/MQA | Ainslie et al., 2023; Shazeer, 2019 | Shared KV heads | comp.; cache | |
| Sparse | Fixed Window | Beltagy et al., 2020; Liu et al., 2021 | -token local window | |
| Fixed Strided | Child et al., 2019 | Every- pattern | ||
| Hybrid Global | Beltagy et al., 2020; Zaheer et al., 2020 | Window + random + global |
| Method | Complexity | Quality vs Full Attn | Best Regime | Hardware | Production Ready |
|---|---|---|---|---|---|
| Fixed Sparse | or | Moderate loss on long-range retrieval | Long docs (4K–32K) | Broad GPU support | High (HF integration) |
| Learnable Sparse | (k-means routing) | Near-full quality trained; degrades on unseen patterns | Very long (32K+) | Broad GPU support | Low (niche) |
| Linear Attention | Approx. error can grow with ; weak on recall | 8K tokens | Broad GPU support; no custom kernels | Medium (xFormers) | |
| IO-Aware (FA1/2/3) | compute, HBM | Exact (no approximation) | All; sweet spot 32K | Ampere+ / Hopper+ FP8 | Very High (SDPA) |
| SSMs (Mamba) | time, memory | Competitive perplexity; limited direct retrieval evidence | Long gen (32K+) | GPU-specific custom kernel | Medium (Mamba repo) |
| Hybrid (SSM+attention, e.g., Jamba, Samba) | Quadratic prefill; decoding (per token) | Variable; can match full attn on mixed workloads | Mixed workloads | Broad GPU support | Medium (Jamba, RWKV eco.) |
| Use Case | Primary Recommendation | Alternative | Key Constraint |
| RAG / Retrieval-Augmented Gen. | FlashAttention + GQA | Adaptive Sparsity | Application-specific retrieval accuracy threshold |
| Long-Doc Summarization (8K–32K) | FlashAttention + GQA | Longformer / BigBird | Budget for quality loss |
| Code Completion (autoregressive) | GQA / MQA + PagedAttention | FlashAttention | KV cache size critical at 128K+ |
| Video Understanding (many tokens) | Swin / Window Attention | Perceiver cross-attn | Token count #1 constraint |
| On-Device Inference | Mamba / SSM | GQA + INT8 quant | Memory footprint limited |
| Real-Time Streaming | Mamba-2 (SSD) | RWKV | Constant state required |
| Method | Speedup | vs. Baseline | Condition | Source |
|---|---|---|---|---|
| FlashAttention | 2.0–3.0 | PyTorch attn | A100-40GB, 1K, FP16 (up to 3 at 128–2K) | Dao et al., 2022 |
| FlashAttention-2 | FA1 | A100-80GB, 8K, FP16 | Dao, 2024 | |
| FlashAttention-3 | FA2 | H100, 8K, FP16 (FP8: ) | Shah et al., 2024 | |
| Focus † | 2.0 | Full attn. (w/ FA) | H100-80GB | Yao et al., 2026 |
| DashAttention † | up to 3.3 | FA3 | GH200, decoding, up to 93.75% sparsity | Huang et al., 2026 |
| Mamba | up to ; – | conv. SSMs; same-size Transformer | A100, up to 32K | Gu & Dao, 2024 |
| Method | LRA Avg. | Val. PPL | Throughput | Source |
| Full Attn. (Transformer) | 54.39 | — | 1.0 (baseline) | LRA benchmark (Tay et al., 2021) |
| Longformer | 53.46 | — | — | LRA benchmark (Tay et al., 2021) |
| BigBird | 55.01 | — | — | LRA benchmark (Tay et al., 2021) |
| Sparse Transformer | 51.24 | — | — | LRA benchmark (Tay et al., 2021) |
| Reformer | 50.67 | — | — | LRA benchmark (Tay et al., 2021) |
| Performer | 51.41 | — | — | LRA benchmark (Tay et al., 2021) |
| Category | LRA | Speedup | Median Ex | |
| Full Attention | 1 | 54.39 | 1.0 [—] | 10 [—] |
| IO-Aware (FlashAttn-2/3) | 1 | — | (FA-2 vs FA-1) [—] | 10 [—] |
| Sparse Pattern | 4 | 52.6 [50.67, 55.01] | — | 7 [7–8] |
| Linear / Kernel | 2 | 51.4 [51.36, 51.41] | — | 6 [6–6] |
| Structured SSM | 2 | — | 3 (vs. conv. SSM); 6 (vs. FA-2) ∗ | 7.5 [7–8] |
| Long Convolution | 1 | — | 5 @ 8K; 2 vs. FA-2; 100 at 64K | 7 [—] |
| Era | Dominant Trend | Representative Methods | Key Shift |
|---|---|---|---|
| 2015–2019 | Foundation | Bahdanau, Luong, Transformer, BERT | Attention establishes sequence modeling |
| 2019–2020 | Sparse/Window | Sparse Transformer, Longformer | First sub-quadratic attention alternatives |
| 2020 | Sparse + Linear / Kernel | Reformer, Performer, Linformer, BigBird | Sub-quadratic scaling through sparsity, hashing, and approximation |
| 2021–2023 | IO-Aware / KV-Efficient | FlashAttention, GQA, PagedAttention | Hardware-co-design with limited quality trade-offs |
| 2023–2024 | State-Space/Recurrent | Mamba, Hyena, RWKV, xLSTM | or via recurrence or long convolution |
| 2025–2026 | Adaptive + Next-Gen SSMs | Focus, DashAttention, Mamba-3 | Learned routing recovers near-full Ex; Mamba-3 improves SSM state tracking |
| Method | Code Available | Checkpoints | Benchmarks Used | Reproduced |
| Transformer (Vaswani) | PyTorch/TF core | All major hubs | WMT14 | Yes, by 1K papers |
| FlashAttention-2 | PyTorch core (SDPA) | N/A (kernel only) | GPT-3 1.3B/2.7B (2K/8K context) | Yes, multiple impl. |
| FlashAttention-3 | GitHub (Dao et al.) | N/A (kernel only) | kernel benchmarks (H100 SXM5, seq 512–16K), FP8 numerical error | Yes, H100 required |
| GQA | HF Transformers | Llama-2/3, Mistral | CNN/DailyMail, WMT, TriviaQA | Yes, in production |
| MQA | PyTorch/HF core | N/A (arch. pattern) | WMT14 | Yes, in production |
| PagedAttention | vLLM (production) | N/A (kernel only) | ShareGPT, Alpaca traces | Yes, in production |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Method | E | Ex | I | Evidence (score evidence type) |
|---|---|---|---|---|
| Transformer | 4 | 10 | 6 | C (quadratic), C (exact), M (head attribution) |
| FlashAttention-2/3 | 8 | 10 | 6 | C+H (IO-aware tiling), C (exact), M (same as full attn) |
| GQA | 7 | 9 | 6 | C+H (KV cache reduction), C (shared-KV, minor loss), M (shared proj.) |
| MQA | 7 | 8 | 6 | C+H (full KV sharing), B (slightly lower quality at matched size), M (shared proj.) |
| PagedAttention | 8 | 10 | 6 | H (block-level serving), C (exact), M (same as full attn) |
| Ring Attention | 7 | 10 | 6 | H (distributed overhead), C (exact), M (same as full attn) |
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