Attention Is All You Need
Ashish Vaswani, Noam Shazeer et al.
0
Citations
0
Influential Citations
—
Venue
2111
Year
… what enables in-context learning. In this paper, we study how in-context learning can emerge … At test time, in-context learning occurs when the LM also infers a shared latent concept …
In-context learning (ICL) is one of the most striking capabilities of large language models (LLMs), enabling them to perform new tasks from just a few examples without gradient updates. Despite its practical importance, a rigorous theoretical understanding of why ICL works has been lacking. This paper addresses that gap by proposing that ICL can be understood as a form of implicit Bayesian inference. By framing the problem as the model inferring a shared latent concept from the provided context, the authors offer a principled explanation that connects ICL to well-studied Bayesian reasoning frameworks.
The significance of this work lies in its potential to demystify a key emergent behavior of LLMs. If ICL is indeed Bayesian inference, then many properties of Bayesian models—such as uncertainty quantification, prior sensitivity, and the ability to incorporate new evidence—may apply to LLMs as well. This could lead to more predictable and controllable few-shot behavior, and inform strategies for prompt engineering and model selection.
The paper's main innovation is a formal model where in-context learning is treated as posterior inference over a latent variable that represents the task or concept. Key technical points include:
The paper is primarily theoretical and does not present experimental results or quantitative metrics. Instead, it provides a conceptual framework that aligns with known empirical phenomena: the ability of LLMs to adapt to new tasks from few examples, the sensitivity to the order and content of examples, and the occasional failure modes when the context is misleading. The analysis suggests that ICL should exhibit properties like Bayesian consistency and sensitivity to prior information, which could be tested in future work.
This work has the potential to reshape how researchers and practitioners think about in-context learning. By grounding ICL in Bayesian inference, it opens the door to applying Bayesian techniques—such as posterior calibration, prior elicitation, and model comparison—to LLMs. For AI practitioners, understanding ICL as Bayesian inference could lead to more principled prompt design, better handling of ambiguous or conflicting examples, and improved few-shot performance. The paper also provides a foundation for future research into the limits and failure modes of ICL, such as when the model's implicit prior is mismatched with the actual task distribution.
Ashish Vaswani, Noam Shazeer et al.
Jakubův, Jan, Chvalovský, Karel et al.
Pauli Virtanen, Ralf Gommers et al.
Tom B. Brown, Benjamin Mann et al.