mlsanityData to 7 Oct 2026

Memory-efficient Transformers via Top-k Attention

arXiv 2106.06899 ↗First posted 13 Jun 2021cs.CL cs.LGcited by 59

Not on the map. Why?

Abstract (arXiv)

Following the success of dot-product attention in Transformers, numerous approximations have been recently proposed to address its quadratic complexity with respect to the input length. While these variants are memory and compute efficient, it is not possible to directly use them with popular pre-trained language models trained using vanilla attention, without an expensive corrective pre-training stage. In this work, we propose a simple yet highly accurate approximation for vanilla attention. We process the queries in chunks, and for each query, compute the top-k scores with respect to the keys. Our approach offers several advantages: (a) its memory usage is linear in the input size, similar to linear attention variants, such as Performer and RFA (b) it is a drop-in replacement for vanilla attention that does not require any corrective pre-training, and (c) it can also lead to significant memory savings in the feed-forward layers after casting them into the familiar query-key-value framework. We evaluate the quality of top-k approximation for multi-head attention layers on the Long Range Arena Benchmark, and for feed-forward layers of T5 and UnifiedQA on multiple QA datasets. We show our approach leads to accuracy that is nearly-identical to vanilla attention in multiple setups including training from scratch, fine-tuning, and zero-shot inference.

Key facts. Cited by 59 papers in the map (data through 7 Oct 2026). Builds on 46 of its 55 references that are in the map. First posted on arXiv 13 Jun 2021.

Builds on

46 of 55 references.

References · 46

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
  6. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  7. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  8. 2020Longformer: The Long-Document Transformercited by 3,362
  9. 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
  10. 2016Pointer Sentinel Mixture Modelscited by 2,992
  11. 2018Deep contextualized word representationscited by 2,285
  12. 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
34 more
  1. 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,114
  2. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  3. 2019Language Models as Knowledge Bases?cited by 1,922
  4. 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,793
  5. 2020GLU Variants Improve Transformercited by 1,724
  6. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
  7. 2020Reformer: The Efficient Transformercited by 1,658
  8. 2020Rethinking Attention with Performerscited by 1,584
  9. 2018Know What You Don't Know: Unanswerable Questions for SQuADcited by 1,538
  10. 2019Generating Long Sequences with Sparse Transformerscited by 1,523
  11. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  12. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
  13. 2017RACE: Large-scale ReAding Comprehension Dataset From Examinationscited by 851
  14. 2016Training Deep Nets with Sublinear Memory Costcited by 825
  15. 2020Efficient Transformers: A Surveycited by 784
  16. 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
  17. 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 696
  18. 2017The NarrativeQA Reading Comprehension Challengecited by 590
  19. 2020UnifiedQA: Crossing Format Boundaries With a Single QA Systemcited by 475
  20. 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 469
  21. 2021Random Feature Attentioncited by 350
  22. 2020Sparse Sinkhorn Attentioncited by 250
  23. 2017The Reversible Residual Network: Backpropagation Without Storing Activationscited by 215
  24. 2019Blockwise Self-Attention for Long Document Understandingcited by 158
  25. 2018ListOps: A Diagnostic Dataset for Latent Tree Learningcited by 128
  26. 2020Fast Transformers with Clustered Attentioncited by 123
  27. 2021LambdaNetworks: Modeling Long-Range Interactions Without Attentioncited by 107
  28. 2019On the Power and Limitations of Random Features for Understanding Neural Networkscited by 103
  29. 2019Augmenting Self-attention with Persistent Memorycited by 92
  30. 2019Reasoning Over Paragraph Effects in Situationscited by 79
  31. 2019Explicit Sparse Transformer: Concentrated Attention Through Explicit Selectioncited by 61
  32. 2019BP-Transformer: Modelling Long-Range Context via Binary Partitioningcited by 38
  33. 2020GMAT: Global Memory Augmentation for Transformerscited by 36
  34. 2021Value-aware Approximate Attentioncited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 1; 2022: 6; 2023: 5; 2024: 16; 2025: 17; 2026: 14.

59 papers.

Sort:

