Skip to main content
QUICK REVIEW

[Paper Review] A Theory of Emergent In-Context Learning as Implicit Structure Induction

Michael G. Hahn, Navin Goyal|arXiv (Cornell University)|Mar 14, 2023
Topic ModelingComputer Science5 citations
TL;DR

This paper proposes that in-context learning (ICL) in large language models emerges from implicit structure induction through compositional operations in pretraining data. By formalizing language as a compositional grammar and deriving information-theoretic bounds, the authors show that next-token prediction alone enables ICL when data contains sufficient structural diversity, validated via a controlled setup where ICL emerges with scale and improves with chain-of-thought prompting.

ABSTRACT

Scaling large language models (LLMs) leads to an emergent capacity to learn in-context from example demonstrations. Despite progress, theoretical understanding of this phenomenon remains limited. We argue that in-context learning relies on recombination of compositional operations found in natural language data. We derive an information-theoretic bound showing how in-context learning abilities arise from generic next-token prediction when the pretraining distribution has sufficient amounts of compositional structure, under linguistically motivated assumptions. A second bound provides a theoretical justification for the empirical success of prompting LLMs to output intermediate steps towards an answer. To validate theoretical predictions, we introduce a controlled setup for inducing in-context learning; unlike previous approaches, it accounts for the compositional nature of language. Trained transformers can perform in-context learning for a range of tasks, in a manner consistent with the theoretical results. Mirroring real-world LLMs in a miniature setup, in-context learning emerges when scaling parameters and data, and models perform better when prompted to output intermediate steps. Probing shows that in-context learning is supported by a representation of the input's compositional structure. Taken together, these results provide a step towards theoretical understanding of emergent behavior in large language models.

Motivation & Objective

  • To develop a theoretical foundation for emergent in-context learning (ICL) in large language models.
  • To explain why ICL arises from generic next-token prediction without specialized fine-tuning.
  • To formalize the role of compositional structure in enabling broad ICL capabilities.
  • To validate the theory through a controlled, linguistically motivated experimental setup that mirrors real-world LLM behavior.
  • To explain the empirical success of chain-of-thought prompting using theoretical bounds.

Proposed method

  • Theoretical analysis derives an information-theoretic bound showing that ICL emerges when pretraining data contains sufficient compositional structure, under linguistically motivated assumptions.
  • A novel controlled dataset is constructed using first-order logic and HMMs to model compositional data generation with varying amounts of structural diversity.
  • Tasks are defined in a logical world model, and LMs are trained on compositional text with controlled variation in object sets $|Ω|$ and functions $|ℜ|$.
  • Theoretical bounds are derived to explain why prompting for intermediate steps (chain-of-thought) improves ICL performance.
  • Probing experiments examine whether representations encode compositional structure, supporting the theory.
  • Ablation studies isolate components like loops, quantifiers, and conditionals to test their necessity for ICL.

Experimental results

Research questions

  • RQ1Under what conditions does in-context learning emerge from generic next-token prediction in large language models?
  • RQ2How does compositional structure in pretraining data enable broad in-context learning across diverse tasks?
  • RQ3Why does chain-of-thought prompting improve in-context learning performance?
  • RQ4To what extent do model parameters and data scale drive the emergence of ICL?
  • RQ5What role does the representation of compositional structure play in enabling ICL?

Key findings

  • In-context learning emerges abruptly with model and data scale in the controlled setup, mirroring real-world LLMs, despite training on only next-token prediction.
  • ICL performance improves significantly when models are prompted to generate intermediate steps, consistent with the theoretical benefit derived in Theorem 2.
  • Theoretical bounds predict that ICL success depends on the complexity $\operatorname{D}[\tau_{\phi}]$ of a task’s compositional description, which is validated empirically.
  • Ablation studies show that variable-introducing constructs (e.g., loops, 'for some') are essential for ICL, while conditionals are less critical.
  • Probing reveals that representations encode the compositional structure of inputs, supporting the theory of implicit structure induction.
  • ICL is robust to unnatural prompt formats, indicating that the mechanism relies on structural generalization, not surface form.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.