Take One Step at a Time to Know Incremental Utility of Demonstration: An Analysis on Reranking for Few-Shot In-Context Learning (2024)

Abstract: In-Context Learning (ICL) is an emergent capability of Large Language Models (LLMs). Only a few demonstrations enable LLMs to be used as blackbox for new tasks. Previous studies have shown that using LLMs’ outputs as labels is effective in training models to select demonstrations. Such a label is expected to estimate utility of a demonstration in ICL; however, it has not been well understood how different labeling strategies affect results on target tasks. This paper presents an analysis on different utility functions by focusing on LLMs’ output probability given ground-truth output, and task-specific reward given LLMs’ prediction. Unlike the previous work, we introduce a novel labeling method, incremental utility, which estimates how much incremental knowledge is brought into the LLMs by a demonstration. We conduct experiments with instruction-tuned LLMs on binary/multi-class classification, segmentation, and translation across Arabic, English, Finnish, Japanese, and Spanish. Our results show that (1) the probability is effective when the probability values are distributed across the whole value range (on the classification tasks), and (2) the downstream metric is more robust when nuanced reward values are provided with long outputs (on the segmentation and translation tasks). We then show that the proposed incremental utility further helps ICL by contrasting how the LLMs perform with and without the demonstrations.

## introduction recent advances of large language models (llms) @xcite @xcite have been pushing the field of natural language processing (nlp) to the next level in many different aspects. a notable capability of llms is few-shot in-context learning (icl), which uses only a few demonstrations (i.e., input-output pairs) to perform new tasks without finetuning @xcite . a crucial research topic is demonstration selection for icl. @xcite proposed retrievalbased icl, and @xcite have shown that further finetuning retrieval models is effective @xcite @xcite . however, it is not conclusive how to train the selection models in several aspects: training labels, objectives, and overall pipelines. this paper focuses on the training labels of the selection models. first, we use two types of values to estimate utility of a demonstration for an input: (1) an llm's output probability of generating the ground-truth output (as in the previous work), and (2) a task-specific reward function given the llm's prediction (as in reward optimization @xcite ). next, we introduce a novel method to estimate incremental utility by contrasting the 1-shot icl performance and the 0-shot performance (figure 1 ). we expect the incremental utility to estimate how much incremental knowledge is brought by the demonstration, assuming that the llms have a capability of 0-shot prediction @xcite . we conduct experiments in a standard retrievalreranking framework with instruction-tuned llms. the evaluation tasks are binary/multi-class classification, segmentation, and translation across five languages: arabic, english, finnish, japanese, and spanish. our results and analysis show the following insights: ## inference and training pipelines this section describes our experimental design for the comparative study. for a target task, we have a training set @xmath0, . . . , e i , . . .], where e @xmath1, y i ) is an input-output pair; for example, y i is a class label on a text classification task. ## experimental settings this section describes our experimental settings; more comprehensive descriptions are in appendix. ## results and discussions we first summarize general observations, and then show our analysis to provide insights. ## related work we discuss relationships between our work and previous work from several viewpoints. interested readers may refer to a survey by @xcite . utility function recent work @xcite @xcite has proposed finetuning text retrieval models by estimating direct utility of a demonstration by u oplike utility functions. while they showed the effectiveness, we have made a deeper dive into understanding the effects of the different utility functions, especially with the enhance of incremental utility. loss function to finetune the retrieval models, some used contrastive learning to contrast a high-utility demonstration against a number of low-utility demonstrations @xcite @xcite , and others used ranking losses @xcite . contrastive learning @xcite and ranking losses @xcite are widely used for document retrieval and reranking, but simple pointwise regression has shown to be effective as well @xcite @xcite . we employed the pointwise regression (equation ( 2 )), based on our observations that it significantly improves icl upon the retr baseline. instead, we focused on the contrast between the 0-shot and 1-shot performances to derive the incremental utility functions. overall pipeline lin et al. (2023) have taken one step further to finetune llms with a retriever, while our work has focused on using an llm as it is. within this framework, it is a common practice to directly finetune a dense text retrieval model @xcite for the demonstration retrieval @xcite @xcite , while @xcite employed a two-step approach by knowledge distillation with a cross-attention reward model (similar to our reranking model). by contrast, we followed another major framework with retrieval and reranking @xcite , where we use a generic text retriever for all the different settings. this is useful in making our experiments controllable for analysis, in that the reranking models are always applied to the consistent candidate sets. one potential drawback of the cascaded pipeline is that the search space is limited; still, we have shown that there is large room for improvement even within the limited search space. ## conclusion this paper has investigated how the output probability and downstream metric affect the utility estimation of demonstrations for icl. our in-depth analysis has shown that the output probability is robust on the classification tasks, and the downstream metric is robust especially when the output probability is not well distributed across the whole value range. furthermore, we provided discussions about why and when our proposed incremental utility helps improve the icl results.