Dynamic Demonstrations Controller for In-Context Learning

Fei Zhao, Taotian Pang, Zhen Wu, Zheng Ma, Shujian Huang +1 more
9/30/2023
cs.CLcs.AI

No official code found. Best implementation: TJTP/D2Controller (4 stars, last commit 2024-05-29).

Abstract

In-context learning (ICL) is a new paradigm for natural language processing (NLP), where a large language model (LLM) observes a small number of demonstrations and a test instance as its input, and directly makes predictions without updating model parameters. Previous studies have revealed that ICL is sensitive to the selection and the ordering of demonstrations. However, there are few studies regarding the impact of the demonstration number on the ICL performance within a limited input length of LLM, because it is commonly believed that the number of demonstrations is positively correlated with model performance. In this paper, we found this conclusion does not always hold true. Through pilot experiments, we discover that increasing the number of demonstrations does not necessarily lead to improved performance. Building upon this insight, we propose a Dynamic Demonstrations Controller (D$^2$Controller), which can improve the ICL performance by adjusting the number of demonstrations dynamically. The experimental results show that D$^2$Controller yields a 4.6% relative improvement on ten different sizes of LLMs across ten datasets. Moreover, we also extend our method to previous ICL models and achieve competitive results.

View on arXivView PDF

Code Implementations(1)

TJTP/D2ControllerCommunity100%
40Shell, PythonSep 30, 20232 years ago

Similar Papers

Cite this paper

@article{zhao2023dynamic,
  title  = {Dynamic Demonstrations Controller for In-Context Learning},
  author = {Fei Zhao and Taotian Pang and Zhen Wu and Zheng Ma and Shujian Huang and Xinyu Dai},
  year   = {2023},
  eprint = {2310.00385},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.00385v2}
}

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

Discussion