In-Context Learning Demonstration Selection via Influence Analysis

Vinay M.S.,Minh-Hao Van,Xintao Wu
2024-06-18
Abstract:Large Language Models (LLMs) have showcased their In-Context Learning (ICL) capabilities, enabling few-shot learning without the need for gradient updates. Despite its advantages, the effectiveness of ICL heavily depends on the choice of demonstrations. Selecting the most effective demonstrations for ICL remains a significant research challenge. To tackle this issue, we propose a demonstration selection method named InfICL, which utilizes influence functions to analyze impacts of training samples. By identifying the most influential training samples as demonstrations, InfICL aims to enhance the ICL generalization performance. To keep InfICL cost-effective, we only use the LLM to generate sample input embeddings, avoiding expensive fine-tuning. Through empirical studies on various real-world datasets, we demonstrate advantages of InfICL compared to state-of-the-art baselines.
Computation and Language
What problem does this paper attempt to address?
The paper aims to address the issue of how to select the most effective example demonstrations in In-Context Learning (ICL). Specifically, while ICL methods can achieve few-shot learning, their performance is highly dependent on the quality of the selected demonstration examples. To overcome this limitation, the authors propose a method based on influence functions analysis, called InfICL, to identify the most influential training samples for the model as demonstration examples. Through this approach, InfICL aims to improve the generalization performance of ICL. Additionally, to maintain cost-effectiveness, InfICL only utilizes large language models to generate sample input embeddings, avoiding the expensive fine-tuning process. Experiments show that InfICL has advantages over other state-of-the-art baseline methods.