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

Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis +2 more
2/25/2022
2,347 citations
cs.CLcs.AI

Official code: Alrope123/rethinking-demonstrations (176 stars, Python, last commit 2024-07-24).

Abstract

Large language models (LMs) are able to in-context learn -- perform a new task via inference alone by conditioning on a few input-label pairs (demonstrations) and making predictions for new inputs. However, there has been little understanding of how the model learns and which aspects of the demonstrations contribute to end task performance.

Show full abstract

In this paper, we show that ground truth demonstrations are in fact not required -- randomly replacing labels in the demonstrations barely hurts performance on a range of classification and multi-choce tasks, consistently over 12 different models including GPT-3. Instead, we find that other aspects of the demonstrations are the key drivers of end task performance, including the fact that they provide a few examples of (1) the label space, (2) the distribution of the input text, and (3) the overall format of the sequence. Together, our analysis provides a new way of understanding how and why in-context learning works, while opening up new questions about how much can be learned from large language models through inference alone.

View on arXivView PDF

Code Implementations(1)

17617PythonFeb 25, 20222 years ago

Similar Papers

Cite this paper

@article{min2022rethinking,
  title  = {Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?},
  author = {Sewon Min and Xinxi Lyu and Ari Holtzman and Mikel Artetxe and Mike Lewis and Hannaneh Hajishirzi and Luke Zettlemoyer},
  year   = {2022},
  eprint = {2202.12837},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2202.12837}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2202.12837.svg)](https://codeofpaper.com/paper/2202.12837)

Discussion