How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?
Not on the map. Why?
Abstract (arXiv)
Transformers pretrained on diverse tasks exhibit remarkable in-context learning (ICL) capabilities, enabling them to solve unseen tasks solely based on input contexts without adjusting model parameters. In this paper, we study ICL in one of its simplest setups: pretraining a linearly parameterized single-layer linear attention model for linear regression with a Gaussian prior. We establish a statistical task complexity bound for the attention model pretraining, showing that effective pretraining only requires a small number of independent tasks. Furthermore, we prove that the pretrained model closely matches the Bayes optimal algorithm, i.e., optimally tuned ridge regression, by achieving nearly Bayes optimal risk on unseen tasks under a fixed context length. These theoretical findings complement prior experimental research and shed light on the statistical foundations of ICL.
Key facts. Cited by 93 papers in the map (data through 7 Oct 2026). Builds on 26 of its 31 references that are in the map. First posted on arXiv 12 Oct 2023.
Builds on
26 of 31 references.
References · 26
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
14 more
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
- 2020Benign overfitting in ridge regressioncited by 152
- 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
- 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 112
- 2013Non-strongly-convex smooth stochastic approximation with convergence rate O(1/n)cited by 110
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2021Benign Overfitting of Constant-Stepsize SGD for Linear Regressioncited by 71
- 2019The Step Decay Schedule: A Near Optimal, Geometrically Decaying Learning Rate Procedure For Least Squarescited by 67
- 2016Harder, Better, Faster, Stronger Convergence Rates for Least-Squares Regressioncited by 64
- 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regressioncited by 41
- 2021Last Iterate Risk Bounds of SGD with Decaying Stepsize for Overparameterized Linear Regressioncited by 37
- 2017A Markov Chain Theory Approach to Characterizing the Minimax Optimality of Stochastic Gradient Descent (for Least Squares)cited by 25
- 2023Finite-Sample Analysis of Learning High-Dimensional Single ReLU Neuroncited by 8
Built on by
Citing papers per year: 2023: 2; 2024: 41; 2025: 35; 2026: 15.
93 papers.
Sort:
By area:
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
- 2024Can large language models explore in-context?cited by 75
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024Asymptotic theory of in-context learning by linear attentioncited by 54
- 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 54
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
- 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 43
- 2024Dual Operating Modes of In-Context Learningcited by 42
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
38 more
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
- 2024Iteration Head: A Mechanistic Study of Chain-of-Thoughtcited by 31
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methodscited by 27
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2024Probing the Decision Boundaries of In-context Learning in Large Language Modelscited by 17
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 17
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2025Test-Time Training Provably Improves Transformers as In-context Learnerscited by 15
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
- 2024Trained Transformer Classifiers Generalize and Exhibit Benign Overfitting In-Contextcited by 14
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 13
- 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superpositioncited by 13
- 2024Vector-ICL: In-context Learning with Continuous Vector Representationscited by 13
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidencecited by 13
- 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 12
- 2024MLPs Learn In-Context on Regression and Classification Taskscited by 12
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2025Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networkscited by 11
- 2025AI Agents as Universal Task Solverscited by 9
- 2023Transformers are Provably Optimal In-context Estimators for Wireless Communicationscited by 8
- 2025Understanding In-context Learning of Addition via Activation Subspacescited by 8
- 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitationscited by 8
- 2025Linear-Time Demonstration Selection for In-Context Learning via Gradient Estimationcited by 8
- 2024Understanding In-Context Learning of Linear Models in Transformers Through an Adversarial Lenscited by 7
- 2025On the Role of Transformer Feed-Forward Layers in Nonlinear In-Context Learningcited by 7
- 2024Context-Scaling versus Task-Scaling in In-Context Learningcited by 6
- 2025Analyzing limits for in-context learningcited by 6
- 2025Pretrain-Test Task Alignment Governs Generalization in In-Context Learningcited by 6
- 2024On Mesa-Optimization in Autoregressively Trained Transformers: Emergence and Capabilitycited by 5
- 2024In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learningcited by 5
- 2024Re-examining learning linear functions in contextcited by 5
50 most cited of 93 All 93 (JSON)
- 2026A Unified Framework for In-Context Learning with Causal and Masked Language Models5 Jul 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces5 Jun 2026
- 2026In-Context Reward Adaptation for Robust Preference Modeling28 May 2026
- 2026Understanding Generalization and Forgetting in In-Context Continual Learning27 May 2026
- 2026Unbiased Gradients, Moving Stability Boundaries: Exact Mini-Batch Geometry in Linear Self-Attention20 May 2026
- 2026Adaptivity Under Realizability Constraints: Comparing In-Context and Agentic Learning6 May 2026
- 2026Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theory14 Apr 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Reconciling In-Context and In-Weight Learning via Dual Representation Space Encoding13 Mar 2026
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models26 Feb 2026
38 more
- 2026Multi-layer Cross-attention is Provably Optimal for Multi-modal In-context Learning4 Feb 2026
- 2026Self-Generative Adversarial Fine-Tuning for Large Language Models1 Feb 2026
- 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMs31 Jan 2026
- 2025Optimal Attention Temperature Improves the Robustness of In-Context Learning under Distribution Shift in High Dimensions3 Nov 2025
- 2025How Data Mixing Shapes In-Context Learning: Asymptotic Equivalence for Transformers with MLPs29 Oct 2025
- 2025A Framework for Quantifying How Pre-Training and Context Benefit In-Context Learning26 Oct 2025
- 2025Transformers are almost optimal metalearners for linear classification22 Oct 2025
- 2025Seesaw: Accelerating Training by Balancing Learning Rate and Batch Size Scheduling16 Oct 2025
- 2025AI Agents as Universal Task Solvers14 Oct 2025
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning13 Oct 2025
- 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descent12 Oct 2025
- 2025Learning Linear Regression with Low-Rank Tasks in-Context6 Oct 2025
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time1 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2025Pretrain-Test Task Alignment Governs Generalization in In-Context Learning30 Sep 2025
- 2025In-Context Learning can Perform Continual Learning Like Humans26 Sep 2025
- 2025Asymptotic Study of In-context Learning with Random Transformers through Equivalent Models18 Sep 2025
- 2025Linear-Time Demonstration Selection for In-Context Learning via Gradient Estimation27 Aug 2025
- 2025Towards Theoretical Understanding of Transformer Test-Time Computing: Investigation on In-Context Linear Regression11 Aug 2025
- 2025Decomposing Prediction Mechanisms for In-Context Recall2 Jul 2025
- 2025A Simplified Analysis of SGD for Linear Regression with Weight Averaging18 Jun 2025
- 2025When and How Unlabeled Data Provably Improve In-Context Learning18 Jun 2025
- 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitations10 Jun 2025
- 2025Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networks6 Jun 2025
- 2025Optimization-Inspired Few-Shot Adaptation for Large Language Models25 May 2025
- 2025Understanding In-context Learning of Addition via Activation Subspaces8 May 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Test-Time Training Provably Improves Transformers as In-context Learners14 Mar 2025
- 2025Provable Benefits of Task-Specific Prompts for In-context Learning3 Mar 2025
- 2025In-Context Learning with Hypothesis-Class Guidance27 Feb 2025
- 2025Towards Auto-Regressive Next-Token Prediction: In-Context Learning Emerges from Generalization24 Feb 2025
- 2025On the Robustness of Transformers against Context Hijacking for Linear Classification21 Feb 2025
- 2025Why is prompting hard? Understanding prompts on binary sequence predictors15 Feb 2025
- 2025In-Context Learning of Linear Dynamical Systems with Transformers: Approximation Bounds and Depth-Separation12 Feb 2025
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence6 Feb 2025
- 2025Analyzing limits for in-context learning5 Feb 2025
- 2025On the Role of Transformer Feed-Forward Layers in Nonlinear In-Context Learning30 Jan 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025
50 newest of 93 All 93 (JSON)
- 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 43
- 2024Iteration Head: A Mechanistic Study of Chain-of-Thoughtcited by 31
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methodscited by 27
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 2
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methods25 Aug 2024
- 2024Iteration Head: A Mechanistic Study of Chain-of-Thought4 Jun 2024
- 2024A Theoretical Understanding of Self-Correction through In-context Alignment28 May 2024
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
- 2024Can large language models explore in-context?cited by 75
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024Asymptotic theory of in-context learning by linear attentioncited by 54
- 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 54
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
- 2024Dual Operating Modes of In-Context Learningcited by 42
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
12 most cited of 82 All 82 (JSON)
- 2026A Unified Framework for In-Context Learning with Causal and Masked Language Models5 Jul 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces5 Jun 2026
- 2026Understanding Generalization and Forgetting in In-Context Continual Learning27 May 2026
- 2026Unbiased Gradients, Moving Stability Boundaries: Exact Mini-Batch Geometry in Linear Self-Attention20 May 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Reconciling In-Context and In-Weight Learning via Dual Representation Space Encoding13 Mar 2026
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models26 Feb 2026
- 2026Multi-layer Cross-attention is Provably Optimal for Multi-modal In-context Learning4 Feb 2026
- 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMs31 Jan 2026
- 2025Optimal Attention Temperature Improves the Robustness of In-Context Learning under Distribution Shift in High Dimensions3 Nov 2025
- 2025How Data Mixing Shapes In-Context Learning: Asymptotic Equivalence for Transformers with MLPs29 Oct 2025
12 newest of 82 All 82 (JSON)