mlsanityData to 7 Oct 2026

How do Transformers perform In-Context Autoregressive Learning?

arXiv 2402.05787 ↗First posted 8 Feb 2024stat.ML cs.LGcited by 16

Not on the map. Why?

Abstract (arXiv)

Transformers have achieved state-of-the-art performance in language modeling tasks. However, the reasons behind their tremendous success are still unclear. In this paper, towards a better understanding, we train a Transformer model on a simple next token prediction task, where sequences are generated as a first-order autoregressive process st+1 = W st. We show how a trained Transformer predicts the next token by first learning W in-context, then applying a prediction mapping. We call the resulting procedure in-context autoregressive learning. More precisely, focusing on commuting orthogonal matrices W, we first show that a trained one-layer linear Transformer implements one step of gradient descent for the minimization of an inner objective function, when considering augmented tokens. When the tokens are not augmented, we characterize the global minima of a one-layer diagonal linear multi-head Transformer. Importantly, we exhibit orthogonality between heads and show that positional encoding captures trigonometric relations in the data. On the experimental side, we consider the general case of non-commuting orthogonal matrices and generalize our theoretical findings.

Key facts. Cited by 16 papers in the map (data through 7 Oct 2026). Builds on 33 of its 44 references that are in the map. First posted on arXiv 8 Feb 2024.

Builds on

33 of 44 references.

References · 33

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  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. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  7. 2016Layer Normalizationcited by 5,579
  8. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  9. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  10. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  11. 2023Mistral 7Bcited by 3,065
  12. 2022Training Compute-Optimal Large Language Modelscited by 2,927
21 more
  1. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  2. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  3. 2019Are Sixteen Heads Really Better than One?cited by 803
  4. 2022Transformers learn in-context by gradient descentcited by 714
  5. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  6. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  7. 2019Implicit Regularization in Deep Matrix Factorizationcited by 402
  8. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  9. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  10. 2020Kernel and Rich Regimes in Overparametrized Modelscited by 302
  11. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  12. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  13. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  14. 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
  15. 2021Implicit Bias of SGD for Diagonal Linear Networks: a Provable Benefit of Stochasticitycited by 107
  16. 2022Vision Transformers provably learn spatial structurecited by 92
  17. 2021A Practical Survey on Faster and Lighter Transformerscited by 73
  18. 2022The Principle of Diversity: Training Stronger Vision Transformers Calls for Reducing All Levels of Redundancycited by 35
  19. 2021The loss landscape of deep linear neural networks: a second-order analysiscited by 24
  20. 2021Convergence of gradient descent for learning linear neural networkscited by 22
  21. 2019Orthogonality Constrained Multi-Head Attention For Keyword Spottingcited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 6; 2025: 8; 2026: 2.

16 papers.

Sort:

By area: