Skip to main navigation Skip to search Skip to main content

DemoShapley: Valuation of Demonstrations for In-Context Learning

  • Shan Xie
  • , Man Luo
  • , Chadly Daniel Stern
  • , Mengnan Du
  • , Cheng Lu

Research output: Chapter in Book/Report/Conference proceeding › Conference contribution

Abstract

Large language models (LLMs) using in-context learning (ICL) excel in many tasks without task-specific finetuning. 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.

Original languageEnglish (US)
Title of host publicationProceedings - 2025 IEEE International Conference on Big Data, BigData 2025
EditorsCheng-Zhong Xu, Leong Hou U, Xueqi Cheng, Jing Gao, Giuseppe Polese, Hong Mei, Paul Boniol, Michiaki Tatsubori, Chen Zhao, Dawei Zhou, Xiaohua Hu
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages4081-4090
Number of pages10
Edition2025
ISBN (Electronic)9798331594473
DOIs
StatePublished - 2025
Event2025 IEEE International Conference on Big Data, BigData 2025 - Macau, China
Duration: Dec 8 2025 → Dec 11 2025

Conference

Conference2025 IEEE International Conference on Big Data, BigData 2025
Country/TerritoryChina
CityMacau
Period12/8/25 → 12/11/25

All Science Journal Classification (ASJC) codes

  • Artificial Intelligence
  • Computer Networks and Communications
  • Computer Science Applications
  • Information Systems
  • Information Systems and Management
  • Safety, Risk, Reliability and Quality

Keywords

  • Data Evaluation
  • In-Context Learning
  • LLM

Fingerprint

Dive into the research topics of 'DemoShapley: Valuation of Demonstrations for In-Context Learning'. Together they form a unique fingerprint.

Cite this