Next-token pretraining implies in-context learning

Paul M. Riechers, Henry R. Bigelow, Eric A. Alt, Adam Shai
5/23/2025
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

We argue that in-context learning (ICL) predictably arises from standard self-supervised next-token pretraining, rather than being an exotic emergent property. This work establishes the foundational principles of this emergence by focusing on in-distribution ICL, demonstrating how models necessarily adapt to context when trained on token sequences, especially from non-ergodic sources. Our information-theoretic framework precisely predicts these in-distribution ICL dynamics (i.e., context-dependent loss reduction). We verify this with experiments using synthetic datasets of differing types of correlational structure, reproducing characteristic phenomena like phase transitions in training loss for induction head formation and power-law scaling of in-context loss. We further show that a model's in-context performance on any task is mathematically coupled to the ensemble of tasks seen in pretraining, offering a fundamental explanation, grounded in architecture- and modality-independent principles, for such inference-time learning.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{riechers2025nexttoken,
  title  = {Next-token pretraining implies in-context learning},
  author = {Paul M. Riechers and Henry R. Bigelow and Eric A. Alt and Adam Shai},
  year   = {2025},
  eprint = {2505.18373},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.18373v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.18373.svg)](https://codeofpaper.com/paper/2505.18373)

Discussion