Preprint
Large Language Models

In-Context Learning Generalization Limits

Steve Yadlowsky, Lyric Doshi, Nilesh Tripuraneni
November 1, 2023arXiv.org61 citations

61

Citations

0

Influential Citations

arXiv.org

Venue

2023

Year

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.

Analysis

Why This Paper Matters

In-context learning (ICL) is a cornerstone of modern large language models, enabling them to perform new tasks from just a few examples without parameter updates. This paper by Yadlowsky, Doshi, and Tripuraneni critically examines the limits of ICL by asking a fundamental question: do transformers possess an inherent ability to generalize to novel tasks, or is their success merely a reflection of what they have seen during pretraining? The answer has profound implications for how we design, evaluate, and trust LLMs.

The authors argue that the impressive ICL capabilities of high-capacity sequence models may be more closely tied to the coverage of their pretraining data mixtures than to inductive biases that create fundamental generalization capabilities. This challenges the prevailing narrative that transformers are universal learners. By demonstrating that models fail to extrapolate even on simple out-of-domain tasks, the paper suggests that ICL is largely a sophisticated form of pattern matching within the pretraining distribution.

For practitioners, this work underscores the importance of pretraining data curation and the risks of deploying LLMs in domains not well-represented during training. It also provides a controlled experimental framework to study ICL, which can guide future research on improving generalization.

Technical Contributions

  • Controlled experimental setup: The authors train transformers on sequences of (x, f(x)) pairs from multiple task families, isolating ICL from the complexities of natural language.
  • Near-optimal unsupervised model selection: They show that transformers can in-context identify different task families and learn within them when those families are well-represented in pretraining data.
  • Identification of failure modes: The paper systematically demonstrates various failure modes and degradation of generalization when tasks are out-of-domain, even for simple extrapolation tasks.
  • Link between ICL and pretraining coverage: The results suggest that ICL performance is bounded by the coverage of the pretraining data mixture, rather than by inherent inductive biases.

Results

The empirical results reveal a stark contrast between in-domain and out-of-domain performance. When task families are well-represented in the pretraining data, transformers exhibit near-optimal unsupervised model selection capabilities, effectively identifying and learning the task in-context. However, when presented with tasks or functions outside the pretraining distribution, the models fail to generalize, showing various failure modes and degradation even on simple extrapolation tasks. These findings 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 to fundamental generalization capabilities.

Significance

This paper has significant implications for the AI field. It challenges the assumption that transformers possess inherent generalization capabilities and suggests that ICL is largely a function of pretraining data coverage. This motivates a shift towards more careful pretraining data design and evaluation protocols that explicitly test out-of-distribution generalization. Furthermore, it provides a controlled benchmark for studying ICL, which can be used to develop methods that improve generalization beyond the pretraining distribution. Ultimately, the work cautions against overestimating the robustness of LLMs and highlights the need for continued research on inductive biases that enable true generalization.