In-Context Learning Before Specialisation: Theory of Learning in a Solvable Topic Model
Francesco Cagnetta, Casper L. Christensen
Key points
From the paper's conclusion- Here we provide such a theory in a solvable topic model---documents drawn from a finite mixture of latent topics, mirroring the heterogeneity of modern pretraining data.
Abstract
Sequence models can generalise in fundamentally distinct ways: extrapolating structures seen in training, or using their prompt to adapt to novel tasks. The prevailing strategy determines how the model behaves beyond its training distribution, controlling potential capabilities and risks. Recent work has characterised many different strategies theoretically, and empirically described the transition between them as the quality and quantity of pretraining data vary. However, there is no learning theory for this competition, hence no fundamental understanding of \textit{why} one solution might be favoured over another. Here we provide such a theory in a solvable topic model---documents drawn from a finite mixture of latent topics, mirroring the heterogeneity of modern pretraining data. The dataset comes with two distinct solutions: a specialised predictor, that stores the finite topic mixture, and an in-context one, optimal for topics never seen during training. Our theory predicts their emergence at distinct sample complexities: the in-context predictor is available early, while the specialised one emerges only after the training tokens outnumber the parameters of the data-generating process. Trained transformers reproduce both scales and the separating crossover in remarkable agreement with the theory, with no fitted parameters.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Distinct mechanisms underlying in-context learning in transformersPhysical Review X · 2026
- Characterizing In-Context Learning: When Can Transformers Match Standard Learning Algorithms?2026
- Specialists Learn Faster: Knowledge Organization in Pre-training Shapes Knowledge Update EfficiencyarXiv · 2026
- In-context Learning of Single-index Targets: Comparing Kernel and Feature LearnersarXiv · 2026
- Understanding Generalization Requires Universal InductionarXiv · 2026
- Understanding the Role of Reasoning Data in PretrainingarXiv · 2026