Memory-efficient Transformers via Top-k Attention
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
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
- 2016Pointer Sentinel Mixture Modelscited by 2,992
- 2018Deep contextualized word representationscited by 2,285
- 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
34 more
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,114
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2019Language Models as Knowledge Bases?cited by 1,922
- 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,793
- 2020GLU Variants Improve Transformercited by 1,724
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2020Reformer: The Efficient Transformercited by 1,658
- 2020Rethinking Attention with Performerscited by 1,584
- 2018Know What You Don't Know: Unanswerable Questions for SQuADcited by 1,538
- 2019Generating Long Sequences with Sparse Transformerscited by 1,523
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
- 2017RACE: Large-scale ReAding Comprehension Dataset From Examinationscited by 851
- 2016Training Deep Nets with Sublinear Memory Costcited by 825
- 2020Efficient Transformers: A Surveycited by 784
- 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
- 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 696
- 2017The NarrativeQA Reading Comprehension Challengecited by 590
- 2020UnifiedQA: Crossing Format Boundaries With a Single QA Systemcited by 475
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 469
- 2021Random Feature Attentioncited by 350
- 2020Sparse Sinkhorn Attentioncited by 250
- 2017The Reversible Residual Network: Backpropagation Without Storing Activationscited by 215
- 2019Blockwise Self-Attention for Long Document Understandingcited by 158
- 2018ListOps: A Diagnostic Dataset for Latent Tree Learningcited by 128
- 2020Fast Transformers with Clustered Attentioncited by 123
- 2021LambdaNetworks: Modeling Long-Range Interactions Without Attentioncited by 107
- 2019On the Power and Limitations of Random Features for Understanding Neural Networkscited by 103
- 2019Augmenting Self-attention with Persistent Memorycited by 92
- 2019Reasoning Over Paragraph Effects in Situationscited by 79
- 2019Explicit Sparse Transformer: Concentrated Attention Through Explicit Selectioncited by 61
- 2019BP-Transformer: Modelling Long-Range Context via Binary Partitioningcited by 38
- 2020GMAT: Global Memory Augmentation for Transformerscited by 36
- 2021Value-aware Approximate Attentioncited by 5
Built on by
Citing papers per year: 2021: 1; 2022: 6; 2023: 5; 2024: 16; 2025: 17; 2026: 14.
59 papers.
Sort:
By area:
- 2022Diagonal State Spaces are as Effective as Structured State Spacescited by 350
- 2022Memorizing Transformerscited by 219
- 2023BiFormer: Vision Transformer with Bi-Level Routing Attentioncited by 150
- 2022The Lazy Neuron Phenomenon: On Emergence of Activation Sparsity in Transformerscited by 121
- 2023Towards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systemscited by 101
- 2024Loki: Low-rank Keys for Efficient Sparse Attentioncited by 87
- 2024MagicDec: Breaking the Latency-Throughput Tradeoff for Long Context Generation with Speculative Decodingcited by 87
- 2022Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Modelscited by 52
- 2024Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformerscited by 51
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 47
- 2024Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Modelscited by 26
- 2025Long-Context Generalization with Sparse Attentioncited by 18
38 more
- 2024Pick of the Bunch: Detecting Infrared Small Targets Beyond Hit-Miss Trade-Offs via Selective Rank-Aware Attentioncited by 17
- 2024Nonparametric Modern Hopfield Modelscited by 16
- 2021On Learning the Transformer Kernelcited by 14
- 2025AdaSplash: Adaptive Sparse Flash Attentioncited by 12
- 2025ZETA: Leveraging Z-order Curves for Efficient Top-k Attentioncited by 9
- 2022Treeformer: Dense Gradient Trees for Efficient Attention Computationcited by 8
- 2024IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUscited by 8
- 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashingcited by 6
- 2025HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model Inferencecited by 6
- 2022Pretraining the Vision Transformer using self-supervised methods for vision based Deep Reinforcement Learningcited by 5
- 2024LoMA: Lossless Compressed Memory Attentioncited by 5
- 2024What makes Models Compositional? A Theoretical View: With Supplementcited by 5
- 2024MultiMax: Sparse and Multi-Modal Attention Learningcited by 5
- 2025Exploiting Sparsity for Long Context Inference: Million Token Contexts on Commodity GPUscited by 5
- 2025Mamba Adaptive Anomaly Transformer with association discrepancy for time seriescited by 5
- 2025Spark Transformer: Reactivating Sparsity in FFN and Attentioncited by 5
- 2023Consciousness-Inspired Spatio-Temporal Abstractions for Better Generalization in Reinforcement Learningcited by 4
- 2024TrackFormers: In Search of Transformer-Based Particle Tracking for the High-Luminosity LHC Eracited by 4
- 2025Intrinsically Interpretable Attention via Sparse Post-Trainingcited by 4
- 2025A Mathematical Theory of Top-k Sparse Attention via Total Variation Distancecited by 4
- 2026IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMscited by 4
- 2024Fibottention: Inceptive Visual Representation Learning with Diverse Attention Across Headscited by 3
- 2024LevAttention: Time, Space, and Streaming Efficient Algorithm for Heavy Attentionscited by 3
- 2026SOCKET: SOft Collision Kernel EsTimator for Sparse Attentioncited by 3
- 2023Approximating ReLU on a Reduced Ring for Efficient MPC-based Private Inferencecited by 2
- 2025Top-Theta Attention: Sparsifying Transformers by Compensated Thresholdingcited by 2
- 2025LiteCache: A Query Similarity-Driven, GPU-Centric KVCache Subsystem for Efficient LLM Inferencecited by 2
- 2026Sparse Attention as Compact Kernel Regressioncited by 2
- 2026Improving Sparse Autoencoder with Dynamic Attentioncited by 2
- 2024Extended Mind Transformerscited by 1
- 2025Power Law Guided Dynamic Sifting for Efficient Attentioncited by 1
- 2025Crisp Attention: Regularizing Transformers via Structured Sparsitycited by 1
- 2025Block Sparse Flash Attentioncited by 1
- 2026Free Energy Mixercited by 1
- 2026Explainable Token-level Noise Filtering for LLM Fine-tuning Datasetscited by 1
- 2026Residual-Mass Accounting for Partial-KV Decodingcited by 1
- 2026Stochastic Sparse Attention for Memory-Bound Inferencecited by 1
- 2026Z-Order Transformer for Feed-Forward Gaussian Splattingcited by 1
50 most cited of 59 All 59 (JSON)
- 2026SANTA++: Sampling Attention through Representative Keys28 Sep 2026
- 2026ARM: Attention with Routed-Memory for Learnable Sparse Control21 Sep 2026
- 2026LiteTopK: Exploiting the Curse of Dimensionality for a Fused Indexer-TopK Kernel in Long-Context Sparse Attention13 Jul 2026
- 2026Z-Order Transformer for Feed-Forward Gaussian Splatting13 May 2026
- 2026Stochastic Sparse Attention for Memory-Bound Inference3 May 2026
- 2026Improving Sparse Autoencoder with Dynamic Attention16 Apr 2026
- 2026IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMs12 Apr 2026
- 2026Residual-Mass Accounting for Partial-KV Decoding7 Apr 2026
- 2026k-Maximum Inner Product Attention for Graph Transformers and the Expressive Power of GraphGPS4 Apr 2026
- 2026Explainable Token-level Noise Filtering for LLM Fine-tuning Datasets16 Feb 2026
- 2026Free Energy Mixer6 Feb 2026
- 2026SOCKET: SOft Collision Kernel EsTimator for Sparse Attention6 Feb 2026
38 more
- 2026HyLRA: Hybrid Layer Reuse Attention for Efficient Long-Context Inference31 Jan 2026
- 2026Sparse Attention as Compact Kernel Regression30 Jan 2026
- 2025A Mathematical Theory of Top-k Sparse Attention via Total Variation Distance8 Dec 2025
- 2025Block Sparse Flash Attention7 Dec 2025
- 2025Intrinsically Interpretable Attention via Sparse Post-Training5 Dec 2025
- 2025LiteCache: A Query Similarity-Driven, GPU-Centric KVCache Subsystem for Efficient LLM Inference18 Nov 2025
- 2025Crisp Attention: Regularizing Transformers via Structured Sparsity8 Aug 2025
- 2025TopK Language Models26 Jun 2025
- 2025Transformer Circuits Can Realize Clustering Algorithms23 Jun 2025
- 2025Long-Context Generalization with Sparse Attention19 Jun 2025
- 2025SoftStep: Learning Sparse Similarity Powers Deep Neighbor-Based Regression9 Jun 2025
- 2025Spark Transformer: Reactivating Sparsity in FFN and Attention7 Jun 2025
- 2025Power Law Guided Dynamic Sifting for Efficient Attention5 Jun 2025
- 2025HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model Inference3 Jun 2025
- 2025AdaSplash: Adaptive Sparse Flash Attention17 Feb 2025
- 2025Top-Theta Attention: Sparsifying Transformers by Compensated Thresholding12 Feb 2025
- 2025Mamba Adaptive Anomaly Transformer with association discrepancy for time series11 Feb 2025
- 2025Exploiting Sparsity for Long Context Inference: Million Token Contexts on Commodity GPUs10 Feb 2025
- 2025ZETA: Leveraging Z-order Curves for Efficient Top-k Attention24 Jan 2025
- 2024Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Models21 Dec 2024
- 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashing13 Dec 2024
- 2024kNN Attention Demystified: A Theoretical Exploration for Scalable Transformers6 Nov 2024
- 2024LevAttention: Time, Space, and Streaming Efficient Algorithm for Heavy Attentions7 Oct 2024
- 2024MagicDec: Breaking the Latency-Throughput Tradeoff for Long Context Generation with Speculative Decoding20 Aug 2024
- 2024Pick of the Bunch: Detecting Infrared Small Targets Beyond Hit-Miss Trade-Offs via Selective Rank-Aware Attention7 Aug 2024
- 2024TrackFormers: In Search of Transformer-Based Particle Tracking for the High-Luminosity LHC Era9 Jul 2024
- 2024Fibottention: Inceptive Visual Representation Learning with Diverse Attention Across Heads27 Jun 2024
- 2024Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformers24 Jun 2024
- 2024Loki: Low-rank Keys for Efficient Sparse Attention4 Jun 2024
- 2024Extended Mind Transformers4 Jun 2024
- 2024MultiMax: Sparse and Multi-Modal Attention Learning3 Jun 2024
- 2024IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUs5 May 2024
- 2024What makes Models Compositional? A Theoretical View: With Supplement2 May 2024
- 2024Nonparametric Modern Hopfield Models5 Apr 2024
- 2024LoMA: Lossless Compressed Memory Attention16 Jan 2024
- 2023Towards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systems23 Dec 2023
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languages21 Oct 2023
- 2023Consciousness-Inspired Spatio-Temporal Abstractions for Better Generalization in Reinforcement Learning30 Sep 2023
50 newest of 59 All 59 (JSON)
- 2023Towards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systemscited by 101
- 2024MagicDec: Breaking the Latency-Throughput Tradeoff for Long Context Generation with Speculative Decodingcited by 87
- 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashingcited by 6
- 2025HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model Inferencecited by 6
- 2024LoMA: Lossless Compressed Memory Attentioncited by 5
- 2026IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMscited by 4
- 2025LiteCache: A Query Similarity-Driven, GPU-Centric KVCache Subsystem for Efficient LLM Inferencecited by 2
- 2026Stochastic Sparse Attention for Memory-Bound Inferencecited by 1
- 2026Stochastic Sparse Attention for Memory-Bound Inference3 May 2026
- 2026IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMs12 Apr 2026
- 2025LiteCache: A Query Similarity-Driven, GPU-Centric KVCache Subsystem for Efficient LLM Inference18 Nov 2025
- 2025HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model Inference3 Jun 2025
- 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashing13 Dec 2024
- 2024MagicDec: Breaking the Latency-Throughput Tradeoff for Long Context Generation with Speculative Decoding20 Aug 2024
- 2024LoMA: Lossless Compressed Memory Attention16 Jan 2024
- 2023Towards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systems23 Dec 2023
- 2022Memorizing Transformerscited by 219
- 2023BiFormer: Vision Transformer with Bi-Level Routing Attentioncited by 150
- 2022The Lazy Neuron Phenomenon: On Emergence of Activation Sparsity in Transformerscited by 121
- 2024Loki: Low-rank Keys for Efficient Sparse Attentioncited by 87
- 2022Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Modelscited by 52
- 2024Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformerscited by 51
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 47
- 2024Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Modelscited by 26
- 2025Long-Context Generalization with Sparse Attentioncited by 18
- 2024Pick of the Bunch: Detecting Infrared Small Targets Beyond Hit-Miss Trade-Offs via Selective Rank-Aware Attentioncited by 17
- 2024Nonparametric Modern Hopfield Modelscited by 16
- 2021On Learning the Transformer Kernelcited by 14
12 most cited of 49 All 49 (JSON)
- 2026SANTA++: Sampling Attention through Representative Keys28 Sep 2026
- 2026ARM: Attention with Routed-Memory for Learnable Sparse Control21 Sep 2026
- 2026LiteTopK: Exploiting the Curse of Dimensionality for a Fused Indexer-TopK Kernel in Long-Context Sparse Attention13 Jul 2026
- 2026Z-Order Transformer for Feed-Forward Gaussian Splatting13 May 2026
- 2026Improving Sparse Autoencoder with Dynamic Attention16 Apr 2026
- 2026Residual-Mass Accounting for Partial-KV Decoding7 Apr 2026
- 2026k-Maximum Inner Product Attention for Graph Transformers and the Expressive Power of GraphGPS4 Apr 2026
- 2026Explainable Token-level Noise Filtering for LLM Fine-tuning Datasets16 Feb 2026
- 2026Free Energy Mixer6 Feb 2026
- 2026SOCKET: SOft Collision Kernel EsTimator for Sparse Attention6 Feb 2026
- 2026HyLRA: Hybrid Layer Reuse Attention for Efficient Long-Context Inference31 Jan 2026
- 2026Sparse Attention as Compact Kernel Regression30 Jan 2026
12 newest of 49 All 49 (JSON)