mlsanityData to 14 Oct 2026

On the Expressive Power of Self-Attention Matrices

arXiv 2106.03764 ↗First posted 7 Jun 2021cs.LGcited by 47

Not on the map. Why?

Abstract (arXiv)

Transformer networks are able to capture patterns in data coming from many domains (text, images, videos, proteins, etc.) with little or no change to architecture components. We perform a theoretical analysis of the core component responsible for signal propagation between elements, i.e. the self-attention matrix. In practice, this matrix typically exhibits two properties: (1) it is sparse, meaning that each token only attends to a small subset of other tokens; and (2) it changes dynamically depending on the input to the module. With these considerations in mind, we ask the following question: Can a fixed self-attention module approximate arbitrary sparse patterns depending on the input? How small is the hidden size d required for such approximation? We make progress in answering this question and show that the self-attention matrix can provably approximate sparse matrices, where sparsity is in terms of a bounded number of nonzero elements in each row and column. While the parameters of self-attention are fixed, various sparse matrices can be approximated by only modifying the inputs. Our proof is based on the random projection technique and uses the seminal Johnson-Lindenstrauss lemma. Our proof is constructive, enabling us to propose an algorithm for finding adaptive inputs and fixed self-attention parameters in order to approximate a given matrix. In particular, we show that, in order to approximate any sparse matrix up to a given precision defined in terms of preserving matrix element ratios, d grows only logarithmically with the sequence length L (i.e. d = O(log L)).

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

Builds on

31 of 46 references.

References · 31

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
  4. 2020Language Models are Few-Shot Learnerscited by 32,419
  5. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  6. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,307
  7. 2021Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervisioncited by 3,864
  8. 2020Extracting Training Data from Large Language Modelscited by 2,189
  9. 2020Big Bird: Transformers for Longer Sequencescited by 1,684
  10. 2020Reformer: The Efficient Transformercited by 1,668
  11. 2021ViViT: A Video Vision Transformercited by 1,620
  12. 2020Rethinking Attention with Performerscited by 1,601
19 more
  1. 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,254
  2. 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
  3. 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
  4. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
  5. 2019On the Relationship between Self-Attention and Convolutional Layerscited by 300
  6. 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
  7. 2020ProGen: Language Modeling for Protein Generationcited by 128
  8. 2020Fast Transformers with Clustered Attentioncited by 123
  9. 2020Low-Rank Bottleneck in Multi-head Attention Modelscited by 89
  10. 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
  11. 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 83
  12. 2018Structured Evolution with Compact Architectures for Scalable Policy Optimizationcited by 48
  13. 2017The Unreasonable Effectiveness of Structured Random Orthogonal Embeddingscited by 45
  14. 2019Orthogonal Estimation of Wasserstein Distancescited by 32
  15. 2020On the Ability and Limitations of Transformers to Recognize Formal Languagescited by 13
  16. 2016Recycling Randomness with Structure for Sublinear time Kernel Expansionscited by 9
  17. 2020Demystifying Orthogonal Monte Carlo and Beyondcited by 8
  18. 2016Structured adaptive and random spinners for fast machine learning computationscited by 6
  19. 2015Binary embeddings with structured hashed projectionscited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2021: 3; 2022: 1; 2023: 15; 2024: 10; 2025: 10; 2026: 8.

47 papers.

Sort:

By area:

  1. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
  2. 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 383
  3. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  4. 2022Pure Transformers are Powerful Graph Learnerscited by 188
  5. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  6. 2023Representational Strengths and Limitations of Transformerscited by 133
  7. 2025FlexPrefill: A Context-Aware Sparse Attention Mechanism for Efficient Long-Sequence Inferencecited by 123
  8. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
  9. 2023The Expressive Power of Low-Rank Adaptationcited by 102
  10. 2024Transformers, parallel computation, and logarithmic depthcited by 79
  11. 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
  12. 2025Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thoughtcited by 77
35 more
  1. 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
  2. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  3. 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?cited by 47
  4. 2023How Smooth Is Attention?cited by 44
  5. 2023When Do Prompting and Prefix-Tuning Work? A Theory of Capabilities and Limitationscited by 43
  6. 2024SampleAttention: Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attentioncited by 39
  7. 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
  8. 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Inputcited by 32
  9. 2023Sumformer: Universal Approximation for Efficient Transformerscited by 30
  10. 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
  11. 2024Prompting a Pretrained Transformer Can Be a Universal Approximatorcited by 25
  12. 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
  13. 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 22
  14. 2021Can Vision Transformers Perform Convolution?cited by 18
  15. 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
  16. 2025Sample Complexity and Representation Ability of Test-time Scaling Paradigmscited by 12
  17. 2025ProxyAttn: Guided Sparse Attention via Representative Headscited by 9
  18. 2021Self-attention Presents Low-dimensional Knowledge Graph Embeddings for Link Predictioncited by 8
  19. 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 6
  20. 2023Decoding Layer Saliency in Language Transformerscited by 5
  21. 2024A Theory for Compressibility of Graph Transformers for Transductive Learningcited by 3
  22. 2025Approximation of Permutation Invariant Polynomials by Transformers: Efficient Construction in Column-Sizecited by 3
  23. 2025When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspectivecited by 3
  24. 2026Looped Transformers with Layer Normalization Provably Learn the Power Methodcited by 2
  25. 2023Self-attention Dual Embedding for Graphs with Heterophilycited by 1
  26. 2026Transformer Is Inherently a Causal Learnercited by 1
  27. 2025Attention Condensation via Sparsity Induced Regularized Trainingcited by 0
  28. 2025Johnson-Lindenstrauss Lemma Guided Network for Efficient 3D Medical Segmentationcited by 0
  29. 2025Vocabulary In-Context Learning in Transformers: Benefits of Positional Encodingcited by 0
  30. 2026Nexusformer: Nonlinear Attention Expansion for Stable and Inheritable Transformer Scalingcited by 0
  31. 2026Analogies between Transformer Layers and Power Methodcited by 0
  32. 2026CRISP: Cliff-awaRe Input-adaptive Sparse Prefilling with Structural-Mass-Motivated Routingcited by 0
  33. 2026Information-Theoretic Analysis of Next-Token Prediction under Markovian Datacited by 0
  34. 2026On the Trade-off Between Information Loss and Generalization in Sparse Attentioncited by 0
  35. 2026Asymptotic Analysis of Discrete-Time Self-Attention Dynamics in Transformerscited by 0