Pretraining task diversity and the emergence of non-Bayesian in-context learning for regression
Not on the map. Why?
Abstract (arXiv)
Pretrained transformers exhibit the remarkable ability of in-context learning (ICL): they can learn tasks from just a few examples provided in the prompt without updating any weights. This raises a foundational question: can ICL solve fundamentally textitnew tasks that are very different from those seen during pretraining? To probe this question, we examine ICL's performance on linear regression while varying the diversity of tasks in the pretraining dataset. We empirically demonstrate a textittask diversity threshold for the emergence of ICL. Below this threshold, the pretrained transformer cannot solve unseen regression tasks, instead behaving like a Bayesian estimator with the textitnon-diverse pretraining task distribution as the prior. Beyond this threshold, the transformer significantly outperforms this estimator; its behavior aligns with that of ridge regression, corresponding to a Gaussian prior over textitall tasks, including those not seen during pretraining. Thus, when pretrained on data with task diversity greater than the threshold, transformers textitcan optimally solve fundamentally new tasks in-context. Importantly, this capability hinges on it deviating from the Bayes optimal estimator with the pretraining distribution as the prior. This study also explores the effect of regularization, model capacity and task structure and underscores, in a concrete example, the critical role of task diversity, alongside data and model scale, in the emergence of ICL. Code is available at https://github.com/mansheej/icl-task-diversity.
Key facts. Cited by 138 papers in the map (data through 7 Oct 2026). Builds on 28 of its 33 references that are in the map. First posted on arXiv 26 Jun 2023.
Builds on
28 of 33 references.
References · 28
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,462
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2022In-context Learning and Induction Headscited by 930
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Super-NaturalInstructions: Generalization via Declarative Instructions on 1600+ NLP Taskscited by 858
16 more
- 2023The Flan Collection: Designing Data and Methods for Effective Instruction Tuningcited by 734
- 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
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
- 2019Linear Mode Connectivity and the Lottery Ticket Hypothesiscited by 627
- 2021MetaICL: Learning to Learn In Contextcited by 450
- 2023Larger language models do in-context learning differentlycited by 386
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2019Risks from Learned Optimization in Advanced Machine Learning Systemscited by 250
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2020Provable Meta-Learning of Linear Representationscited by 161
- 2022General-Purpose In-Context Learning by Meta-Learning Transformerscited by 102
- 2019Meta-Learning without Memorizationcited by 92
- 2022Unmasking the Lottery Ticket Hypothesis: What's Encoded in a Winning Ticket's Mask?cited by 38
- 2022The Effect of Diversity in Meta-Learningcited by 13
Built on by
Citing papers per year: 2023: 12; 2024: 45; 2025: 48; 2026: 33.
138 papers.
Sort:
By area:
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 94
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 82
- 2024Can large language models explore in-context?cited by 75
- 2023A Benchmark for Learning to Translate a New Language from One Grammar Bookcited by 74
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 72
- 2024Asymptotic theory of in-context learning by linear attentioncited by 54
- 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 51
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
- 2023Pretraining Data Mixtures Enable Narrow Model Selection Capabilities in Transformer Modelscited by 45
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2025Learning without training: The implicit dynamics of in-context learningcited by 41
38 more
- 2024Loss Landscape Degeneracy and Stagewise Development in Transformerscited by 39
- 2025On the generalization of language models from in-context learning and finetuning: a controlled studycited by 39
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
- 2025Emergent Abilities in Large Language Models: A Surveycited by 34
- 2024The broader spectrum of in-context learningcited by 33
- 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
- 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
- 2024Parallel Structures in Pre-training Data Yield In-Context Learningcited by 26
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steeringcited by 24
- 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
- 2023Bayes in the age of intelligent machinescited by 22
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2023A Study on the Calibration of In-context Learningcited by 21
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
- 2024Differential learning kinetics govern the transition from memorization to generalization during in-context learningcited by 19
- 2025Position: The Future of Bayesian Prediction Is Prior-Fittedcited by 19
- 2023Do pretrained Transformers Learn In-Context by Gradient Descent?cited by 18
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2024LLMs as Models for Analogical Reasoningcited by 16
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
- 2024What Do Language Models Learn in Context? The Structured Task Hypothesiscited by 13
- 2025When can in-context learning generalize out of task distribution?cited 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
- 2025Dynamics of Transient Structure in In-Context Linear Regression Transformerscited by 12
- 2023In-Context Learning for MIMO Equalization Using Transformer-Based Sequence Modelscited by 11
- 2024Simplicity bias and optimization threshold in two-layer ReLU networkscited by 11
- 2024On the Role of Depth and Looping for In-Context Learning with Task Diversitycited by 11
- 2025Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networkscited by 11
- 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergencecited by 10
- 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
- 2025Position: An Empirically Grounded Identifiability Theory Will Accelerate Self-Supervised Learning Researchcited by 9
- 2025BARE: Leveraging Base Language Models for Few-Shot Synthetic Data Generationcited by 8
- 2024Automatic Domain Adaptation by Transformers in In-Context Learningcited by 7
- 2024Phase Transitions in the Output Distribution of Large Language Modelscited by 7
- 2024In-context learning and Occam's razorcited by 7
50 most cited of 138 All 138 (JSON)
- 2026Verification with Transfer: Exact Information Frontiers and Their Price in Calls8 Oct 2026
- 2026Small transformers track Bayesian evidence for latent common causes via a context-invariant mechanism28 Sep 2026
- 2026Convergent Emergence of In-Context Learning Across Modalities12 Sep 2026
- 2026Shortcut Before Circuit: Document Statistics Time In-Context Conflict Resolution25 Aug 2026
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledge12 Aug 2026
- 2026Relative Positions Generalize, Absolute Positions Memorize: An Implicit-Bias Account of Length Generalization in Attention21 Jul 2026
- 2026What does a Bayes-filtered transformer believe? A predictive Monte Carlo approach19 Jul 2026
- 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
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026A Theoretical Interpretation of In-Context Learning via Probabilistic Modeling27 Jun 2026
- 2026Multi-Task Bayesian In-Context Learning18 Jun 2026
38 more
- 2026OpenRFM: Dissecting Relational In-Context Learning3 Jun 2026
- 2026Structure and Scale in Simplicial Sequence Modelling31 May 2026
- 2026Understanding Generalization and Forgetting in In-Context Continual Learning27 May 2026
- 2026A Systematic Study of Behavioral Cloning for Scientific Data Annotation26 May 2026
- 2026When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning25 May 2026
- 2026Temporal Task Diversity: Inductive Biases Under Non-Stationarity in Synthetic Sequence Modelling18 May 2026
- 2026In-Context Learning Operates as Concept Subspace Learning12 May 2026
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizer6 May 2026
- 2026When Context Sticks: Studying Interference in In-Context Learning25 Apr 2026
- 2026Multilinguality at the Edge: Developing Language Models for the Global South23 Apr 2026
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoning23 Apr 2026
- 2026Mechanistic Anomaly Detection via Functional Attribution21 Apr 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Polyglot Teachers: Evaluating Language Models for Multilingual Synthetic Data Generation13 Apr 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Understanding the Role of Rehearsal Scale in Continual Learning under Varying Model Capacities24 Feb 2026
- 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agents5 Feb 2026
- 2026Convergent World Representations and Divergent Tasks31 Jan 2026
- 2026Context Structure Reshapes the Representational Geometry of Language Models29 Jan 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformers21 Dec 2025
- 2025In-Context Algebra18 Dec 2025
- 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspective12 Dec 2025
- 2025Impact of Positional Encoding: Clean and Adversarial Rademacher Complexity for Transformers under In-Context Regression10 Dec 2025
- 2025Genomic Next-Token Predictors are In-Context Learners16 Nov 2025
- 2025Optimal Attention Temperature Improves the Robustness of In-Context Learning under Distribution Shift in High Dimensions3 Nov 2025
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steering1 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
- 2025On the Relationship Between the Choice of Representation and In-Context Learning9 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
- 2025Pretrain-Test Task Alignment Governs Generalization in In-Context Learning30 Sep 2025
- 2025Single-Head Attention in High Dimensions: A Theory of Generalization, Weights Spectra, and Scaling Laws29 Sep 2025
- 2025In-Context Learning can Perform Continual Learning Like Humans26 Sep 2025
- 2025Context and Diversity Matter: The Emergence of In-Context Learning in World Models26 Sep 2025
- 2025On Theoretical Interpretations of Concept-Based In-Context Learning25 Sep 2025
50 newest of 138 All 138 (JSON)
- 2025On the generalization of language models from in-context learning and finetuning: a controlled studycited by 39
- 2024LLMs as Models for Analogical Reasoningcited by 16
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 2
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoningcited by 0
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoning23 Apr 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2025On the generalization of language models from in-context learning and finetuning: a controlled study1 May 2025
- 2024LLMs as Models for Analogical Reasoning19 Jun 2024
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 82
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
- 2026A Systematic Study of Behavioral Cloning for Scientific Data Annotationcited by 0
- 2026A Systematic Study of Behavioral Cloning for Scientific Data Annotation26 May 2026
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression26 Oct 2023
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretraining12 Oct 2023
- 2026Mechanistic Anomaly Detection via Functional Attributioncited by 1
- 2026Mechanistic Anomaly Detection via Functional Attribution21 Apr 2026
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 94
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 2024Can large language models explore in-context?cited by 75
- 2023A Benchmark for Learning to Translate a New Language from One Grammar Bookcited by 74
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 72
- 2024Asymptotic theory of in-context learning by linear attentioncited by 54
- 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 51
- 2023Pretraining Data Mixtures Enable Narrow Model Selection Capabilities in Transformer Modelscited by 45
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2025Learning without training: The implicit dynamics of in-context learningcited by 41
- 2024Loss Landscape Degeneracy and Stagewise Development in Transformerscited by 39
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
12 most cited of 125 All 125 (JSON)
- 2026Verification with Transfer: Exact Information Frontiers and Their Price in Calls8 Oct 2026
- 2026Small transformers track Bayesian evidence for latent common causes via a context-invariant mechanism28 Sep 2026
- 2026Convergent Emergence of In-Context Learning Across Modalities12 Sep 2026
- 2026Shortcut Before Circuit: Document Statistics Time In-Context Conflict Resolution25 Aug 2026
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledge12 Aug 2026
- 2026Relative Positions Generalize, Absolute Positions Memorize: An Implicit-Bias Account of Length Generalization in Attention21 Jul 2026
- 2026What does a Bayes-filtered transformer believe? A predictive Monte Carlo approach19 Jul 2026
- 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
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026A Theoretical Interpretation of In-Context Learning via Probabilistic Modeling27 Jun 2026
- 2026Multi-Task Bayesian In-Context Learning18 Jun 2026
12 newest of 125 All 125 (JSON)