DemoShapley: Valuation of Demonstrations for In-Context Learning

Shan Xie, Man Luo, Chadly Daniel Stern, Mengnan Du, Lu Cheng
10/10/2024
cs.CLcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) using in-context learning (ICL) excel in many tasks without task-specific fine-tuning. However, demonstration selection and ordering greatly impact ICL effectiveness. Focus on this issue, we propose DemoShapley, a Shapley-value based method that evaluates each demonstration's contribution by measuring its marginal effect across different prompt permutations. To further account for ICL's limited context windows and frequent low-shot settings, we introduce Beta-DemoShapley, a weighted extension that emphasizes the influence of smaller prompt sizes. Experiments on multiple benchmarks show that DemoShapley consistently outperforms existing influence-based selection strategies, while Beta-DemoShapley further improves performance in low-shot scenarios. Both methods also detect mislabeled data, enhance generalization to out-of-distribution tasks, and reduce demographic bias. Together, they provide a unified and robust framework for demonstration valuation in ICL.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{xie2024demoshapley,
  title  = {DemoShapley: Valuation of Demonstrations for In-Context Learning},
  author = {Shan Xie and Man Luo and Chadly Daniel Stern and Mengnan Du and Lu Cheng},
  year   = {2024},
  eprint = {2410.07523},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.07523v3}
}

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

Discussion