Skip to main content
QUICK REVIEW

[Paper Review] In-context Learning with Retrieved Demonstrations for Language Models: A Survey

Man Luo, Xin Xu|arXiv (Cornell University)|Jan 21, 2024
Topic ModelingComputer Science6 citations
TL;DR

A comprehensive survey of retrieved demonstration in-context learning (RetICL), outlining design choices for retrieval, corpora, training, and inference strategies, and comparing 22 seminal works.

ABSTRACT

Language models, especially pre-trained large language models, have showcased remarkable abilities as few-shot in-context learners (ICL), adept at adapting to new tasks with just a few demonstrations in the input context. However, the model's ability to perform ICL is sensitive to the choice of the few-shot demonstrations. Instead of using a fixed set of demonstrations, one recent development is to retrieve demonstrations tailored to each input query. The implementation of demonstration retrieval is relatively straightforward, leveraging existing databases and retrieval systems. This not only improves the efficiency and scalability of the learning process but also has been shown to reduce biases inherent in manual example selection. In light of the encouraging results and growing research in ICL with retrieved demonstrations, we conduct an extensive review of studies in this area. In this survey, we discuss and compare different design choices for retrieval models, retrieval training procedures, and inference algorithms.

Motivation & Objective

  • Motivate why in-context learning (ICL) is valuable for large language models and its limitations with fixed demonstrations.
  • Summarize the RetICL paradigm where demonstrations are dynamically retrieved for each query.
  • Review design choices for retrieval objectives, inference strategies, and retrieval corpora.
  • Categorize and synthesize 22 key papers to map the current state and future directions of RetICL.

Proposed method

  • Define the ICL problem and introduce the RetICL paradigm where a retriever selects demonstrations for each query.
  • Survey retrieval objectives (similarity vs. diversity) and how they impact demonstration selection.
  • Describe three inference strategies for retrieval (one-shot, clustering, iterative) for assembling demonstrations.
  • Detail retrieval corpora types (in-domain, mix-domain, cross-domain, unlabeled/generated data, free-form) and their implications.
  • Review off-the-shelf retrievers (BM25, sentence embeddings, dual encoders) and fine-tuned/learned retrievers.
  • Explain training data collection for demonstration retrievers using LLM signals, reward models, and ranking objectives.
Figure 1: Structure of the Survey.
Figure 1: Structure of the Survey.

Experimental results

Research questions

  • RQ1What are the main design choices in RetICL that affect the effectiveness of retrieved demonstrations?
  • RQ2How do retrieval objectives (similarity vs. diversity) influence performance across tasks and domains?
  • RQ3What inference strategies and corpora setups best support robust in-context learning with retrieved demonstrations?
  • RQ4How do off-the-shelf vs. fine-tuned demonstration retrievers compare in effectiveness and cost?
  • RQ5What are practical guidelines for building and training demonstration retrievers using LLM signals?

Key findings

  • RetICL consistently outperforms static demonstration approaches by adapting demonstrations to each query.
  • Diversity and coverage of demonstrations can be important, especially when the model is unfamiliar with output spaces.
  • Retrieval strategies (one-shot, clustering, iterative) influence the quality and complementarity of retrieved demonstrations.
  • Different retrieval corpora (in-domain, cross-domain, mix-domain, unlabeled/generated) offer trade-offs in annotation cost and performance.
  • Fine-tuned demonstration retrievers trained with task-specific signals can yield gains over off-the-shelf retrievers.
  • Using LLM-based signals and ranking objectives to train retrievers enables task-aligned demonstration selection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.