mlsanityData to 7 Oct 2026

Provably learning a multi-head attention layer

arXiv 2402.04084 ↗First posted 6 Feb 2024cs.LG cs.DS stat.MLcited by 21

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  6. 2018Universal Transformerscited by 613
  7. 2023Textbooks Are All You Needcited by 561
  8. 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 559
  9. 2023TinyStories: How Small Can Language Models Be and Still Speak Coherent English?cited by 425
  10. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
  11. 2018Learning and Generalization in Overparameterized Neural Networks, Going Beyond Two Layerscited by 340
  12. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
38 more
  1. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  2. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
  3. 2023A mathematical perspective on Transformerscited by 160
  4. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  5. 2023SGD learning on neural networks: leap complexity and saddle-to-saddle dynamicscited by 142
  6. 2017Convergence Analysis of Two-layer Neural Networks with ReLU Activationcited by 137
  7. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
  8. 2023The emergence of clusters in self-attention dynamicscited by 133
  9. 2023Representational Strengths and Limitations of Transformerscited by 132
  10. 2020Online stochastic gradient descent on non-convex losses from high-dimensional inferencecited by 119
  11. 2019Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of Viewcited by 108
  12. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  13. 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
  14. 2017Recovery Guarantees for One-hidden-layer Neural Networkscited by 94
  15. 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 92
  16. 2022Vision Transformers provably learn spatial structurecited by 92
  17. 2017Learning One-hidden-layer Neural Networks with Landscape Designcited by 79
  18. 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
  19. 2017SGD Learns the Conjugate Kernel Class of the Networkcited by 54
  20. 2017Learning ReLUs via Gradient Descentcited by 54
  21. 2018Learning One-hidden-layer ReLU Networks via Gradient Descentcited by 50
  22. 2020Algorithms and SQ Lower Bounds for PAC Learning One-Hidden-Layer ReLU Networkscited by 49
  23. 2023On the Role of Attention in Prompt-tuningcited by 49
  24. 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 39
  25. 2018Learning Mixtures of Linear Regressions with Nearly Optimal Complexitycited by 37
  26. 2016Reliably Learning the ReLU in Polynomial Timecited by 36
  27. 2020Learning Polynomials of Few Relevant Dimensionscited by 34
  28. 2018Learning Two Layer Rectified Neural Networks in Polynomial Timecited by 31
  29. 2020Small Covers for Near-Zero Sets of Polynomials and Learning Latent Variable Modelscited by 28
  30. 2023Sequence Length Independent Norm-Based Generalization Bounds for Transformerscited by 28
  31. 2022Hardness of Noise-Free Learning for Two-Hidden-Layer Neural Networkscited by 27
  32. 2021From Local Pseudorandom Generators to Hardness of Learningcited by 24
  33. 2018Learning Two-layer Neural Networks with Symmetric Inputscited by 22
  34. 2018Learning One Convolutional Layer with Overlapping Patchescited by 21
  35. 2018Gradient Descent for One-Hidden-Layer Neural Networks: Polynomial Convergence and SQ Lower Boundscited by 18
  36. 2015ℓ1-regularized Neural Networks are Improperly Learnable in Polynomial Timecited by 16
  37. 2023Learning Narrow One-Hidden-Layer ReLU Networkscited by 14
  38. 2018Breaking the gridlock in Mixture-of-Experts: Consistent and Efficient Algorithmscited by 13

50 most cited of 58 All 58 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 11; 2025: 6; 2026: 4.

21 papers.

Sort:

By area:

  1. 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
  2. 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
  3. 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
  4. 2024Measure-to-measure interpolation using Transformerscited by 28
  5. 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
  6. 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
  7. 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
  8. 2024Next-token prediction capacity: general upper bounds and a lower bound for transformerscited by 11
  9. 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
  10. 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
  11. 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
  12. 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
9 more
  1. 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
  2. 2024Learning Linear Attention in Polynomial Timecited by 5
  3. 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 4
  4. 2025Provably Learning from Modern Language Models via Low Logit Rankcited by 3
  5. 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformerscited by 2
  6. 2026Provably Learning Multi-Head Attention with Queriescited by 2
  7. 2025Transformers Provably Learn Sparse XOR with Polylogarithmic Parameterscited by 1
  8. 2026Provably Learning Attention with Queriescited by 1
  9. 2026Convergent Stochastic Training of Multi-Headed Attention and Understanding LoRAcited by 1