mlsanityData to 7 Oct 2026

Pretraining task diversity and the emergence of non-Bayesian in-context learning for regression

arXiv 2306.15063 ↗First posted 26 Jun 2023cs.LG cs.AI cs.CLcited by 138

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

  1. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2022Training language models to follow instructions with human feedbackcited by 15,712
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  6. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  7. 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,462
  8. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
  9. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
  10. 2022In-context Learning and Induction Headscited by 930
  11. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  12. 2022Super-NaturalInstructions: Generalization via Declarative Instructions on 1600+ NLP Taskscited by 858
16 more
  1. 2023The Flan Collection: Designing Data and Methods for Effective Instruction Tuningcited by 734
  2. 2022Transformers learn in-context by gradient descentcited by 714
  3. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  4. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  5. 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
  6. 2019Linear Mode Connectivity and the Lottery Ticket Hypothesiscited by 627
  7. 2021MetaICL: Learning to Learn In Contextcited by 450
  8. 2023Larger language models do in-context learning differentlycited by 386
  9. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
  10. 2019Risks from Learned Optimization in Advanced Machine Learning Systemscited by 250
  11. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  12. 2020Provable Meta-Learning of Linear Representationscited by 161
  13. 2022General-Purpose In-Context Learning by Meta-Learning Transformerscited by 102
  14. 2019Meta-Learning without Memorizationcited by 92
  15. 2022Unmasking the Lottery Ticket Hypothesis: What's Encoded in a Winning Ticket's Mask?cited by 38
  16. 2022The Effect of Diversity in Meta-Learningcited by 13

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 12; 2024: 45; 2025: 48; 2026: 33.

138 papers.

Sort:

By area:

  1. 2023Uncovering mesa-optimization algorithms in Transformerscited by 94
  2. 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
  3. 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 82
  4. 2024Can large language models explore in-context?cited by 75
  5. 2023A Benchmark for Learning to Translate a New Language from One Grammar Bookcited by 74
  6. 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 72
  7. 2024Asymptotic theory of in-context learning by linear attentioncited by 54
  8. 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 51
  9. 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
  10. 2023Pretraining Data Mixtures Enable Narrow Model Selection Capabilities in Transformer Modelscited by 45
  11. 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
  12. 2025Learning without training: The implicit dynamics of in-context learningcited by 41
38 more
  1. 2024Loss Landscape Degeneracy and Stagewise Development in Transformerscited by 39
  2. 2025On the generalization of language models from in-context learning and finetuning: a controlled studycited by 39
  3. 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
  4. 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
  5. 2025Emergent Abilities in Large Language Models: A Surveycited by 34
  6. 2024The broader spectrum of in-context learningcited by 33
  7. 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
  8. 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
  9. 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
  10. 2024Parallel Structures in Pre-training Data Yield In-Context Learningcited by 26
  11. 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steeringcited by 24
  12. 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
  13. 2023Bayes in the age of intelligent machinescited by 22
  14. 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
  15. 2023A Study on the Calibration of In-context Learningcited by 21
  16. 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
  17. 2024Differential learning kinetics govern the transition from memorization to generalization during in-context learningcited by 19
  18. 2025Position: The Future of Bayesian Prediction Is Prior-Fittedcited by 19
  19. 2023Do pretrained Transformers Learn In-Context by Gradient Descent?cited by 18
  20. 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
  21. 2024LLMs as Models for Analogical Reasoningcited by 16
  22. 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
  23. 2024What Do Language Models Learn in Context? The Structured Task Hypothesiscited by 13
  24. 2025When can in-context learning generalize out of task distribution?cited by 13
  25. 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 12
  26. 2024MLPs Learn In-Context on Regression and Classification Taskscited by 12
  27. 2025Dynamics of Transient Structure in In-Context Linear Regression Transformerscited by 12
  28. 2023In-Context Learning for MIMO Equalization Using Transformer-Based Sequence Modelscited by 11
  29. 2024Simplicity bias and optimization threshold in two-layer ReLU networkscited by 11
  30. 2024On the Role of Depth and Looping for In-Context Learning with Task Diversitycited by 11
  31. 2025Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networkscited by 11
  32. 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergencecited by 10
  33. 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
  34. 2025Position: An Empirically Grounded Identifiability Theory Will Accelerate Self-Supervised Learning Researchcited by 9
  35. 2025BARE: Leveraging Base Language Models for Few-Shot Synthetic Data Generationcited by 8
  36. 2024Automatic Domain Adaptation by Transformers in In-Context Learningcited by 7
  37. 2024Phase Transitions in the Output Distribution of Large Language Modelscited by 7
  38. 2024In-context learning and Occam's razorcited by 7

50 most cited of 138 All 138 (JSON)