One size doesn't fit all: Predicting the Number of Examples for In-Context Learning

Manish Chandra, Debasis Ganguly, Iadh Ounis
3/11/2024
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

In-context learning (ICL) refers to the process of adding a small number of localized examples from a training set of labelled data to an LLM's prompt with an objective to effectively control the generative process seeking to improve the downstream task performance. Existing ICL approaches use an identical number of examples (a pre-configured hyper-parameter) for each data instance. Our work alleviates the limitations of this 'one fits all' approach by dynamically predicting the number of examples for each data instance to be used in few-shot inference with LLMs. In particular, we employ a multi-label classifier, the parameters of which are fitted using a training set, where the label for each instance in this training set indicates if using a specific value of k (number of most similar examples from 0 up to a maximum value) leads to correct k-shot downstream predictions. Our experiments on a number of text classification benchmarks show that AICL substantially outperforms standard ICL by up to 17%.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chandra2024size,
  title  = {One size doesn't fit all: Predicting the Number of Examples for In-Context Learning},
  author = {Manish Chandra and Debasis Ganguly and Iadh Ounis},
  year   = {2024},
  eprint = {2403.06402},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.06402v3}
}

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

Discussion