Compositional Exemplars for In-context Learning

02/11/2023
by   Jiacheng Ye, et al.
0

Large pretrained language models (LMs) have shown impressive In-Context Learning (ICL) ability, where the model learns to do an unseen task via a prompt consisting of input-output examples as the demonstration, without any parameter updates. The performance of ICL is highly dominated by the quality of the selected in-context examples. However, previous selection methods are mostly based on simple heuristics, leading to sub-optimal performance. In this work, we formulate in-context example selection as a subset selection problem. We propose CEIL(Compositional Exemplars for In-context Learning), which is instantiated by Determinantal Point Processes (DPPs) to model the interaction between the given input and in-context examples, and optimized through a carefully-designed contrastive learning objective to obtain preference from LMs. We validate CEIL on 12 classification and generation datasets from 7 distinct NLP tasks, including sentiment analysis, paraphrase detection, natural language inference, commonsense reasoning, open-domain question answering, code generation, and semantic parsing. Extensive experiments demonstrate not only the state-of-the-art performance but also the transferability and compositionality of CEIL, shedding new light on effective and efficient in-context learning. Our code is released at https://github.com/HKUNLP/icl-ceil.

READ FULL TEXT
research
11/08/2022

Active Example Selection for In-Context Learning

With a handful of demonstration examples, large-scale language models sh...
research
08/17/2023

Exploring Demonstration Ensembling for In-context Learning

In-context learning (ICL) operates by showing language models (LMs) exam...
research
12/20/2022

Self-adaptive In-context Learning

Despite the surprising few-shot performance of in-context learning (ICL)...
research
12/01/2022

Learning to Select from Multiple Options

Many NLP tasks can be regarded as a selection problem from a set of opti...
research
05/24/2023

Improving Probability-based Prompt Selection Through Unified Evaluation and Analysis

Large Language Models (LLMs) have demonstrated great capabilities in sol...
research
04/15/2023

Constructing Effective In-Context Demonstration for Code Intelligence Tasks: An Empirical Study

Pre-trained models of code have gained widespread popularity in many cod...
research
07/11/2023

Towards Understanding In-Context Learning with Contrastive Demonstrations and Saliency Maps

We investigate the role of various demonstration components in the in-co...

Please sign up or login with your details

Forgot password? Click here to reset