Transformers are almost optimal metalearners for linear classification
Not on the map. Why?
Abstract (arXiv)
Transformers have demonstrated impressive in-context learning (ICL) capabilities, raising the question of whether they can serve as metalearners that adapt to new tasks using only a small number of in-context examples, without any further training. While recent theoretical work has studied transformers' ability to perform ICL, most of these analyses do not address the formal metalearning setting, where the objective is to solve a collection of related tasks more efficiently than would be possible by solving each task individually. In this paper, we provide the first theoretical analysis showing that a simplified transformer architecture trained via gradient descent can act as a near-optimal metalearner in a linear classification setting. We consider a natural family of tasks where each task corresponds to a class-conditional Gaussian mixture model, with the mean vectors lying in a shared k-dimensional subspace of Rd. After training on a sufficient number of such tasks, we show that the transformer can generalize to a new task using only O(k / R4) in-context examples, where R denotes the signal strength at test time. This performance (almost) matches that of an optimal learner that knows exactly the shared subspace and significantly outperforms any learner that only has access to the in-context data, which requires Omega(d / R4) examples to generalize. Importantly, our bounds on the number of training tasks and examples per task needed to achieve this result are independent of the ambient dimension d.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 38 of its 48 references that are in the map. First posted on arXiv 22 Oct 2025.
Builds on
38 of 48 references.
References · 38
- 2017Attention Is All You Needcited by 60,361
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2017The Implicit Bias of Gradient Descent on Separable Datacited by 655
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2019Gradient Descent Maximizes the Margin of Homogeneous Neural Networkscited by 320
26 more
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2020Few-Shot Learning via Learning the Representation, Provablycited by 214
- 2015The Benefit of Multitask Representation Learningcited by 195
- 2020Directional convergence and alignment in deep learningcited by 178
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2020Provable Meta-Learning of Linear Representationscited by 161
- 2019On the Convergence Theory of Gradient-Based Model-Agnostic Meta-Learning Algorithmscited by 132
- 2023The Learnability of In-Context Learningcited by 127
- 2023In-Context Convergence of Transformerscited by 115
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 96
- 2022On the Implicit Bias in Deep-Learning Algorithmscited by 86
- 2023Max-Margin Token Selection in Attention Mechanismcited by 58
- 2021Generalization Bounds For Meta-Learning: An Information-Theoretic Analysiscited by 45
- 2020Robust Meta-learning for Mixed Linear Regression with Small Batchescited by 41
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 37
- 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 31
- 2022MAML and ANIL Provably Learn Representationscited by 30
- 2018Partial recovery bounds for clustering with the relaxed Kmeanscited by 25
- 2020A Sample Complexity Separation between Non-Convex and Convex Meta-Learningcited by 17
- 2024Trained Transformer Classifiers Generalize and Exhibit Benign Overfitting In-Contextcited by 15
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2023Metalearning with Very Few Samples Per Taskcited by 11
- 2025When and How Unlabeled Data Provably Improve In-Context Learningcited by 6
- 2022Multitask Learning via Shared Features: Algorithms and Hardnesscited by 5
Built on by
Citing papers per year: 2026: 1.
1 paper.