By area:

  1. 2022Diagonal State Spaces are as Effective as Structured State Spacescited by 350
  2. 2022Memorizing Transformerscited by 219
  3. 2023BiFormer: Vision Transformer with Bi-Level Routing Attentioncited by 150
  4. 2022The Lazy Neuron Phenomenon: On Emergence of Activation Sparsity in Transformerscited by 121
  5. 2023Towards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systemscited by 101
  6. 2024Loki: Low-rank Keys for Efficient Sparse Attentioncited by 87
  7. 2024MagicDec: Breaking the Latency-Throughput Tradeoff for Long Context Generation with Speculative Decodingcited by 87
  8. 2022Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Modelscited by 52
  9. 2024Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformerscited by 51
  10. 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 47
  11. 2024Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Modelscited by 26
  12. 2025Long-Context Generalization with Sparse Attentioncited by 18
38 more
  1. 2024Pick of the Bunch: Detecting Infrared Small Targets Beyond Hit-Miss Trade-Offs via Selective Rank-Aware Attentioncited by 17
  2. 2024Nonparametric Modern Hopfield Modelscited by 16
  3. 2021On Learning the Transformer Kernelcited by 14
  4. 2025AdaSplash: Adaptive Sparse Flash Attentioncited by 12
  5. 2025ZETA: Leveraging Z-order Curves for Efficient Top-k Attentioncited by 9
  6. 2022Treeformer: Dense Gradient Trees for Efficient Attention Computationcited by 8
  7. 2024IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUscited by 8
  8. 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashingcited by 6
  9. 2025HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model Inferencecited by 6
  10. 2022Pretraining the Vision Transformer using self-supervised methods for vision based Deep Reinforcement Learningcited by 5
  11. 2024LoMA: Lossless Compressed Memory Attentioncited by 5
  12. 2024What makes Models Compositional? A Theoretical View: With Supplementcited by 5
  13. 2024MultiMax: Sparse and Multi-Modal Attention Learningcited by 5
  14. 2025Exploiting Sparsity for Long Context Inference: Million Token Contexts on Commodity GPUscited by 5
  15. 2025Mamba Adaptive Anomaly Transformer with association discrepancy for time seriescited by 5
  16. 2025Spark Transformer: Reactivating Sparsity in FFN and Attentioncited by 5
  17. 2023Consciousness-Inspired Spatio-Temporal Abstractions for Better Generalization in Reinforcement Learningcited by 4
  18. 2024TrackFormers: In Search of Transformer-Based Particle Tracking for the High-Luminosity LHC Eracited by 4
  19. 2025Intrinsically Interpretable Attention via Sparse Post-Trainingcited by 4
  20. 2025A Mathematical Theory of Top-k Sparse Attention via Total Variation Distancecited by 4
  21. 2026IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMscited by 4
  22. 2024Fibottention: Inceptive Visual Representation Learning with Diverse Attention Across Headscited by 3
  23. 2024LevAttention: Time, Space, and Streaming Efficient Algorithm for Heavy Attentionscited by 3
  24. 2026SOCKET: SOft Collision Kernel EsTimator for Sparse Attentioncited by 3
  25. 2023Approximating ReLU on a Reduced Ring for Efficient MPC-based Private Inferencecited by 2
  26. 2025Top-Theta Attention: Sparsifying Transformers by Compensated Thresholdingcited by 2
  27. 2025LiteCache: A Query Similarity-Driven, GPU-Centric KVCache Subsystem for Efficient LLM Inferencecited by 2
  28. 2026Sparse Attention as Compact Kernel Regressioncited by 2
  29. 2026Improving Sparse Autoencoder with Dynamic Attentioncited by 2
  30. 2024Extended Mind Transformerscited by 1
  31. 2025Power Law Guided Dynamic Sifting for Efficient Attentioncited by 1
  32. 2025Crisp Attention: Regularizing Transformers via Structured Sparsitycited by 1
  33. 2025Block Sparse Flash Attentioncited by 1
  34. 2026Free Energy Mixercited by 1
  35. 2026Explainable Token-level Noise Filtering for LLM Fine-tuning Datasetscited by 1
  36. 2026Residual-Mass Accounting for Partial-KV Decodingcited by 1
  37. 2026Stochastic Sparse Attention for Memory-Bound Inferencecited by 1
  38. 2026Z-Order Transformer for Feed-Forward Gaussian Splattingcited by 1

50 most cited of 59 All 59 (JSON)