Research map / Large language models / Language, safety and interpretability
Dual Operating Modes of In-Context Learning
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes a Gaussian-mixture pretraining-data model for linear-regression ICL that yields closed-form Bayes-optimal predictions, explaining task retrieval vs. task learning, the early-ascent phenomenon, and bounded efficacy of biased-label/zero-shot ICL.
Problem
Existing theoretical models of in-context learning cannot fully explain its dual operating modes (task retrieval vs. task learning), the early-ascent risk curve, or the bounded efficacy of biased-label ICL.
Approach
Model pretraining tasks as a Gaussian mixture over linear-regression parameters (with task-dependent input distributions), so the Bayes-optimal next-token predictor has a closed-form Gaussian-mixture posterior; ICL then decomposes into component re-weighting (retrieval) and component shifting (learning).
Key results
- Transformer trained on the Gaussian mixture prior approximates Bayes-optimal prediction across noise levels, component counts and dimensions.
- GPT-4 error on biased addition rises from 33.9% at k=2 to 85.1% (correct-for-biased) at k=16 ... error for biased task drops to 16.8% at k=16 while addition error rises from 33.9% to 85.1%, showing bounded efficacy.
- Predicts and observes bounded efficacy of random-label ICL in larger-context LLMs (Mistral 7B, Mixtral 8x7B, Llama 2, GPT-4) when k exceeds 32.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Increase biased-label examples from k=0 to k=2 | GPT-4 biased-label ICL evaluated on biased + · GPT-4 biased-label ICL | error rate: 75.0% -> 33.9% | Helped |
| Increase biased-label examples from k=2 to k=16 | GPT-4 biased-label ICL evaluated on biased + · GPT-4 biased-label ICL | error rate: 33.9% -> 85.1% | Hurt |
| Increase biased-label examples from k=0 to k=16 | GPT-4 biased-label ICL evaluated on addition (+) · GPT-4 biased-label ICL | error rate: 100.0% -> 16.8% | Helped |
| Add one in-context example | GPT-3 on LAMBADA · LAMBADA | accuracy: 76.2% -> 72.5% | Hurt |
| Increase from one-shot to few-shot prompting | GPT-3 on LAMBADA · LAMBADA | accuracy: 72.5% -> 86.4% | Helped |
| Use more in-context examples when retrieving a misleading prior task before learning the target task | ICL under the early-ascent setting · Early ascent setting | ICL risk | Mixed |
| Increase the number of random-label examples | LLM ICL with random labels · Biased-label ICL | error rate | Hurt |
Surprising findings
- Early ascent: ICL risk first increases then decreases with more in-context examples when the in-context task is misleadingly close to a wrong prior component.
- Zero-shot ICL with random labels shows bounded efficacy: performance degrades at larger numbers of in-context examples, contrary to prior claims that random labels do not matter for k up to 32.
Limitations
- Analysis assumes pretraining tasks are noisy linear regression, not the non-linear, categorical tasks of real LLMs.
- In-context labels are assumed noiseless.
- Assumes an optimally trained next-token predictor on infinite pretraining data, without considering architecture or training statistics.
Experimental setup
Datasets: synthetic linear regression pretraining data from the Gaussian mixture model
Benchmarks: synthetic linear regression ICL biased addition task (GPT-4) random-label ICL in LLMs
Metrics: ICL risk (squared loss) error rate
Baselines: ridge regression Bayes-optimal predictor
Builds on: Garg et al. in-context learning of linear functions Xie et al. implicit Bayesian inference in ICL Min et al. rethinking role of demonstrations
Closest papers by meaning
- In-Context Learning Learns Label Relationships but Is Not Conventional Learning (ICLR 2024 · similarity 0.92)
- In-Context Learning through the Bayesian Prism (ICLR 2024 · similarity 0.91)
- Dual Process Learning: Controlling Use of In-Context vs. In-Weights Strategies with Weight Forgetting (ICLR 2025 · similarity 0.91)
- Position: Do pretrained Transformers Learn In-Context by Gradient Descent? (ICML 2024 · similarity 0.91)
- Can In-context Learning Really Generalize to Out-of-distribution Tasks? (ICLR 2025 · similarity 0.91)
- Investigating the Pre-Training Dynamics of In-Context Learning: Task Recognition vs. Task Learning (ICLR 2025 · similarity 0.91)
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.
