Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
Sewon MinXinxi LyuAri HoltzmanMikel ArtetxeMike LewisHannaneh HajishirziLuke Zettlemoyer
Reveals that large language models do not rely on correct demonstration labels for in-context learning, showing that performance is primarily driven by prompt format, input distribution, and label space rather than input-label mappings.
Large language models have shown remarkable capabilities in performing new downstream tasks purely through in-context learning—conditioning on a few prompt demonstrations without fine-tuning model parameters. Conventionally, practitioners assumed that this mechanism relies on the model learning the true relationship between inputs and correct outputs from the provided examples. However, data annotation is costly and prone to errors, making it critical to understand what elements of these prompt demonstrations genuinely drive task performance and whether accurate labels are required.
The article evaluates which components of demonstrations contribute to in-context learning success and directly tests whether large language models require ground-truth input-label mappings to perform tasks effectively.
To investigate this, the researchers conducted systematic empirical evaluations across 12 dense language model configurations, ranging in size from 774 million to 175 billion parameters, including GPT-2, GPT-J, fairseq models, MetaICL, and GPT-3. The study evaluated performance across 26 low-resource datasets spanning sentiment analysis, paraphrase detection, natural language inference, hate speech detection, question answering, and sentence completion. By systematically altering demonstration inputs, label validity, label vocabularies, and overall format structures, the authors isolated the individual impact of four core aspects: the input-label mapping, the input text distribution, the label space, and the sequence format.
The findings reveal that ground-truth labels matter surprisingly little: replacing true demonstration labels with random labels caused only a marginal drop in performance, typically between 0% and 5% absolute across evaluated models (averaging a 1.7% drop in multi-choice tasks and 2.6% in classification). In fact, prompts with 100% incorrect labels still achieved the vast majority of performance gains over standard zero-shot baselines. Instead of input-label pairings, task performance is primarily driven by three structural factors: providing examples of the expected input distribution, exposing the valid label space, and maintaining the sequence format of input-label pairs. In models meta-trained specifically for in-context learning, this effect is amplified, as the models rely almost entirely on formatting and label-space cues rather than the underlying input-label correspondences.
These insights demonstrate that language models do not learn entirely new task mappings at inference time; rather, demonstrations serve to activate and locate capabilities, task structures, and concepts already acquired during pre-training. For organizations deploying language models, these findings offer substantial operational value by reducing data labeling costs, mitigating risks tied to noisy annotations, and establishing that strong zero-shot or few-shot performance can often be achieved using unlabeled text paired with randomized labels.
Organizations should focus prompt-engineering investments on presenting realistic input distributions, specifying well-defined candidate label spaces, and maintaining consistent prompt formatting rather than investing heavily in exhaustive data labeling for in-context tasks. Researchers and practitioners should validate whether custom downstream tasks rely on concepts existing in the pre-trained model; when entirely new task semantics are required, direct model fine-tuning remains necessary.
Confidence in these conclusions is high for standard classification and multiple-choice NLP benchmarks across diverse model families and scales. However, caution is warranted when extrapolating to open-ended text generation, multi-step mathematical reasoning, or highly synthetic tasks where precise reasoning chains or unique mappings may play a larger role. Further evaluation is recommended before extending these conclusions beyond discriminative tasks.
- Paper: Language Models are Few-Shot Learners, T. B. Brown et al. (2020). Reading GPT-3's introduction provides the exact few-shot in-context learning baseline and model capabilities that the source paper investigates and challenges.
- Paper: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, Jason Wei et al. (2022). Understanding chain-of-thought prompting offers crucial background on how demonstrations guide large language models through reasoning steps.
- Paper: Finetuned Language Models Are Zero-Shot Learners, Jason Wei et al. (2022). This paper builds on the source's findings about prompt formatting by demonstrating how instruction tuning enables zero-shot generalization across unseen tasks.
- Paper: Learning by Distilling Context, Charlie Snell et al. (2022). This work directly extends the source by showing how demonstration context can be permanently distilled into model parameters rather than supplied at inference time.
- Paper: Making Text Embedders Few-Shot Learners, Chaofan Li et al. (2025). This work applies the source's insights on in-context learning to text embeddings, showing how few-shot examples improve representation quality.
