Skip to main content
QUICK REVIEW

[Paper Review] Pretraining Data Mixtures Enable Narrow Model Selection Capabilities in Transformer Models

Steve Yadlowsky, Lyric Doshi|arXiv (Cornell University)|Nov 1, 2023
Topic ModelingComputer Science8 citations
TL;DR

The paper studies how pretraining data mixtures affect in-context learning (ICL) in transformers, showing near-optimal model selection within pretrained function classes but limited out-of-distribution generalization.

ABSTRACT

Transformer models, notably large language models (LLMs), have the remarkable ability to perform in-context learning (ICL) -- to perform new tasks when prompted with unseen input-output examples without any explicit model training. In this work, we study how effectively transformers can bridge between their pretraining data mixture, comprised of multiple distinct task families, to identify and learn new tasks in-context which are both inside and outside the pretraining distribution. Building on previous work, we investigate this question in a controlled setting, where we study transformer models trained on sequences of $(x, f(x))$ pairs rather than natural language. Our empirical results show transformers demonstrate near-optimal unsupervised model selection capabilities, in their ability to first in-context identify different task families and in-context learn within them when the task families are well-represented in their pretraining data. However when presented with tasks or functions which are out-of-domain of their pretraining data, we demonstrate various failure modes of transformers and degradation of their generalization for even simple extrapolation tasks. Together our results highlight that the impressive ICL abilities of high-capacity sequence models may be more closely tied to the coverage of their pretraining data mixtures than inductive biases that create fundamental generalization capabilities.

Motivation & Objective

  • Investigate how pretraining data composition influences in-context learning across multiple function classes.
  • Evaluate whether transformers can identify and learn new tasks in-context when tasks are within or outside pretraining distributions.
  • Examine model selection capabilities and the cost of selecting among pretrained function classes during ICL.

Proposed method

  • Pretrain a decoder-like transformer (9.5M params, 12 layers, 8 heads, 256-d embeddings) on sequences of (x, f(x)) paired data.
  • Use a teacher-forcing loss on sequences drawn from mixtures of function classes (dense linear, sparse linear, ReLU nets, sine).
  • Construct pretraining mixtures D(F) = w·D(F_A) + (1−w)·D(F_B) by sampling function classes from the mixture.
  • Evaluate ICL by providing in-context examples and predicting f(x_{n+1}) via next-token prediction.
  • Measure predictive squared loss E[(f̃(x_{n+1}) − f(x_{n+1}))^2] as the ICL performance metric.
  • Compare behavior across pure and mixed pretraining regimes and across in-distribution and out-of-distribution test functions.

Experimental results

Research questions

  • RQ1Can transformers pretrained on mixtures of function classes perform model selection among those classes during in-context learning?
  • RQ2How does in-context learning performance change when test tasks are outside the pretraining distribution (out-of-distribution)?
  • RQ3What are the limits of ICL when combining function classes (e.g., convex combinations) or when rare regions of function space are encountered?
  • RQ4Does increasing model size or changing function-class mixtures alter the model selection and generalization properties?

Key findings

  • Models pretrained on mixtures achieve near-optimal ICL performance within pretraining function classes, comparable to single-class baselines.
  • ICL learning curves for mixture-pretrained models closely track optimal sample complexity and show small deviations that decay with more in-context examples.
  • When test functions are out-of-distribution from pretraining, ICL generalization deteriorates and predictions become erratic or fail to match any pretrained class.
  • Models can interpolate between pretrained function classes in some sparsity regimes, but convex combinations of linear and sinusoidal functions are not generally well-predicted by mixture-pretrained models.
  • Performance degrades as test functions move far from the pretraining support, indicating limited broad generalization beyond seen data.
  • Model size influences model selection capabilities, with larger models showing more robust ICL behavior, while effects are asymmetric across function classes.

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.