In-Context Learning through the Bayesian Prism
Madhur Panwar, Kabir Ahuja, Navin Goyal
摘要
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 . The function 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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 27 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation 引用了 Language Models are Few-Shot Learners
- A Survey on In-context Learning 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- A Survey on In-context Learning 引用了 Language Models are Few-Shot Learners
- A Survey on In-context Learning 引用了 Transformers Learn In-Context by Gradient Descent
- A Survey on In-context Learning 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- An Explanation of In-context Learning as Implicit Bayesian Inference 引用了 Language Models are Few-Shot Learners
- Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspective 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspective 引用了 Language Models are Few-Shot Learners
- In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization 引用了 Language Models are Few-Shot Learners
- In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization 引用了 Transformers can optimally learn regression mixture models
- In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization 引用了 Transformers Learn In-Context by Gradient Descent
- In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Transformers can optimally learn regression mixture models 引用了 Language Models are Few-Shot Learners
- Transformers can optimally learn regression mixture models 引用了 Transformers Learn In-Context by Gradient Descent
- Transformers can optimally learn regression mixture models 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- In-Context Learning Strategies Emerge Rationally 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- In-Context Learning Strategies Emerge Rationally 引用了 Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspective
- In-Context Learning Strategies Emerge Rationally 引用了 Language Models are Few-Shot Learners
- In-Context Learning Strategies Emerge Rationally 引用了 Transformers Learn In-Context by Gradient Descent
- In-Context Learning Strategies Emerge Rationally 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Transformers Learn In-Context by Gradient Descent 引用了 Language Models are Few-Shot Learners
- Transformers Learn In-Context by Gradient Descent 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper27
- A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng 等EMNLP 2024 · 479 次引用
- Is In-Context Learning in Large Language Models Bayesian? A Martingale PerspectiveFabian Falck, Ziyu Wang, Christopher C. HolmesICML 2024 · 46 次引用
- In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD InitializationRuiqi Zhang, Jingfeng Wu, Peter L. BartlettNeurIPS 2024 · 37 次引用
- In-Context Learning Strategies Emerge RationallyDaniel Wurgaft, Ekdeep Singh Lubana, Core Francisco Park, Hidenori Tanaka 等NeurIPS 2025 · 19 次引用
- Transformers can optimally learn regression mixture modelsReese Pathak, Rajat Sen, Weihao Kong, Abhimanyu DasICLR 2024 · 16 次引用
它引用的 Paper20
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 次引用
- An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 次引用
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
- Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento 等ICML 2023 · 729 次引用
相关 Paper
- Transformers are Minimax Optimal Nonparametric In-Context LearnersJuno Kim, Tai Nakamaki, Taiji SuzukiNeurIPS 2024 · 42 次引用
- Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressionAllan Raventós, Mansheej Paul, Feng Chen, Surya GanguliNeurIPS 2023 · 174 次引用
- When can in-context learning generalize out of task distribution?Page C. Goddard, Lindsay M. Smith, Vudtiwat Ngampruetikorn, David J. SchwabICML 2025
- Transformers as Algorithms: Generalization and Stability in In-context LearningYingcong Li, Muhammed Emrullah Ildiz, Dimitris Papailiopoulos, Samet OymakICML 2023 · 242 次引用
- Technical Debt in In-Context Learning: Diminishing Efficiency in Long ContextTaejong Joo, Diego KlabjanNeurIPS 2025
