NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?

Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, Luke Zettlemoyer

Introduction

In-Context Learning (ICL) has become the standard method for deploying Large Language Models (LLMs) like GPT-3. By providing a few examples—demonstrations consisting of input-label pairs—the model can perform a task on new inputs without any weight updates. The prevailing assumption was that the model "learns" the relationship between the input and the label from these examples. This paper challenges that assumption, investigating which aspects of demonstrations actually drive performance.

A typical in-context learning prompt featuring demonstrations and a test input for sentiment analysis.

Methodology

The researchers conducted an extensive empirical study across 12 LLMs (ranging from 774M to 175B parameters) and 26 datasets. Their core approach involved systematically "breaking" different parts of the demonstration to observe the impact on performance. Key variants included replacing gold labels with random ones, using out-of-distribution (OOD) inputs, and altering the label space or format.

Key Results: The Ground Truth is Optional

The most striking finding is that replacing gold labels with random labels results in only a marginal performance drop (usually 0–5% absolute). Across nearly all models and tasks, using random labels preserved the vast majority of the performance gain over zero-shot (no demonstrations).

Comparison of accuracy and F1 scores across models, demonstrating that random labels perform nearly as well as gold labels.

What Actually Drives Performance?

If the "truth" of the mapping isn't critical, what is? The authors identify four key signals in demonstrations:

  1. The Input Distribution: Seeing the "style" of the questions is crucial. Replacing task inputs with OOD text caused significant performance drops (3–16%).
  2. The Label Space: Knowing the set of possible answers (e.g., "Positive/Negative") is essential. Using random English words instead of the actual label space caused a 5–16% drop.
  3. The Format: The structure of the prompt (e.g., Input: [text] \n Label: [text]) acts as a trigger. Removing the input-label pairing entirely often performed worse than zero-shot.
  4. The Input-Label Mapping: While helpful, this is the least critical component for many classification tasks.

Discussion: Anchoring, Not Learning

These results suggest that LLMs are not "learning" new tasks from prompts in the traditional sense. Instead, the prompt helps the model recover a latent concept it already acquired during pre-training. The demonstrations act as a signal to "look up" the correct task in the model's internal library. This "anchoring" mechanism explains why models specifically trained for ICL (like MetaICL) are even more indifferent to label correctness; they have become specialized at exploiting the prompt's format rather than its content.

Conclusion

This work shifts the focus from label correctness to the structural and distributional properties of prompts. It opens the door for "label-free" in-context learning, where high performance might be achieved using only unlabeled data, potentially making LLMs significantly easier to deploy in specialized or low-resource domains.

Summary updated

BibTeX
@inproceedings{min2022rethinking,
  author = {Sewon Min and Xinxi Lyu and Ari Holtzman and Mikel Artetxe and Mike Lewis and Hannaneh Hajishirzi and Luke Zettlemoyer},
  title = {{Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.759},
}
Figure