Preprint
Large Language Models

A survey on in-context learning

January 1, 2024

0

Citations

0

Influential Citations

Venue

2024

Year

Abstract

… Figure 1: Illustration of in-context learning. ICL requires a prompt context containing a few … Second, in-context learning is similar to the decision process of human beings by learning …

Analysis

Why This Paper Matters

In-context learning (ICL) has emerged as a defining capability of large language models (LLMs), enabling them to perform new tasks from just a few examples without parameter updates. This survey arrives at a critical juncture, as the field is flooded with disparate findings on how and why ICL works. By systematically organizing the literature, the paper provides a much-needed roadmap for researchers and practitioners alike. Understanding ICL is essential for deploying LLMs in real-world applications where task flexibility and minimal fine-tuning are paramount.

The paper's significance lies in its comprehensive scope, covering not only empirical successes but also theoretical underpinnings and limitations. It highlights that ICL is not a monolithic phenomenon but is influenced by model architecture, training data, prompt design, and task characteristics. This nuanced view helps demystify ICL and sets the stage for more principled approaches to prompt engineering and model development.

Technical Contributions

The survey makes several key technical contributions:

  • Unified Framework: Proposes a taxonomy for ICL methods, categorizing them by prompt structure (e.g., demonstration format, ordering) and learning mechanism (e.g., meta-learning, induction heads).
  • Empirical Synthesis: Aggregates results from numerous studies to identify robust trends, such as the positive scaling of ICL with model size and the importance of demonstration diversity.
  • Theoretical Insights: Reviews mechanistic explanations, including the role of attention in implementing implicit gradient descent and the emergence of induction heads in transformer models.
  • Limitation Analysis: Documents failure modes such as sensitivity to prompt order, label noise, and distribution shift, providing a foundation for future robustness research.

Results

While the survey does not present new experimental results, it synthesizes key empirical findings from the literature:

  • ICL performance scales log-linearly with model size (e.g., GPT-3 175B outperforms smaller variants).
  • Prompt design choices (e.g., example ordering, formatting) can cause performance swings of 10-30% on standard benchmarks.
  • ICL is more effective for tasks aligned with the model's training distribution; out-of-distribution tasks show degraded performance.
  • Theoretical models (e.g., ICL as Bayesian inference) can predict some empirical trends but fail to capture all observed behaviors.

Significance

This survey has broad implications for the AI field. For practitioners, it offers practical guidelines for designing effective prompts and understanding when ICL can be trusted. For researchers, it identifies open problems such as making ICL more robust and efficient, and connecting it to broader learning paradigms like meta-learning and in-context reinforcement learning. The paper also underscores the need for standardized benchmarks and evaluation protocols for ICL, which would accelerate progress. Ultimately, by consolidating current knowledge, this survey helps move ICL from an empirical curiosity to a well-understood tool in the AI toolkit.