mlsanityData to 14 Oct 2026

Fast Attention Requires Bounded Entries

arXiv 2302.13214 ↗First posted 26 Feb 2023cs.LG cs.CC cs.DScited by 102

Not on the map. Why?

Abstract (arXiv)

In modern machine learning, inner product attention computation is a fundamental task for training large language models such as Transformer, GPT-1, BERT, GPT-2, GPT-3 and ChatGPT. Formally, in this problem, one is given as input three matrices Q, K, V ∈ [-B,B]n × d, and the goal is to construct the matrix Att(Q,K,V) := diag(A bf 1n)-1 A V ∈ ℝn × d, where A = exp(QK^top/d) is the `attention matrix', and exp is applied entry-wise. Straightforward methods for this problem explicitly compute the n × n attention matrix A, and hence require time Omega(n2) even when d = no(1) is small. In this paper, we investigate whether faster algorithms are possible by implicitly making use of the matrix A. We present two results, showing that there is a sharp transition at B = Theta(√log n). bullet If d = O(log n) and B = o(√log n), there is an n1+o(1) time algorithm to approximate Att(Q,K,V) up to 1/poly(n) additive error. bullet If d = O(log n) and B = Theta (√log n), assuming the Strong Exponential Time Hypothesis from fine-grained complexity theory, it is impossible to approximate Att(Q,K,V) up to 1/poly(n) additive error in truly subquadratic time n2 - Omega(1). This gives a theoretical explanation for the phenomenon observed in practice that attention computation is much more efficient when the input matrices have smaller entries.

Key facts. Cited by 102 papers in the map (data through 14 Oct 2026). Builds on 25 of its 44 references that are in the map. First posted on arXiv 26 Feb 2023.

Builds on

25 of 44 references.

References · 25

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  5. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
  6. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  7. 2020Reformer: The Efficient Transformercited by 1,668
  8. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  9. 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
  10. 2019Q8BERT: Quantized 8Bit BERTcited by 300
  11. 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 213
  12. 2022On The Computational Complexity of Self-Attentioncited by 139
13 more
  1. 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 130
  2. 2021Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Modelscited by 76
  3. 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
  4. 2020SMYRF: Efficient Attention using Asymmetric Clusteringcited by 43
  5. 2018Hashing-Based-Estimators for Kernel Density in High Dimensionscited by 33
  6. 2020Kernel Density Estimation through Density Constrained Near Neighbor Searchcited by 29
  7. 2020Algorithms and Hardness for Linear Algebra on Geometric Graphscited by 22
  8. 2018Hardness of Approximate Nearest Neighbor Searchcited by 19
  9. 2022Optimal-Degree Polynomial Approximations for Exponentials and Gaussian Kernel Density Estimationcited by 19
  10. 2017On the Fine-Grained Complexity of Empirical Risk Minimization: Kernel Methods and Neural Networkscited by 16
  11. 2018On Closest Pair in Euclidean Metric: Monochromatic is as Hard as Bichromaticcited by 6
  12. 2018Multi-Resolution Hashing for Fast Pairwise Summationscited by 2
  13. 2020Metric Transforms and Low Rank Matrices via Representation Theory of the Real Hyperrectanglecited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 38; 2024: 29; 2025: 25; 2026: 10.

102 papers.

Sort:

By area:

  1. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
  2. 2023Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Timecited by 252
  3. 2024The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicrycited by 120
  4. 2024MagicPIG: LSH Sampling for Efficient LLM Generationcited by 111
  5. 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
  6. 2025On the Emergence of Position Bias in Transformerscited by 59
  7. 2023Attention Scheme Inspired Softmax Regressioncited by 49
  8. 2024On the Role of Attention Masks and LayerNorm in Transformerscited by 48
  9. 2023An Over-parameterized Exponential Regressioncited by 45
  10. 2023Solving Regularized Exp, Cosh and Sinh Regression Problemscited by 44
  11. 2023How to Capture Higher-order Correlations? Generalizing Matrix Softmax Attention to Kronecker Computationcited by 44
  12. 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regressioncited by 41
38 more
  1. 2024Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Modelscited by 38
  2. 2024Outlier-Efficient Hopfield Layers for Large Transformer-Based Modelscited by 38
  3. 2023Randomized and Deterministic Attention Sparsification Algorithms for Over-parameterized Feature Dimensioncited by 37
  4. 2023PolySketchFormer: Fast Transformers via Sketching Polynomial Kernelscited by 36
  5. 2023An Iterative Algorithm for Rescaled Hyperbolic Functions Regressioncited by 35
  6. 2023In-Context Learning for Attention Scheme: from Single Softmax Regression to Multiple Softmax Regression via a Tensor Trickcited by 32
  7. 2024Computational Limits of Low-Rank Adaptation (LoRA) Fine-Tuning for Transformer Modelscited by 31
  8. 2023InfoPrompt: Information-Theoretic Soft Prompt Tuning for Natural Language Understandingcited by 30
  9. 2023A Fast Optimization View: Reformulating Single Layer Attention in LLM Based on Tensor and SVM Trick, and Solving It in Matrix Multiplication Timecited by 30
  10. 2024The Fine-Grained Complexity of Gradient Computation for Training Large Language Modelscited by 30
  11. 2024Training Tensor Attention Efficiently: From Cubic to Almost Linear Timecited by 30
  12. 2023A Mathematical Abstraction for Balancing the Trade-off Between Creativity and Reality in Large Language Modelscited by 29
  13. 2023How to Protect Copyright Data in Optimization of Large Language Models?cited by 26
  14. 2024Circuit Complexity Bounds for RoPE-based Transformer Architecturecited by 26
  15. 2023Differentially Private Attention Computationcited by 25
  16. 2023GradientCoin: A Peer-to-Peer Decentralized Large Language Modelscited by 23
  17. 2024Multi-Layer Transformers Gradient Can be Approximated in Almost Linear Timecited by 22
  18. 2024SubGen: Token Generation in Sublinear Time and Memorycited by 21
  19. 2024The Computational Limits of State-Space Models and Mamba via the Lens of Circuit Complexitycited by 21
  20. 2023Solving Attention Kernel Regression Problem via Pre-conditionercited by 20
  21. 2024Do Efficient Transformers Really Save Computation?cited by 20
  22. 2024A Tighter Complexity Analysis of SparseGPTcited by 19
  23. 2024Looped ReLU MLPs May Be All You Need as Practical Programmable Computerscited by 19
  24. 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
  25. 2023Beyond Classical Attention: Quantum Attention for Scalable Computationcited by 18
  26. 2025Your Vision-Language Model Can't Even Count to 20: Exposing the Failures of VLMs in Compositional Countingcited by 18
  27. 2023Zero-th Order Algorithm for Softmax Attention Optimizationcited by 16
  28. 2023Why Softmax Attention Outperforms Linear Attentioncited by 15
  29. 2024Provable Differentially Private Computation of the Cross-Attention Mechanismcited by 14
  30. 2024RoPE Attention Can Be Trained in Almost Linear Timecited by 13
  31. 2023A Unified Scheme of ResNet and Softmaxcited by 12
  32. 2023Unmasking Transformers: A Theoretical Approach to Data Recovery via Attention Weightscited by 12
  33. 2023Efficient SGD Neural Network Training via Sublinear Activated Neuron Identificationcited by 11
  34. 2025Video Latent Flow Matching: Optimal Polynomial Projections for Video Interpolation and Extrapolationcited by 11
  35. 2025On Computational Limits of FlowAR Models: Expressivity and Efficiencycited by 10
  36. 2023Federated Empirical Risk Minimization via Second-Order Methodcited by 9
  37. 2023Local Convergence of Approximate Newton Method for Two Layer Nonlinear Regressioncited by 9
  38. 2024Fundamental Limitations on Subquadratic Alternatives to Transformerscited by 9

50 most cited of 102 All 102 (JSON)