Sub-SA: Strengthen In-context Learning via Submodular Selective Annotation

Jian Qian, Miao Sun, Sifan Zhou, Ziyu Zhao, Ruizhi Hun +1 more
7/8/2024
cs.LGcs.AIcs.CL

No official code found. Best implementation: JamesTsien11/SubSA (3 stars, last commit 2024-12-02).

Abstract

In-context learning (ICL) leverages in-context examples as prompts for the predictions of Large Language Models (LLMs). These prompts play a crucial role in achieving strong performance. However, the selection of suitable prompts from a large pool of labeled examples often entails significant annotation costs. To address this challenge, we propose Sub-SA (Submodular Selective Annotation), a submodule-based selective annotation method. The aim of Sub-SA is to reduce annotation costs while improving the quality of in-context examples and minimizing the time consumption of the selection process. In Sub-SA, we design a submodular function that facilitates effective subset selection for annotation and demonstrates the characteristics of monotonically and submodularity from the theoretical perspective. Specifically, we propose RPR (Reward and Penalty Regularization) to better balance the diversity and representativeness of the unlabeled dataset attributed to a reward term and a penalty term, respectively. Consequently, the selection for annotations can be effectively addressed with a simple yet effective greedy search algorithm based on the submodular function. Finally, we apply the similarity prompt retrieval to get the examples for ICL.

View on arXivView PDF

Code Implementations(1)

JamesTsien11/SubSACommunity100%
30PythonNov 30, 20241 years ago

Similar Papers

Cite this paper

@article{qian2024subsa,
  title  = {Sub-SA: Strengthen In-context Learning via Submodular Selective Annotation},
  author = {Jian Qian and Miao Sun and Sifan Zhou and Ziyu Zhao and Ruizhi Hun and Patrick Chiang},
  year   = {2024},
  eprint = {2407.05693},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.05693v2}
}

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

Discussion