On the Expressive Power of Self-Attention Matrices
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
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,307
- 2021Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervisioncited by 3,864
- 2020Extracting Training Data from Large Language Modelscited by 2,189
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2020Reformer: The Efficient Transformercited by 1,668
- 2021ViViT: A Video Vision Transformercited by 1,620
- 2020Rethinking Attention with Performerscited by 1,601
19 more
- 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,254
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
- 2019On the Relationship between Self-Attention and Convolutional Layerscited by 300
- 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
- 2020ProGen: Language Modeling for Protein Generationcited by 128
- 2020Fast Transformers with Clustered Attentioncited by 123
- 2020Low-Rank Bottleneck in Multi-head Attention Modelscited by 89
- 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
- 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 83
- 2018Structured Evolution with Compact Architectures for Scalable Policy Optimizationcited by 48
- 2017The Unreasonable Effectiveness of Structured Random Orthogonal Embeddingscited by 45
- 2019Orthogonal Estimation of Wasserstein Distancescited by 32
- 2020On the Ability and Limitations of Transformers to Recognize Formal Languagescited by 13
- 2016Recycling Randomness with Structure for Sublinear time Kernel Expansionscited by 9
- 2020Demystifying Orthogonal Monte Carlo and Beyondcited by 8
- 2016Structured adaptive and random spinners for fast machine learning computationscited by 6
- 2015Binary embeddings with structured hashed projectionscited by 3
Built on by
Citing papers per year: 2021: 3; 2022: 1; 2023: 15; 2024: 10; 2025: 10; 2026: 8.
47 papers.
Sort:
By area:
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 383
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2022Pure Transformers are Powerful Graph Learnerscited by 188
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2023Representational Strengths and Limitations of Transformerscited by 133
- 2025FlexPrefill: A Context-Aware Sparse Attention Mechanism for Efficient Long-Sequence Inferencecited by 123
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
- 2023The Expressive Power of Low-Rank Adaptationcited by 102
- 2024Transformers, parallel computation, and logarithmic depthcited by 79
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2025Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thoughtcited by 77
35 more
- 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
- 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
- 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?cited by 47
- 2023How Smooth Is Attention?cited by 44
- 2023When Do Prompting and Prefix-Tuning Work? A Theory of Capabilities and Limitationscited by 43
- 2024SampleAttention: Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attentioncited by 39
- 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
- 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Inputcited by 32
- 2023Sumformer: Universal Approximation for Efficient Transformerscited by 30
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
- 2024Prompting a Pretrained Transformer Can Be a Universal Approximatorcited by 25
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 22
- 2021Can Vision Transformers Perform Convolution?cited by 18
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
- 2025Sample Complexity and Representation Ability of Test-time Scaling Paradigmscited by 12
- 2025ProxyAttn: Guided Sparse Attention via Representative Headscited by 9
- 2021Self-attention Presents Low-dimensional Knowledge Graph Embeddings for Link Predictioncited by 8
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 6
- 2023Decoding Layer Saliency in Language Transformerscited by 5
- 2024A Theory for Compressibility of Graph Transformers for Transductive Learningcited by 3
- 2025Approximation of Permutation Invariant Polynomials by Transformers: Efficient Construction in Column-Sizecited by 3
- 2025When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspectivecited by 3
- 2026Looped Transformers with Layer Normalization Provably Learn the Power Methodcited by 2
- 2023Self-attention Dual Embedding for Graphs with Heterophilycited by 1
- 2026Transformer Is Inherently a Causal Learnercited by 1
- 2025Attention Condensation via Sparsity Induced Regularized Trainingcited by 0
- 2025Johnson-Lindenstrauss Lemma Guided Network for Efficient 3D Medical Segmentationcited by 0
- 2025Vocabulary In-Context Learning in Transformers: Benefits of Positional Encodingcited by 0
- 2026Nexusformer: Nonlinear Attention Expansion for Stable and Inheritable Transformer Scalingcited by 0
- 2026Analogies between Transformer Layers and Power Methodcited by 0
- 2026CRISP: Cliff-awaRe Input-adaptive Sparse Prefilling with Structural-Mass-Motivated Routingcited by 0
- 2026Information-Theoretic Analysis of Next-Token Prediction under Markovian Datacited by 0
- 2026On the Trade-off Between Information Loss and Generalization in Sparse Attentioncited by 0
- 2026Asymptotic Analysis of Discrete-Time Self-Attention Dynamics in Transformerscited by 0
- 2026Asymptotic Analysis of Discrete-Time Self-Attention Dynamics in Transformers9 Oct 2026
- 2026On the Trade-off Between Information Loss and Generalization in Sparse Attention3 Oct 2026
- 2026Information-Theoretic Analysis of Next-Token Prediction under Markovian Data28 Sep 2026
- 2026CRISP: Cliff-awaRe Input-adaptive Sparse Prefilling with Structural-Mass-Motivated Routing1 Sep 2026
- 2026Looped Transformers with Layer Normalization Provably Learn the Power Method30 May 2026
- 2026Analogies between Transformer Layers and Power Method25 May 2026
- 2026Nexusformer: Nonlinear Attention Expansion for Stable and Inheritable Transformer Scaling21 Apr 2026
- 2026Transformer Is Inherently a Causal Learner9 Jan 2026
- 2025Vocabulary In-Context Learning in Transformers: Benefits of Positional Encoding9 Nov 2025
- 2025ProxyAttn: Guided Sparse Attention via Representative Heads29 Sep 2025
- 2025Johnson-Lindenstrauss Lemma Guided Network for Efficient 3D Medical Segmentation26 Sep 2025
- 2025Sample Complexity and Representation Ability of Test-time Scaling Paradigms5 Jun 2025
35 more
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thought18 May 2025
- 2025When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspective14 Mar 2025
- 2025Attention Condensation via Sparsity Induced Regularized Training3 Mar 2025
- 2025FlexPrefill: A Context-Aware Sparse Attention Mechanism for Efficient Long-Sequence Inference28 Feb 2025
- 2025Approximation of Permutation Invariant Polynomials by Transformers: Efficient Construction in Column-Size17 Feb 2025
- 2024A Theory for Compressibility of Graph Transformers for Transductive Learning20 Nov 2024
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention2 Jul 2024
- 2024SampleAttention: Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attention17 Jun 2024
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannot11 Jun 2024
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamics7 May 2024
- 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encoding5 Mar 2024
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Models28 Feb 2024
- 2024Prompting a Pretrained Transformer Can Be a Universal Approximator22 Feb 2024
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitzness18 Feb 2024
- 2024Transformers, parallel computation, and logarithmic depth14 Feb 2024
- 2023How Smooth Is Attention?22 Dec 2023
- 2023When Do Prompting and Prefix-Tuning Work? A Theory of Capabilities and Limitations30 Oct 2023
- 2023The Expressive Power of Low-Rank Adaptation26 Oct 2023
- 2023On the Optimization and Generalization of Multi-head Attention19 Oct 2023
- 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attention1 Oct 2023
- 2023Decoding Layer Saliency in Language Transformers9 Aug 2023
- 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?26 Jul 2023
- 2023Sumformer: Universal Approximation for Efficient Transformers5 Jul 2023
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models24 Jun 2023
- 2023Trained Transformers Learn Linear Models In-Context16 Jun 2023
- 2023Representational Strengths and Limitations of Transformers5 Jun 2023
- 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Input30 May 2023
- 2023Self-attention Dual Embedding for Graphs with Heterophily28 May 2023
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformer25 May 2023
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexity12 Feb 2023
- 2022Pure Transformers are Powerful Graph Learners6 Jul 2022
- 2021Self-attention Presents Low-dimensional Knowledge Graph Embeddings for Link Prediction20 Dec 2021
- 2021Can Vision Transformers Perform Convolution?2 Nov 2021
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanisms19 Oct 2021
- 2023The Expressive Power of Low-Rank Adaptationcited by 102
- 2023The Expressive Power of Low-Rank Adaptation26 Oct 2023
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 383
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2022Pure Transformers are Powerful Graph Learnerscited by 188
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2023Representational Strengths and Limitations of Transformerscited by 133
- 2025FlexPrefill: A Context-Aware Sparse Attention Mechanism for Efficient Long-Sequence Inferencecited by 123
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
- 2024Transformers, parallel computation, and logarithmic depthcited by 79
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
- 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
- 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?cited by 47
12 most cited of 42 All 42 (JSON)
- 2026Asymptotic Analysis of Discrete-Time Self-Attention Dynamics in Transformers9 Oct 2026
- 2026On the Trade-off Between Information Loss and Generalization in Sparse Attention3 Oct 2026
- 2026Information-Theoretic Analysis of Next-Token Prediction under Markovian Data28 Sep 2026
- 2026CRISP: Cliff-awaRe Input-adaptive Sparse Prefilling with Structural-Mass-Motivated Routing1 Sep 2026
- 2026Looped Transformers with Layer Normalization Provably Learn the Power Method30 May 2026
- 2026Analogies between Transformer Layers and Power Method25 May 2026
- 2026Nexusformer: Nonlinear Attention Expansion for Stable and Inheritable Transformer Scaling21 Apr 2026
- 2026Transformer Is Inherently a Causal Learner9 Jan 2026
- 2025Vocabulary In-Context Learning in Transformers: Benefits of Positional Encoding9 Nov 2025
- 2025ProxyAttn: Guided Sparse Attention via Representative Heads29 Sep 2025
- 2025Johnson-Lindenstrauss Lemma Guided Network for Efficient 3D Medical Segmentation26 Sep 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
12 newest of 42 All 42 (JSON)