Skip to main content
QUICK REVIEW

[Paper Review] The Learnability of In-Context Learning

Noam Wies, Yoav Levine|arXiv (Cornell University)|Mar 14, 2023
Topic ModelingComputer Science8 citations
TL;DR

The paper introduces a PAC-based framework for in-context learning with frozen pretrained models and proves finite-sample learnability guarantees under mild assumptions for mixture-task pretraining distributions.

ABSTRACT

In-context learning is a surprising and important phenomenon that emerged when modern language models were scaled to billions of learned parameters. Without modifying a large language model's weights, it can be tuned to perform various downstream natural language tasks simply by including concatenated training examples of these tasks in its input. Though disruptive for many practical applications of large language models, this emergent learning paradigm is not well understood from a theoretical perspective. In this paper, we propose a first-of-its-kind PAC based framework for in-context learnability, and use it to provide the first finite sample complexity results for the in-context learning setup. Our framework includes an initial pretraining phase, which fits a function to the pretraining distribution, and then a second in-context learning phase, which keeps this function constant and concatenates training examples of the downstream task in its input. We use our framework in order to prove that, under mild assumptions, when the pretraining distribution is a mixture of latent tasks (a model often considered for natural language pretraining), these tasks can be efficiently learned via in-context learning, even though the model's weights are unchanged and the input significantly diverges from the pretraining distribution. Our theoretical analysis reveals that in this setting, in-context learning is more about identifying the task than about learning it, a result which is in line with a series of recent empirical findings. We hope that the in-context learnability framework presented in this paper will facilitate future progress towards a deeper understanding of this important new learning paradigm.

Motivation & Objective

  • Define a PAC learning framework for in-context learning with frozen models.
  • Provide finite-sample complexity results for in-context learning in a multi-task pretraining setting.
  • Show that in-context learning can identify latent tasks rather than learn them from prompts.
  • Connect theoretical results with empirical observations that in-context learning hinges on task identification.

Proposed method

  • Model the pretraining distribution as a mixture of latent tasks with a latent variable representing the task.
  • Define in-context learning as predicting labels using a prompt that concatenates input-label pairs.
  • Establish assumptions on the pretraining mixture (approximate independence, token lower bound, positive priors).
  • Prove that the ratio of prompt likelihoods for the correct task versus others concentrates and favors the correct component as k grows.
  • Derive finite-sample bounds showing efficient in-context learnability under margins and KL-divergence conditions.
  • Provide two-case analysis (large-margin and small-margin scenarios) to bound prediction errors.

Experimental results

Research questions

  • RQ1Can frozen pretrained models achieve low in-context loss on downstream tasks when prompted with concatenated examples drawn from a latent mixture of tasks?
  • RQ2Under what conditions and sample complexities does in-context learning identify latent tasks and achieve Bayes-optimal predictions without weight updates?
  • RQ3How does the pretraining distribution’s mixture structure affect the effectiveness and learnability of in-context learning?
  • RQ4What role do margins and KL-divergences between mixture components play in guaranteeing finite-sample learnability?

Key findings

  • Finite-sample (polynomial) learnability guarantees for in-context learning under mild assumptions.
  • The in-context prompt tends to reweight the prior over mixture components, aiding latent task identification.
  • With sufficient in-context examples, the ground-truth in-context predictor matches the Bayes optimal predictor in scenarios with large margins.
  • Even when margins are small, the loss remains bounded by the Bayes error, ensuring robustness of predictions.
  • A two-part analysis shows how pretraining imperfections and task recognition errors can be controlled to achieve overall learnability.
  • The framework generalizes beyond infinite data and aligns with empirical observations that task identification, not task learning, is central to in-context learning.

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.