mlsanityData to 13 Oct 2026

In-Context Learning through the Bayesian Prism

arXiv 2306.04891 ↗First posted 8 Jun 2023cs.LG cs.CLcited by 78

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) is one of the surprising and useful features of large language models and subject of intense research. Recently, stylized meta-learning-like ICL setups have been devised that train transformers on sequences of input-output pairs (x, f(x)). The function f comes from a function class and generalization is checked by evaluating on sequences generated from unseen functions from the same class. One of the main discoveries in this line of research has been that for several function classes, such as linear regression, transformers successfully generalize to new functions in the class. However, the inductive biases of these models resulting in this behavior are not clearly understood. A model with unlimited training data and compute is a Bayesian predictor: it learns the pretraining distribution. In this paper we empirically examine how far this Bayesian perspective can help us understand ICL. To this end, we generalize the previous meta-ICL setup to hierarchical meta-ICL setup which involve unions of multiple task families. We instantiate this setup on a diverse range of linear and nonlinear function families and find that transformers can do ICL in this setting as well. Where Bayesian inference is tractable, we find evidence that high-capacity transformers mimic the Bayesian predictor. The Bayesian perspective provides insights into the inductive bias of ICL and how transformers perform a particular task when they are trained on multiple tasks. We also find that transformers can learn to generalize to new function classes that were not seen during pretraining. This involves deviation from the Bayesian predictor. We examine these deviations in more depth offering new insights and hypotheses.

Key facts. Cited by 78 papers in the map (data through 13 Oct 2026). Builds on 35 of its 51 references that are in the map. First posted on arXiv 8 Jun 2023.

Builds on

35 of 51 references.

References · 35

  1. 2017Attention Is All You Needcited by 60,106
  2. 2014Adam: A Method for Stochastic Optimizationcited by 37,093
  3. 2020Language Models are Few-Shot Learnerscited by 32,320
  4. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,223
  5. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,072
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,628
  7. 2022Training Compute-Optimal Large Language Modelscited by 2,972
  8. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,229
  9. 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,978
  10. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,424
  11. 2018On the Spectral Bias of Neural Networkscited by 1,329
  12. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,093
23 more
  1. 2020Meta-Learning in Neural Networks: A Surveycited by 945
  2. 2022In-context Learning and Induction Headscited by 940
  3. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 925
  4. 2022Transformers learn in-context by gradient descentcited by 720
  5. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 706
  6. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 676
  7. 2021MetaICL: Learning to Learn In Contextcited by 452
  8. 2023Larger language models do in-context learning differentlycited by 387
  9. 2021Do Prompt-Based Models Really Understand the Meaning of their Prompts?cited by 326
  10. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 305
  11. 2020Spectral Bias and Task-Model Alignment Explain Generalization in Kernel Regression and Infinitely Wide Neural Networkscited by 166
  12. 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 151
  13. 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
  14. 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoningcited by 142
  15. 2023A Theory of Emergent In-Context Learning as Implicit Structure Inductioncited by 86
  16. 2020A Mathematical Exploration of Why Language Models Help Solve Downstream Taskscited by 71
  17. 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 69
  18. 2023The No Free Lunch Theorem, Kolmogorov Complexity, and the Role of Inductive Biases in Machine Learningcited by 63
  19. 2022Transformers generalize differently from information stored in context vs in weightscited by 49
  20. 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrationscited by 49
  21. 2021Spectral Bias in Practice: The Role of Function Frequency in Generalizationcited by 36
  22. 2023Deep neural networks have an inbuilt Occam's razorcited by 28
  23. 2023How to Plant Trees in Language Models: Data and Architectural Effects on the Emergence of Syntactic Inductive Biasescited by 23

Built on by

Cited by year (2026 to 13 Oct)

Citing papers per year: 2023: 9; 2024: 21; 2025: 29; 2026: 19.

78 papers.

Sort:

By area:

  1. 2023Trained Transformers Learn Linear Models In-Contextcited by 333
  2. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
  3. 2023In-Context Convergence of Transformerscited by 114
  4. 2024Position: Graph Foundation Models are Already Herecited by 84
  5. 2024Can large language models explore in-context?cited by 75
  6. 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
  7. 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 52
  8. 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 38
  9. 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
  10. 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
  11. 2025Enough Coin Flips Can Make LLMs Act Bayesiancited by 22
  12. 2024Toward Understanding In-context vs. In-weight Learningcited by 19
38 more
  1. 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 19
  2. 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
  3. 2024From Words to Actions: Unveiling the Theoretical Underpinnings of LLM-Driven Autonomous Systemscited by 17
  4. 2023Transformers can optimally learn regression mixture modelscited by 15
  5. 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 14
  6. 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superpositioncited by 13
  7. 2025Effortless, Simulation-Efficient Bayesian Inference using Tabular Foundation Modelscited by 13
  8. 2025The Bayesian Geometry of Transformer Attentioncited by 13
  9. 2024MLPs Learn In-Context on Regression and Classification Taskscited by 12
  10. 2025Dynamics of Transient Structure in In-Context Linear Regression Transformerscited by 12
  11. 2024What Should Embeddings Embed? Autoregressive Models Represent Latent Generating Distributionscited by 10
  12. 2025Solving Empirical Bayes via Transformerscited by 9
  13. 2023Transformers are Provably Optimal In-context Estimators for Wireless Communicationscited by 8
  14. 2023Decoding In-Context Learning: Neuroscience-inspired Analysis of Representations in Large Language Modelscited by 7
  15. 2024In-context learning and Occam's razorcited by 7
  16. 2024Unveiling In-Context Learning: A Coordinate System to Understand Its Working Mechanismcited by 6
  17. 2025Analyzing limits for in-context learningcited by 6
  18. 2025Understanding Prompt Tuning and In-Context Learning via Meta-Learningcited by 6
  19. 2024DETAIL: Task DEmonsTration Attribution for Interpretable In-context Learningcited by 5
  20. 2024Re-examining learning linear functions in contextcited by 5
  21. 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 5
  22. 2025On the Robustness of Transformers against Context Hijacking for Linear Classificationcited by 4
  23. 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Flycited by 4
  24. 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and Whencited by 3
  25. 2024Label Words as Local Task Vectors in In-Context Learningcited by 3
  26. 2024Overcoming classic challenges for artificial neural networks by providing incentives and practicecited by 3
  27. 2025Context and Diversity Matter: The Emergence of In-Context Learning in World Modelscited by 3
  28. 2025Optimal In-context Adaptivity and Distributional Robustness of Transformerscited by 3
  29. 2025The Initialization Determines Whether In-Context Learning Is Gradient Descentcited by 3
  30. 2024Towards Better Understanding of In-Context Learning Ability from In-Context Uncertainty Quantificationcited by 2
  31. 2025CoT-ICL Lab: A Synthetic Framework for Studying Chain-of-Thought Learning from In-Context Demonstrationscited by 2
  32. 2025Evaluating the Use of Large Language Models as Synthetic Social Agents in Social Science Researchcited by 2
  33. 2025Fine-Grained Emotion Recognition via In-Context Learningcited by 2
  34. 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agentscited by 2
  35. 2026From Drift to Coherence: Stabilizing Beliefs in LLMscited by 2
  36. 2023Bidirectional Attention as a Mixture of Continuous Word Expertscited by 1
  37. 2025An evolutionary perspective on modes of learning in Transformerscited by 1
  38. 2025In-Context Bias Propagation in LLM-Based Tabular Data Generationcited by 1

50 most cited of 78 All 78 (JSON)