Coverage-based Example Selection for In-Context Learning

05/24/2023
by   Shivanshu Gupta, et al.
0

In-context learning (ICL), the ability of large language models to perform novel tasks by conditioning on a prompt with a few task examples, requires demonstrations that are informative about the test instance. The standard approach of independently selecting the most similar examples selects redundant demonstrations while overlooking important information. This work proposes a framework for assessing the informativeness of demonstrations based on their coverage of salient aspects (e.g., reasoning patterns) of the test input. Using this framework, we show that contextual token embeddings effectively capture these salient aspects, and their recall measured using BERTScore-Recall (BSR) yields a reliable measure of informativeness. Further, we extend recall metrics like BSR to propose their set versions to find maximally informative sets of demonstrations. On 6 complex compositional generation tasks and 7 diverse LLMs, we show that Set-BSR outperforms the standard similarity-based approach by up to 16 that leverage task or LLM-specific training.

READ FULL TEXT

page 8

page 19

research
02/25/2022

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

Large language models (LMs) are able to in-context learn – perform a new...
research
12/13/2022

Diverse Demonstrations Improve In-context Compositional Generalization

In-context learning has shown great success in i.i.d semantic parsing sp...
research
05/23/2023

Active Learning Principles for In-Context Learning with Large Language Models

The remarkable advancements in large language models (LLMs) have signifi...
research
12/03/2022

What is Not in the Context? Evaluation of Few-shot Learners with Informative Demonstrations

Large language models demonstrate an emergent ability to learn a new tas...
research
07/05/2023

Scaling In-Context Demonstrations with Structured Attention

The recent surge of large language models (LLMs) highlights their abilit...
research
05/16/2023

What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learning

Large language models (LLMs) exploit in-context learning (ICL) to solve ...
research
05/24/2023

Prompt Optimization of Large Language Model for Interactive Tasks without Gradient and Demonstrations

Large language models (LLMs) have demonstrated remarkable language profi...

Please sign up or login with your details

Forgot password? Click here to reset