Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning

Quanyu Long, Yin Wu, Wenya Wang, Sinno Jialin Pan · DOI

Abstract

In-Context Learning (ICL) allows Large Language Models (LLMs) to solve new tasks using only a few demonstrations. While effective, the source of these performance gains is debated. This study challenges the notion that ICL primarily improves a model's reasoning or "discriminative" ability. Instead, we propose a framework to decompose ICL's impact into three components: Label Space Power, Label Format Power, and Discrimination Power. Our findings reveal that for most tasks, ICL acts as an implicit instruction manual, primarily teaching the model the required output format and label set rather than enhancing its fundamental task-mapping capabilities.

Introduction

Large Language Models (LLMs) exhibit a remarkable ability to perform tasks without weight updates when provided with a few examples in the prompt, a phenomenon known as In-Context Learning (ICL). Previous theories suggested ICL helps models recall latent knowledge or learn specific task mappings. However, LLMs often struggle with inconsistent output formats (e.g., providing explanations instead of labels). This research investigates whether ICL's success is due to improved reasoning or simply a better understanding of the expected response structure.

Methodology: Decomposing the "Powers" of ICL

To isolate the drivers of ICL performance, we categorize model outputs into three distinct buckets:

  1. OOS (Out-of-Space): The model generates tokens outside the predefined label set.
  2. ISOOF (In-Space-Out-of-Format): The model uses correct labels but fails to follow the required structural format.
  3. ISIF (In-Space-In-Format): The model adheres to both the label set and the format requirements. Only these responses are typically considered valid in standard evaluations.
Conceptual framework showing how ICL shifts model outputs from OOS and ISOOF into the valid ISIF bucket.

By tracking how instances shift between these buckets upon applying ICL, we decompose the total performance gain into Label Space Power (restricting outputs to correct labels), Label Format Power (following structural requirements), and Discrimination Power (the actual ability to map an input to the correct label).

Empirical Analysis and Key Results

We evaluated four major LLMs—ChatGPT, GPT-3, Llama2, and Mistral—across classification, sequence labeling, and generation benchmarks.

ICL as an Implicit Instruction Manual

Our analysis shows that for the majority of tasks, providing demonstrations primarily boosts Label Space and Format power. In many cases, the impact on Discrimination power is marginal or even negative. This explains the "Noisy Label" mystery: even with incorrect labels, demonstrations successfully communicate the required label space and format, which are the primary drivers of success.

Decomposition of ICL performance gains across various datasets and models, highlighting the dominance of Label Space and Format powers.

The Role of Retrieval and Style

While random examples offer little reasoning boost, retrieving semantically similar examples significantly enhances Discrimination power. In generation tasks like summarization, ICL also induces style mimicry, which can impact performance if the demonstration style deviates from the ground truth. Furthermore, providing explicit "Detailed Instructions" (DI) regarding the label set and format can achieve performance gains comparable to ICL, suggesting that demonstrations often serve as a proxy for clear instructions.

Discussion and Future Work

The study highlights a "diversity trade-off" in retrieval: while similar examples help reasoning, a lack of label diversity among those examples can weaken the model's grasp of the overall label space. Future research will explore treating demonstrations as additional parameters influencing token probability distributions and developing retrieval methods that balance semantic similarity with label diversity to maximize the reasoning boost.

Conclusion

This work rethinks the mechanism of In-Context Learning, demonstrating that its primary value lies in communicating task constraints (labels and format) rather than improving discriminative reasoning. Recognizing ICL as a form of implicit instruction provides a clearer path for optimizing LLM prompting and retrieval strategies.

Summary updated

BibTeX
@inproceedings{long2024does,
  author = {Quanyu Long and Yin Wu and Wenya Wang and Sinno Jialin Pan},
  title = {{Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=i2oJjC0ESQ},
}
Figure