mlsanityData to 14 Oct 2026

An Analysis of Attention via the Lens of Exchangeability and Latent Variable Models

arXiv 2212.14852 ↗First posted 30 Dec 2022cs.LGcited by 16

Not on the map. Why?

Abstract (arXiv)

With the attention mechanism, transformers achieve significant empirical successes. Despite the intuitive understanding that transformers perform relational inference over long sequences to produce desirable representations, we lack a rigorous theory on how the attention mechanism achieves it. In particular, several intriguing questions remain open: (a) What makes a desirable representation? (b) How does the attention mechanism infer the desirable representation within the forward pass? (c) How does a pretraining procedure learn to infer the desirable representation through the backward pass? We observe that, as is the case in BERT and ViT, input tokens are often exchangeable since they already include positional encodings. The notion of exchangeability induces a latent variable model that is invariant to input sizes, which enables our theoretical analysis. - To answer (a) on representation, we establish the existence of a sufficient and minimal representation of input tokens. In particular, such a representation instantiates the posterior distribution of the latent variable given input tokens, which plays a central role in predicting output labels and solving downstream tasks. - To answer (b) on inference, we prove that attention with the desired parameter infers the latent posterior up to an approximation error, which is decreasing in input sizes. In detail, we quantify how attention approximates the conditional mean of the value given the key, which characterizes how it performs relational inference over long sequences. - To answer (c) on learning, we prove that both supervised and self-supervised objectives allow empirical risk minimization to learn the desired parameter up to a generalization error, which is independent of input sizes. Particularly, in the self-supervised setting, we identify a condition number that is pivotal to solving downstream tasks.

Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). Builds on 60 of its 92 references that are in the map. First posted on arXiv 30 Dec 2022.

Builds on

60 of 92 references.

References · 60

  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. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  5. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,403
  6. 2021Zero-Shot Text-to-Image Generationcited by 4,288
  7. 2018Neural Tangent Kernel: Convergence and Generalization in Neural Networkscited by 2,621
  8. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  9. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
  10. 2017Deep Setscited by 1,421
  11. 2018Relational inductive biases, deep learning, and graph networkscited by 1,360
  12. 2021Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gaugescited by 1,167
38 more
  1. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  2. 2018A Convergence Theory for Deep Learning via Over-Parameterizationcited by 787
  3. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  4. 2017Spectrally-normalized margin bounds for neural networkscited by 686
  5. 2018On Lazy Training in Differentiable Programmingcited by 675
  6. 2018Gradient Descent Provably Optimizes Over-parameterized Neural Networkscited by 659
  7. 2018Gradient Descent Finds Global Minima of Deep Neural Networkscited by 574
  8. 2019Fine-Grained Analysis of Optimization and Generalization for Overparameterized Two-Layer Neural Networkscited by 566
  9. 2019Fantastic Generalization Measures and Where to Find Themcited by 513
  10. 2018A Mean Field View of the Landscape of Two-Layers Neural Networkscited by 466
  11. 2016Kernel Mean Embedding of Distributions: A Review and Beyondcited by 364
  12. 2018Learning and Generalization in Overparameterized Neural Networks, Going Beyond Two Layerscited by 340
  13. 2018Learning Overparameterized Neural Networks via Stochastic Gradient Descent on Structured Datacited by 261
  14. 2019Generalization Bounds of Stochastic Gradient Descent for Wide and Deep Neural Networkscited by 222
  15. 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 213
  16. 2019Mean-field theory of two-layers neural networks: dimension-free bounds and kernel limitcited by 187
  17. 2019Universal Invariant and Equivariant Graph Neural Networkscited by 183
  18. 2021E(n) Equivariant Normalizing Flowscited by 165
  19. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  20. 2020Tensor Programs II: Neural Tangent Kernel for Any Architecturecited by 143
  21. 2016A vector-contraction inequality for Rademacher complexitiescited by 142
  22. 2018Stochastic Gradient Descent Optimizes Over-parameterized Deep ReLU Networkscited by 141
  23. 2018Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networkscited by 132
  24. 2019An Improved Analysis of Training Over-parameterized Deep Neural Networkscited by 121
  25. 2020Infinite attention: NNGP and NTK for deep attention networkscited by 121
  26. 2022A Kernel-Based View of Language Model Fine-Tuningcited by 121
  27. 2019Kernel Instrumental Variable Regressioncited by 118
  28. 2021Self-Attention Between Datapoints: Going Beyond Individual Input-Output Pairs in Deep Learningcited by 113
  29. 2016Identity Matters in Deep Learningcited by 109
  30. 2018Mean Field Analysis of Neural Networks: A Central Limit Theoremcited by 107
  31. 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 106
  32. 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 102
  33. 2020LieTransformer: Equivariant self-attention for Lie Groupscited by 100
  34. 2018On the Convergence Rate of Training Recurrent Neural Networkscited by 82
  35. 2013Divide and Conquer Kernel Ridge Regression: A Distributed Algorithm with Minimax Optimal Ratescited by 65
  36. 2020Group Equivariant Stand-Alone Self-Attention For Visioncited by 63
  37. 2021Tensor Programs IIb: Architectural Universality of Neural Tangent Kernel Training Dynamicscited by 57
  38. 2022Geometrically Equivariant Graph Neural Networks: A Surveycited by 56

50 most cited of 60 All 60 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 7; 2024: 3; 2025: 4; 2026: 2.

16 papers.

Sort:

By area:

  1. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  2. 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 86
  3. 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 74
  4. 2025Nested Learning: The Illusion of Deep Learning Architecturescited by 72
  5. 2025ATLAS: Learning to Optimally Memorize the Context at Test Timecited by 66
  6. 2023Reason for Future, Act for Now: A Principled Framework for Autonomous LLM Agents with Provable Sample Efficiencycited by 46
  7. 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Inputcited by 32
  8. 2024Understanding Scaling Laws with Statistical and Approximation Theory for Transformer Neural Networks on Intrinsically Low-dimensional Datacited by 30
  9. 2023Sequence Length Independent Norm-Based Generalization Bounds for Transformerscited by 29
  10. 2023A Mechanism for Sample-Efficient In-Context Learning for Sparse Retrieval Taskscited by 17
  11. 2025Federated In-Context Learning: Iterative Refinement for Improved Answer Qualitycited by 8
  12. 2024Learning Linear Attention in Polynomial Timecited by 5
4 more
  1. 2023DF2: Distribution-Free Decision-Focused Learningcited by 3
  2. 2026Tight Sample Complexity of Transformerscited by 2
  3. 2024Deep spatial context: when attention-based models meet spatial regressioncited by 1
  4. 2026Spectrum-Adaptive Generalization Bounds for Trained Deep Transformerscited by 1