mlsanityData to 7 Oct 2026

Non-asymptotic Convergence of Training Transformers for Next-token Prediction

arXiv 2409.17335 ↗First posted 25 Sep 2024cs.LG stat.MLcited by 13

Not on the map. Why?

Abstract (arXiv)

Transformers have achieved extraordinary success in modern machine learning due to their excellent ability to handle sequential data, especially in next-token prediction (NTP) tasks. However, the theoretical understanding of their performance in NTP is limited, with existing studies focusing mainly on asymptotic performance. This paper provides a fine-grained non-asymptotic analysis of the training dynamics of a one-layer transformer consisting of a self-attention module followed by a feed-forward layer. We first characterize the essential structural properties of training datasets for NTP using a mathematical framework based on partial orders. Then, we design a two-stage training algorithm, where the pre-processing stage for training the feed-forward layer and the main stage for training the attention layer exhibit fast convergence performance. Specifically, both layers converge sub-linearly to the direction of their corresponding max-margin solutions. We also show that the cross-entropy loss enjoys a linear convergence rate. Furthermore, we show that the trained transformer presents non-trivial prediction ability with dataset shift, which sheds light on the remarkable generalization performance of transformers. Our analysis technique involves the development of novel properties on the attention gradient and further in-depth analysis of how these properties contribute to the convergence of the training process. Our experiments further validate our theoretical findings.

Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 36 of its 46 references that are in the map. First posted on arXiv 25 Sep 2024.

Builds on

36 of 46 references.

References · 36

  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. 2021On the Opportunities and Risks of Foundation Modelscited by 3,961
  6. 2022Transformers learn in-context by gradient descentcited by 714
  7. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  8. 2017The Implicit Bias of Gradient Descent on Separable Datacited by 649
  9. 2019Multimodal Transformer for Unaligned Multimodal Language Sequencescited by 637
  10. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  11. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  12. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
24 more
  1. 2023Looped Transformers as Programmable Computerscited by 224
  2. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  3. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  4. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
  5. 2023In-Context Convergence of Transformerscited by 112
  6. 2018Convergence of Gradient Descent on Separable Datacited by 108
  7. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
  8. 2022On the Implicit Bias in Deep-Learning Algorithmscited by 84
  9. 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 82
  10. 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
  11. 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 71
  12. 2023Transformers as Support Vector Machinescited by 67
  13. 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
  14. 2023Max-Margin Token Selection in Attention Mechanismcited by 57
  15. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  16. 2022Implicit Bias in Leaky ReLU Networks Trained on High-Dimensional Datacited by 46
  17. 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
  18. 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
  19. 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
  20. 2021Fast Margin Maximization via Dual Accelerationcited by 33
  21. 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
  22. 2024Provably learning a multi-head attention layercited by 21
  23. 2023Implicit Bias of Gradient Descent for Two-layer ReLU and Leaky ReLU Networks on Nearly-orthogonal Datacited by 18
  24. 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17

Built on by

Cited by year (2026 to 7 Oct)

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

13 papers.

Sort: