Dr.ICL: Demonstration-Retrieved In-context Learning

05/23/2023
by   Man Luo, et al.
0

In-context learning (ICL), teaching a large language model (LLM) to perform a task with few-shot demonstrations rather than adjusting the model parameters, has emerged as a strong paradigm for using LLMs. While early studies primarily used a fixed or random set of demonstrations for all test queries, recent research suggests that retrieving semantically similar demonstrations to the input from a pool of available demonstrations results in better performance. This work expands the applicability of retrieval-based ICL approaches by demonstrating that even simple word-overlap similarity measures such as BM25 outperform randomly selected demonstrations. Furthermore, we extend the success of retrieval-based ICL to instruction-finetuned LLMs as well as Chain-of-Thought (CoT) prompting. For instruction-finetuned LLMs, we find that although a model has already seen the training data at training time, retrieving demonstrations from the training data at test time yields better results compared to using no demonstrations or random demonstrations. Last but not least, we train a task-specific demonstration retriever that outperforms off-the-shelf retrievers.

READ FULL TEXT
research
05/07/2023

Unified Demonstration Retriever for In-Context Learning

In-context learning is a new learning paradigm where a language model co...
research
10/07/2022

Few-Shot Anaphora Resolution in Scientific Protocols via Mixtures of In-Context Experts

Anaphora resolution is an important task for information extraction acro...
research
06/30/2023

Meta-training with Demonstration Retrieval for Efficient Few-shot Learning

Large language models show impressive results on few-shot NLP tasks. How...
research
09/14/2023

Ambiguity-Aware In-Context Learning with Large Language Models

In-context learning (ICL) i.e. showing LLMs only a few task-specific dem...
research
07/05/2023

Scaling In-Context Demonstrations with Structured Attention

The recent surge of large language models (LLMs) highlights their abilit...
research
10/19/2022

Robustness of Demonstration-based Learning Under Limited Data Scenario

Demonstration-based learning has shown great potential in stimulating pr...
research
03/24/2023

kNN Prompting: Beyond-Context Learning with Calibration-Free Nearest Neighbor Inference

In-Context Learning (ICL), which formulates target tasks as prompt compl...

Please sign up or login with your details

Forgot password? Click here to reset