Comparative Analysis of Demonstration Selection Algorithms for LLM In-Context Learning

Dong Shu, Mengnan Du
10/30/2024
cs.CLcs.AIcs.LG

Official code: Tizzzzy/Demonstration_Selection_Overview (16 stars, last commit 2024-11-08).

Abstract

In-context learning can help Large Language Models (LLMs) to adapt new tasks without additional training. However, this performance heavily depends on the quality of the demonstrations, driving research into effective demonstration selection algorithms to optimize this process. These algorithms assist users in selecting the best $k$ input-label pairs (demonstration examples) based on a given test input, enabling LLMs to in-context learn the relationship between the provided examples and the test inputs. Despite all the proposed demonstration selection algorithms, their efficiency and effectiveness remain unclear. This lack of clarity make it difficult to apply these algorithms in real-world scenarios and poses challenges for future research aimed at developing improved methods. This paper revisits six proposed algorithms, evaluating them on five datasets from both efficiency and effectiveness perspectives. Our experiments reveal significant variations in algorithm performance across different tasks, with some methods struggling to outperform random selection in certain scenarios. We also find that increasing the number of demonstrations does not always lead to better performance, and that there are often trade-offs between accuracy and computational efficiency. Our code is available at https://github.com/Tizzzzy/Demonstration_Selection_Overview.

View on arXivView PDF

Code Implementations(1)

✨✨ Official repo for "Comparative Analysis of Demonstration Selection Algorithms for LLM In-Context Learning"

160PythonAug 8, 20241 years ago

Similar Papers

Cite this paper

@article{shu2024comparative,
  title  = {Comparative Analysis of Demonstration Selection Algorithms for LLM In-Context Learning},
  author = {Dong Shu and Mengnan Du},
  year   = {2024},
  eprint = {2410.23099},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.23099v1}
}

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

Discussion