Research map / Probabilistic and scientific modeling / Uncertainty and Gaussian processes
In-Context Learning Strategies Emerge Rationally
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 hierarchical Bayesian model that explains in-context learning in Transformers as a posterior-weighted mixture of memorizing and generalizing predictors, with pretraining shifting posterior weights via a loss-complexity tradeoff.
Problem
Why do Transformers trained on mixtures of tasks learn different in-context strategies (memorizing vs. generalizing) and why does the preferred strategy transition with training time and task diversity (transient generalization, task-diversity thresholds)?
Approach
Frames ICL strategies as two Bayesian predictors (memorizing with discrete prior over seen tasks, generalizing with continuous prior over true distribution), and models pretraining as Bayesian posterior updating over them using power-law loss scaling and a Kolmogorov-complexity simplicity prior, yielding a closed-form loss-complexity tradeoff with only three fitted parameters.
Key results
- Hierarchical Bayesian model fit with only three free parameters across 11 training runs; mean R^2 of 0.97 in linear regression, mean agreement 0.92 in classification, mean Spearman 0.97 in balls and urns across 72 maps.
- Posterior probability of the memorizing predictor correlates with Transformer relative distance at 0.99, 0.98, 0.99 for linear regression, classification, and balls and urns.
- Predicts superlinear growth of time to transience N* with task diversity D, and sigmoidal growth of memorization in N^(1-alpha) space.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Increase task diversity | Transformers trained on task mixtures · Balls & Urns, Linear Regression, and Classification | relative distance to the generalizing predictor | Helped |
| Train for more steps at middle task diversity | Transformers trained on task mixtures · Balls & Urns, Linear Regression, and Classification | relative distance to the memorizing predictor | Helped |
| Increase MLP width | Transformer · Balls & Urns | relative distance to the memorizing predictor | Helped |
| Use learning-rate annealing | Transformer · Balls & Urns; time to transience | adherence to Bayes-optimal trajectory | Helped |
| Use learning-rate annealing | Transformer · Balls & Urns; later transience points | rate of progress toward memorization | Hurt |
| Model transience time as a function of task diversity | Hierarchical Bayesian model · Balls & Urns | time to transience | Helped |
| Remove the assumed computational constraints from the functional form (ablation) | Hierarchical Bayesian model · Transformer next-token predictions | prediction accuracy | Hurt |
Surprising findings
- Generalizing predictor can be Bayes-optimal under a simplicity prior even when it has worse training loss than the memorizing predictor.
- Memorization continues to increase slowly even at high task diversity rather than staying fixed at the generalizing solution, contrary to prior claims.
Limitations
- Only two predictors considered; settings where more predictors matter (e.g., Markov chain mixtures) not covered.
- Analysis restricted to in-distribution sequences; OOD extension is future work.
- Complexity is estimated via lossless compression and assumes a simple relation between algorithmic complexity and Transformer implementation cost.
Experimental setup
Datasets: synthetic balls and urns sequences synthetic linear regression sequences synthetic binary classification sequences
Benchmarks: synthetic balls and urns synthetic linear regression synthetic binary classification
Metrics: symmetrized KL divergence Euclidean distance R^2 Spearman rank correlation agreement relative distance
Baselines: Linear Interpolation of Algorithms (LIA) dMMSE ridge regression estimator
Builds on: rational analysis power-law scaling of loss Kolmogorov complexity coding theorem linear interpolation of algorithms
Closest papers by meaning
- Investigating the Pre-Training Dynamics of In-Context Learning: Task Recognition vs. Task Learning (ICLR 2025 · similarity 0.92)
- In-Context Learning through the Bayesian Prism (ICLR 2024 · similarity 0.91)
- Differential learning kinetics govern the transition from memorization to generalization during in-context learning (ICLR 2025 · similarity 0.90)
- Technical Debt in In-Context Learning: Diminishing Efficiency in Long Context (NeurIPS 2025 · similarity 0.90)
- Dual Operating Modes of In-Context Learning (ICML 2024 · similarity 0.90)
- Strategy Coopetition Explains the Emergence and Transience of In-Context Learning (ICML 2025 · 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.
