Skip to main content
QUICK REVIEW

[Paper Review] Pretraining task diversity and the emergence of non-Bayesian in-context learning for regression

Allan Raventós, Mansheej Paul|arXiv (Cornell University)|Jun 26, 2023
Domain Adaptation and Few-Shot LearningComputer Science11 citations
TL;DR

The paper shows a task-diversity threshold in pretraining that triggers non-Bayesian in-context learning for linear regression, with transformers moving from dMMSE-like behavior to Ridge-like behavior as diversity increases.

ABSTRACT

Pretrained transformers exhibit the remarkable ability of in-context learning (ICL): they can learn tasks from just a few examples provided in the prompt without updating any weights. This raises a foundational question: can ICL solve fundamentally $ extit{new}$ tasks that are very different from those seen during pretraining? To probe this question, we examine ICL's performance on linear regression while varying the diversity of tasks in the pretraining dataset. We empirically demonstrate a $ extit{task diversity threshold}$ for the emergence of ICL. Below this threshold, the pretrained transformer cannot solve unseen regression tasks, instead behaving like a Bayesian estimator with the $ extit{non-diverse pretraining task distribution}$ as the prior. Beyond this threshold, the transformer significantly outperforms this estimator; its behavior aligns with that of ridge regression, corresponding to a Gaussian prior over $ extit{all tasks}$, including those not seen during pretraining. Thus, when pretrained on data with task diversity greater than the threshold, transformers $ extit{can}$ optimally solve fundamentally new tasks in-context. Importantly, this capability hinges on it deviating from the Bayes optimal estimator with the pretraining distribution as the prior. This study also explores the effect of regularization, model capacity and task structure and underscores, in a concrete example, the critical role of task diversity, alongside data and model scale, in the emergence of ICL. Code is available at https://github.com/mansheej/icl-task-diversity.

Motivation & Objective

  • Investigate whether in-context learning (ICL) can solve fundamentally new regression tasks unseen during pretraining.
  • Examine how pretraining task diversity influences the emergence of ICL and its algorithmic nature.
  • Compare transformer ICL behavior to Bayesian estimators (dMMSE) and ridge regression under varying task diversity.

Proposed method

  • Study ICL for linear regression with latent regression vectors drawn from a finite pretraining task distribution and a Gaussian true task distribution.
  • Define optimal estimators for both task distributions: discrete MMSE (dMMSE) for pretraining tasks and ridge regression for true tasks.
  • Vary pretraining task diversity (M) and measure alignment with dMMSE and Ridge via mean squared error across in-context predictions.
  • Analyze learning dynamics, task dimension effects, regularization, and model capacity on the emergence of ICL.
  • Use transformer models (GPT2-like) trained with next-token MSE objective on sequences of (x, y) pairs with noise.

Experimental results

Research questions

  • RQ1Does increasing pretraining task diversity enable a transformer to learn new tasks in-context?
  • RQ2How does the transformer’s in-context learning behavior transition relative to Bayesian estimators and ridge regression as task diversity changes?
  • RQ3What is the role of task dimension, regularization, and model capacity in the emergence of ICL for regression?

Key findings

  • A task diversity threshold exists beyond which the transformer shifts from Bayes-optimal (dMMSE) behavior to near-Ridge performance on new tasks.
  • Beyond the threshold, the transformer can learn fundamentally new tasks in-context and outperforms the pretraining Bayes estimator on unseen tasks.
  • Increasing task dimension raises the diversity threshold approximately linearly, while the PT’s error scaling with dimension remains near-Ridge, outperforming dMMSE as D grows.
  • Weight decay lowers the diversity threshold, while increasing embedding size or depth raises it, indicating regularization and capacity influence ICL emergence.
  • With more sequences per task, the transition sharpens, suggesting an algorithmic phase transition in learning dynamics across task diversity levels.

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.