In-Context Learning through the Bayesian Prism
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
- 2017Attention Is All You Needcited by 60,106
- 2014Adam: A Method for Stochastic Optimizationcited by 37,093
- 2020Language Models are Few-Shot Learnerscited by 32,320
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,223
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,072
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,628
- 2022Training Compute-Optimal Large Language Modelscited by 2,972
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,229
- 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,978
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,424
- 2018On the Spectral Bias of Neural Networkscited by 1,329
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,093
23 more
- 2020Meta-Learning in Neural Networks: A Surveycited by 945
- 2022In-context Learning and Induction Headscited by 940
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 925
- 2022Transformers learn in-context by gradient descentcited by 720
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 706
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 676
- 2021MetaICL: Learning to Learn In Contextcited by 452
- 2023Larger language models do in-context learning differentlycited by 387
- 2021Do Prompt-Based Models Really Understand the Meaning of their Prompts?cited by 326
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 305
- 2020Spectral Bias and Task-Model Alignment Explain Generalization in Kernel Regression and Infinitely Wide Neural Networkscited by 166
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 151
- 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
- 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoningcited by 142
- 2023A Theory of Emergent In-Context Learning as Implicit Structure Inductioncited by 86
- 2020A Mathematical Exploration of Why Language Models Help Solve Downstream Taskscited by 71
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 69
- 2023The No Free Lunch Theorem, Kolmogorov Complexity, and the Role of Inductive Biases in Machine Learningcited by 63
- 2022Transformers generalize differently from information stored in context vs in weightscited by 49
- 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrationscited by 49
- 2021Spectral Bias in Practice: The Role of Function Frequency in Generalizationcited by 36
- 2023Deep neural networks have an inbuilt Occam's razorcited by 28
- 2023How to Plant Trees in Language Models: Data and Architectural Effects on the Emergence of Syntactic Inductive Biasescited by 23
Built on by
Citing papers per year: 2023: 9; 2024: 21; 2025: 29; 2026: 19.
78 papers.
Sort:
By area:
- 2023Trained Transformers Learn Linear Models In-Contextcited by 333
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2023In-Context Convergence of Transformerscited by 114
- 2024Position: Graph Foundation Models are Already Herecited by 84
- 2024Can large language models explore in-context?cited by 75
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
- 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 52
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 38
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
- 2025Enough Coin Flips Can Make LLMs Act Bayesiancited by 22
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
38 more
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 19
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2024From Words to Actions: Unveiling the Theoretical Underpinnings of LLM-Driven Autonomous Systemscited by 17
- 2023Transformers can optimally learn regression mixture modelscited by 15
- 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 14
- 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superpositioncited by 13
- 2025Effortless, Simulation-Efficient Bayesian Inference using Tabular Foundation Modelscited by 13
- 2025The Bayesian Geometry of Transformer Attentioncited by 13
- 2024MLPs Learn In-Context on Regression and Classification Taskscited by 12
- 2025Dynamics of Transient Structure in In-Context Linear Regression Transformerscited by 12
- 2024What Should Embeddings Embed? Autoregressive Models Represent Latent Generating Distributionscited by 10
- 2025Solving Empirical Bayes via Transformerscited by 9
- 2023Transformers are Provably Optimal In-context Estimators for Wireless Communicationscited by 8
- 2023Decoding In-Context Learning: Neuroscience-inspired Analysis of Representations in Large Language Modelscited by 7
- 2024In-context learning and Occam's razorcited by 7
- 2024Unveiling In-Context Learning: A Coordinate System to Understand Its Working Mechanismcited by 6
- 2025Analyzing limits for in-context learningcited by 6
- 2025Understanding Prompt Tuning and In-Context Learning via Meta-Learningcited by 6
- 2024DETAIL: Task DEmonsTration Attribution for Interpretable In-context Learningcited by 5
- 2024Re-examining learning linear functions in contextcited by 5
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 5
- 2025On the Robustness of Transformers against Context Hijacking for Linear Classificationcited by 4
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Flycited by 4
- 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and Whencited by 3
- 2024Label Words as Local Task Vectors in In-Context Learningcited by 3
- 2024Overcoming classic challenges for artificial neural networks by providing incentives and practicecited by 3
- 2025Context and Diversity Matter: The Emergence of In-Context Learning in World Modelscited by 3
- 2025Optimal In-context Adaptivity and Distributional Robustness of Transformerscited by 3
- 2025The Initialization Determines Whether In-Context Learning Is Gradient Descentcited by 3
- 2024Towards Better Understanding of In-Context Learning Ability from In-Context Uncertainty Quantificationcited by 2
- 2025CoT-ICL Lab: A Synthetic Framework for Studying Chain-of-Thought Learning from In-Context Demonstrationscited by 2
- 2025Evaluating the Use of Large Language Models as Synthetic Social Agents in Social Science Researchcited by 2
- 2025Fine-Grained Emotion Recognition via In-Context Learningcited by 2
- 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agentscited by 2
- 2026From Drift to Coherence: Stabilizing Beliefs in LLMscited by 2
- 2023Bidirectional Attention as a Mixture of Continuous Word Expertscited by 1
- 2025An evolutionary perspective on modes of learning in Transformerscited by 1
- 2025In-Context Bias Propagation in LLM-Based Tabular Data Generationcited by 1
50 most cited of 78 All 78 (JSON)
- 2026Bayesian Fine-tuning Yields Language Models that are as Bayesian as their Beliefs Allow30 Sep 2026
- 2026Beyond the Shadows of Plato's Cave: Evaluating False Memory in Autonomous Agents via Counterfactual Reasoning30 Sep 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Understanding In-Context Multimodal Jailbreaks via Posterior Reweighting8 Sep 2026
- 2026Elicitation without Backpropagation: Steering Model Behavior by Optimizing the Latent Posterior21 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
- 2026Bayesian Wind Tunnels for Model Selection1 Jul 2026
- 2026From Drift to Coherence: Stabilizing Beliefs in LLMs16 Jun 2026
- 2026Structure and Scale in Simplicial Sequence Modelling31 May 2026
- 2026When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning25 May 2026
- 2026Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning20 May 2026
38 more
- 2026Temporal Task Diversity: Inductive Biases Under Non-Stationarity in Synthetic Sequence Modelling18 May 2026
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoning23 Apr 2026
- 2026Demonstrations, CoT, and Prompting: A Theoretical Analysis of ICL20 Mar 2026
- 2026Reconciling In-Context and In-Weight Learning via Dual Representation Space Encoding13 Mar 2026
- 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thought16 Feb 2026
- 2026Universal priors: solving empirical Bayes via Bayesian inference and pretraining16 Feb 2026
- 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agents5 Feb 2026
- 2025The Bayesian Geometry of Transformer Attention27 Dec 2025
- 2025The Initialization Determines Whether In-Context Learning Is Gradient Descent3 Dec 2025
- 2025Semantic Anchors in In-Context Learning: Why Small LLMs Cannot Flip Their Labels26 Nov 2025
- 2025Genomic Next-Token Predictors are In-Context Learners16 Nov 2025
- 2025Optimal In-context Adaptivity and Distributional Robustness of Transformers27 Oct 2025
- 2025A Framework for Quantifying How Pre-Training and Context Benefit In-Context Learning26 Oct 2025
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning13 Oct 2025
- 2025On the Relationship Between the Choice of Representation and In-Context Learning9 Oct 2025
- 2025Fine-Grained Emotion Recognition via In-Context Learning8 Oct 2025
- 2025Evaluating the Use of Large Language Models as Synthetic Social Agents in Social Science Research30 Sep 2025
- 2025Context and Diversity Matter: The Emergence of In-Context Learning in World Models26 Sep 2025
- 2025Meta-Learning Transformers to Improve In-Context Generalization7 Jul 2025
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Fly24 Jun 2025
- 2025Brewing Knowledge in Context: Distillation Perspectives on In-Context Learning13 Jun 2025
- 2025In-Context Bias Propagation in LLM-Based Tabular Data Generation11 Jun 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025Understanding Prompt Tuning and In-Context Learning via Meta-Learning22 May 2025
- 2025An evolutionary perspective on modes of learning in Transformers14 May 2025
- 2025Effortless, Simulation-Efficient Bayesian Inference using Tabular Foundation Models24 Apr 2025
- 2025Decision Feedback In-Context Learning for Wireless Symbol Detection20 Mar 2025
- 2025Enough Coin Flips Can Make LLMs Act Bayesian6 Mar 2025
- 2025In-Context Learning with Hypothesis-Class Guidance27 Feb 2025
- 2025On the Robustness of Transformers against Context Hijacking for Linear Classification21 Feb 2025
- 2025CoT-ICL Lab: A Synthetic Framework for Studying Chain-of-Thought Learning from In-Context Demonstrations21 Feb 2025
- 2025Solving Empirical Bayes via Transformers14 Feb 2025
- 2025Technical Debt in In-Context Learning: Diminishing Efficiency in Long Context7 Feb 2025
- 2025Exploring Imbalanced Annotations for Effective In-Context Learning6 Feb 2025
- 2025Analyzing limits for in-context learning5 Feb 2025
- 2025Dynamics of Transient Structure in In-Context Linear Regression Transformers29 Jan 2025
- 2024Re-examining learning linear functions in context18 Nov 2024
- 2024Toward Understanding In-context vs. In-weight Learning30 Oct 2024
50 newest of 78 All 78 (JSON)
- 2025CoT-ICL Lab: A Synthetic Framework for Studying Chain-of-Thought Learning from In-Context Demonstrationscited by 2
- 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thoughtcited by 1
- 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
- 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thought16 Feb 2026
- 2025CoT-ICL Lab: A Synthetic Framework for Studying Chain-of-Thought Learning from In-Context Demonstrations21 Feb 2025
- 2023Trained Transformers Learn Linear Models In-Contextcited by 333
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2023In-Context Convergence of Transformerscited by 114
- 2024Position: Graph Foundation Models are Already Herecited by 84
- 2024Can large language models explore in-context?cited by 75
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
- 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 52
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 38
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
- 2025Enough Coin Flips Can Make LLMs Act Bayesiancited by 22
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
12 most cited of 69 All 69 (JSON)
- 2026Bayesian Fine-tuning Yields Language Models that are as Bayesian as their Beliefs Allow30 Sep 2026
- 2026Beyond the Shadows of Plato's Cave: Evaluating False Memory in Autonomous Agents via Counterfactual Reasoning30 Sep 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Elicitation without Backpropagation: Steering Model Behavior by Optimizing the Latent Posterior21 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
- 2026Bayesian Wind Tunnels for Model Selection1 Jul 2026
- 2026From Drift to Coherence: Stabilizing Beliefs in LLMs16 Jun 2026
- 2026Structure and Scale in Simplicial Sequence Modelling31 May 2026
- 2026When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning25 May 2026
- 2026Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning20 May 2026
- 2026Temporal Task Diversity: Inductive Biases Under Non-Stationarity in Synthetic Sequence Modelling18 May 2026
12 newest of 69 All 69 (JSON)