Towards Understanding the Universality of Transformers for Next-Token Prediction
Not on the map. Why?
Abstract (arXiv)
Causal Transformers are trained to predict the next token for a given context. While it is widely accepted that self-attention is crucial for encoding the causal structure of sequences, the precise underlying mechanism behind this in-context autoregressive learning ability remains unclear. In this paper, we take a step towards understanding this phenomenon by studying the approximation ability of Transformers for next-token prediction. Specifically, we explore the capacity of causal Transformers to predict the next token xt+1 given an autoregressive sequence (x1, dots, xt) as a prompt, where xt+1 = f(xt) , and f is a context-dependent function that varies with each sequence. On the theoretical side, we focus on specific instances, namely when f is linear or when (xt)t ≥ 1 is periodic. We explicitly construct a Transformer (with linear, exponential, or softmax attention) that learns the mapping f in-context through a causal kernel descent method. The causal kernel descent method we propose provably estimates xt+1 based solely on past and current observations (x1, dots, xt) , with connections to the Kaczmarz algorithm in Hilbert spaces. We present experimental results that validate our theoretical findings and suggest their applicability to more general mappings f.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 28 of its 37 references that are in the map. First posted on arXiv 3 Oct 2024.
Builds on
28 of 37 references.
References · 28
- 2017Attention Is All You Needcited by 60,361
- 2015Deep Residual Learning for Image Recognitioncited by 52,096
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2018Neural Ordinary Differential Equationscited by 3,779
- 2023Mistral 7Bcited by 3,164
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2019Are Sixteen Heads Really Better than One?cited by 816
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
16 more
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2023The emergence of clusters in self-attention dynamicscited by 140
- 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 138
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 46
- 2024Transformers are Universal In-context Learnerscited by 43
- 2024Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modelingcited by 25
- 2023Implicit regularization of deep residual networks towards neural ODEscited by 20
- 2024How do Transformers perform In-Context Autoregressive Learning?cited by 17
- 2024Transformers are Expressive, But Are They Expressive Enough for Regression?cited by 6
Built on by
Citing papers per year: 2024: 1; 2025: 4; 2026: 4.
9 papers.
- 2024Measure-to-measure interpolation using Transformerscited by 29
- 2025Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for Reasoningcited by 10
- 2025Transformers through the lens of support-preserving maps between measurescited by 6
- 2025Optimal and Diffusion Transports in Machine Learningcited by 6
- 2025A Theoretical Analysis of Detecting Large Model-Generated Time Seriescited by 3
- 2026Measure-to-measure Regression with Transformerscited by 2
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regressioncited by 1
- 2026Quantum Maximum Likelihood Prediction via Hilbert Space Embeddingscited by 0
- 2026Information-Theoretic Analysis of Next-Token Prediction under Markovian Datacited by 0
- 2026Information-Theoretic Analysis of Next-Token Prediction under Markovian Data28 Sep 2026
- 2026Measure-to-measure Regression with Transformers27 May 2026
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression8 May 2026
- 2026Quantum Maximum Likelihood Prediction via Hilbert Space Embeddings20 Feb 2026
- 2025Optimal and Diffusion Transports in Machine Learning7 Dec 2025
- 2025A Theoretical Analysis of Detecting Large Model-Generated Time Series10 Nov 2025
- 2025Transformers through the lens of support-preserving maps between measures30 Sep 2025
- 2025Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for Reasoning7 Feb 2025
- 2024Measure-to-measure interpolation using Transformers7 Nov 2024