Which Examples to Annotate for In-Context Learning? Towards Effective and Efficient Selection

Costas Mavromatis, Balasubramaniam Srinivasan, Zhengyuan Shen, Jiani Zhang, Huzefa Rangwala +2 more
10/30/2023
cs.CL

No official code found. Best implementation: amazon-science/adaptive-in-context-learning (19 stars, Apache-2.0, last commit 2023-10-30).

Abstract

Large Language Models (LLMs) can adapt to new tasks via in-context learning (ICL). ICL is efficient as it does not require any parameter updates to the trained LLM, but only few annotated examples as input for the LLM. In this work, we investigate an active learning approach for ICL, where there is a limited budget for annotating examples. We propose a model-adaptive optimization-free algorithm, termed AdaICL, which identifies examples that the model is uncertain about, and performs semantic diversity-based example selection. Diversity-based sampling improves overall effectiveness, while uncertainty sampling improves budget efficiency and helps the LLM learn new information. Moreover, AdaICL poses its sampling strategy as a Maximum Coverage problem, that dynamically adapts based on the model's feedback and can be approximately solved via greedy algorithms. Extensive experiments on nine datasets and seven LLMs show that AdaICL improves performance by 4.4% accuracy points over SOTA (7.7% relative improvement), is up to 3x more budget-efficient than performing annotations uniformly at random, while it outperforms SOTA with 2x fewer ICL examples.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

AdaICL: Which Examples to Annotate of In-Context Learning? Towards Effective and Efficient Selection

194Shell, PythonOct 30, 20232 years agoApache-2.0
active-learning-in-nlpfew-shot-learningin-context-learninglarge-language-modelsnlp

Similar Papers

Cite this paper

@article{mavromatis2023which,
  title  = {Which Examples to Annotate for In-Context Learning? Towards Effective and Efficient Selection},
  author = {Costas Mavromatis and Balasubramaniam Srinivasan and Zhengyuan Shen and Jiani Zhang and Huzefa Rangwala and Christos Faloutsos and George Karypis},
  year   = {2023},
  eprint = {2310.20046},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.20046v1}
}

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/2310.20046.svg)](https://codeofpaper.com/paper/2310.20046)

Discussion