Research map / Large language models / Language, safety and interpretability
An Explanation of In-context Learning as Implicit Bayesian Inference
Sang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu Ma
Stanford University · Carnegie Mellon University · Meta
Read the paperPlace an idea next to itCheck your own paper ↗
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Increase the number of prompt examples | Transformers and LSTMs trained on GINC · GINC | in-context accuracy | Improved |
| Increase the length of each prompt example | Transformers and LSTMs trained on GINC · GINC | in-context accuracy | Improved |
| Increase Transformer depth from 12 to 16 layers | Transformer trained on GINC · GINC, vocab size 50 | in-context accuracy: 81% -> 85% | Improved |
| Increase Transformer depth from 12 to 16 layers | Transformer trained on GINC · GINC, vocab size 50 | validation loss: 1.33 -> 1.33 | No clear effect |
| Use an LSTM instead of a Transformer | Models trained on GINC · GINC | in-context accuracy | Improved |
| Remove the mixture of concepts by pretraining on only one concept (ablation) | 4-layer Transformer trained on GINC · GINC | in-context accuracy | Hurt |
| Replace mixture-of-concepts pretraining data with random-transition data (ablation) | 4-layer Transformer trained on GINC · GINC | in-context accuracy | Hurt |
| Use prompts from concepts absent from the pretraining family (ablation) | 4-layer Transformer trained on GINC · GINC prompts from unseen concepts | in-context accuracy | Hurt |
| Change the order of the same prompt examples | 4-layer Transformer trained on GINC · GINC, permutations of 4 examples | in-context accuracy: 10--40% difference | Mixed |
| Add a few prompt examples rather than use zero-shot prompting | 12-layer Transformer trained on GINC · GINC, temperature 0.01, 12 concepts, vocab size 100 | in-context accuracy | Mixed |
Open problems in in-context learning analysis
Which in-context learning methods hold up beyond English classification on small open models, and what do they cost?
- Only a few small or medium open models were tested. · 14 papers state it
- The method needs many extra LLM calls or passes. · 13 papers state it
- Evaluated on English data only, with other languages untested. · 12 papers state it
Closest papers by meaning
- Toward Understanding In-context vs. In-weight Learning (ICLR 2025 · similarity 0.91)
- Where does In-context Learning Happen in Large Language Models? (NeurIPS 2024 · similarity 0.91)
- Understanding In-Context Learning from Repetitions (ICLR 2024 · similarity 0.90)
- Implicit In-context Learning (ICLR 2025 · similarity 0.90)
- Supervised Knowledge Makes Large Language Models Better In-context Learners (ICLR 2024 · similarity 0.90)
- In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering (ICML 2024 · similarity 0.90)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.