Provably learning a multi-head attention layer
Not on the map. Why?
Abstract (arXiv)
The multi-head attention layer is one of the key components of the transformer architecture that sets it apart from traditional feed-forward models. Given a sequence length k, attention matrices Theta1,ldots,Thetam∈ℝd× d, and projection matrices W1,ldots,Wm∈ℝd× d, the corresponding multi-head attention layer F: ℝk× d→ ℝk× d transforms length-k sequences of d-dimensional tokens X∈ℝk× d via F(X) triangleq summi=1 softmax(XThetaiX^top)XWi. In this work, we initiate the study of provably learning a multi-head attention layer from random examples and give the first nontrivial upper and lower bounds for this problem: - Provided Wi, Thetai satisfy certain non-degeneracy conditions, we give a (dk)O(m3)-time algorithm that learns F to small error given random labeled examples drawn uniformly from ± 1k× d. - We prove computational lower bounds showing that in the worst case, exponential dependence on m is unavoidable. We focus on Boolean X to mimic the discrete nature of tokens in large language models, though our techniques naturally extend to standard continuous settings, e.g. Gaussian. Our algorithm, which is centered around using examples to sculpt a convex body containing the unknown parameters, is a significant departure from existing provable algorithms for learning feedforward networks, which predominantly exploit algebraic and rotation invariance properties of the Gaussian distribution. In contrast, our analysis is more flexible as it primarily relies on various upper and lower tail bounds for the input distribution and "slices" thereof.
Key facts. Cited by 21 papers in the map (data through 7 Oct 2026). Builds on 58 of its 80 references that are in the map. First posted on arXiv 6 Feb 2024.
Builds on
58 of 80 references.
References · 58
- 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
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2018Universal Transformerscited by 613
- 2023Textbooks Are All You Needcited by 561
- 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 559
- 2023TinyStories: How Small Can Language Models Be and Still Speak Coherent English?cited by 425
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
- 2018Learning and Generalization in Overparameterized Neural Networks, Going Beyond Two Layerscited by 340
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
38 more
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
- 2023A mathematical perspective on Transformerscited by 160
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2023SGD learning on neural networks: leap complexity and saddle-to-saddle dynamicscited by 142
- 2017Convergence Analysis of Two-layer Neural Networks with ReLU Activationcited by 137
- 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
- 2023The emergence of clusters in self-attention dynamicscited by 133
- 2023Representational Strengths and Limitations of Transformerscited by 132
- 2020Online stochastic gradient descent on non-convex losses from high-dimensional inferencecited by 119
- 2019Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of Viewcited by 108
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
- 2017Recovery Guarantees for One-hidden-layer Neural Networkscited by 94
- 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 92
- 2022Vision Transformers provably learn spatial structurecited by 92
- 2017Learning One-hidden-layer Neural Networks with Landscape Designcited by 79
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2017SGD Learns the Conjugate Kernel Class of the Networkcited by 54
- 2017Learning ReLUs via Gradient Descentcited by 54
- 2018Learning One-hidden-layer ReLU Networks via Gradient Descentcited by 50
- 2020Algorithms and SQ Lower Bounds for PAC Learning One-Hidden-Layer ReLU Networkscited by 49
- 2023On the Role of Attention in Prompt-tuningcited by 49
- 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 39
- 2018Learning Mixtures of Linear Regressions with Nearly Optimal Complexitycited by 37
- 2016Reliably Learning the ReLU in Polynomial Timecited by 36
- 2020Learning Polynomials of Few Relevant Dimensionscited by 34
- 2018Learning Two Layer Rectified Neural Networks in Polynomial Timecited by 31
- 2020Small Covers for Near-Zero Sets of Polynomials and Learning Latent Variable Modelscited by 28
- 2023Sequence Length Independent Norm-Based Generalization Bounds for Transformerscited by 28
- 2022Hardness of Noise-Free Learning for Two-Hidden-Layer Neural Networkscited by 27
- 2021From Local Pseudorandom Generators to Hardness of Learningcited by 24
- 2018Learning Two-layer Neural Networks with Symmetric Inputscited by 22
- 2018Learning One Convolutional Layer with Overlapping Patchescited by 21
- 2018Gradient Descent for One-Hidden-Layer Neural Networks: Polynomial Convergence and SQ Lower Boundscited by 18
- 2015ℓ1-regularized Neural Networks are Improperly Learnable in Polynomial Timecited by 16
- 2023Learning Narrow One-Hidden-Layer ReLU Networkscited by 14
- 2018Breaking the gridlock in Mixture-of-Experts: Consistent and Efficient Algorithmscited by 13
50 most cited of 58 All 58 (JSON)
Built on by
Citing papers per year: 2024: 11; 2025: 6; 2026: 4.
21 papers.
Sort:
By area:
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Measure-to-measure interpolation using Transformerscited by 28
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformerscited by 11
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
9 more
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
- 2024Learning Linear Attention in Polynomial Timecited by 5
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 4
- 2025Provably Learning from Modern Language Models via Low Logit Rankcited by 3
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformerscited by 2
- 2026Provably Learning Multi-Head Attention with Queriescited by 2
- 2025Transformers Provably Learn Sparse XOR with Polylogarithmic Parameterscited by 1
- 2026Provably Learning Attention with Queriescited by 1
- 2026Convergent Stochastic Training of Multi-Headed Attention and Understanding LoRAcited by 1
- 2026Provably Learning Multi-Head Attention with Queries4 Aug 2026
- 2026Convergent Stochastic Training of Multi-Headed Attention and Understanding LoRA8 May 2026
- 2026Provably Learning Attention with Queries23 Jan 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Provably Learning from Modern Language Models via Low Logit Rank10 Dec 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Bias2 May 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Transformers Provably Learn Sparse XOR with Polylogarithmic Parameters11 Feb 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025
- 2024Measure-to-measure interpolation using Transformers7 Nov 2024
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selection18 Oct 2024
9 more
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recovery17 Oct 2024
- 2024Learning Linear Attention in Polynomial Time14 Oct 2024
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysis12 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Prediction25 Sep 2024
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformers22 May 2024
- 2024Mechanics of Next Token Prediction with Self-Attention12 Mar 2024
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Models28 Feb 2024
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?23 Feb 2024
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Measure-to-measure interpolation using Transformerscited by 28
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformerscited by 11
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
12 most cited of 20 All 20 (JSON)
- 2026Provably Learning Multi-Head Attention with Queries4 Aug 2026
- 2026Convergent Stochastic Training of Multi-Headed Attention and Understanding LoRA8 May 2026
- 2026Provably Learning Attention with Queries23 Jan 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Provably Learning from Modern Language Models via Low Logit Rank10 Dec 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Bias2 May 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Transformers Provably Learn Sparse XOR with Polylogarithmic Parameters11 Feb 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025
- 2024Measure-to-measure interpolation using Transformers7 Nov 2024
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selection18 Oct 2024
12 newest of 20 All 20 (JSON)