Revisiting Demonstration Selection Strategies in In-Context Learning
Keqin Peng, Liang Ding, Yancheng Yuan, Xuebo Liu, Min Zhang, Yuanxin Ouyang, Dacheng Tao
摘要
Large language models (LLMs) have shown an impressive ability to perform a wide range of tasks using in-context learning (ICL), where a few examples are used to describe a task to the model. However, the performance of ICL varies significantly with the choice of demonstrations, and previous research usually focuses on the data aspect ignoring the model's effect. In this work, we first revisit the factors contributing to this variance from the model aspect, and find that the demonstration choice is both data-and model-dependent. We further propose a conjecture that the performance of a demonstration positively correlates with its contribution to the model's understanding of the test samples, and accordingly propose a dataand model-dependent demonstration selection method, TopK + ConE. Empirically, our method yields consistent improvements in both language understanding and generation tasks with different model scales. Further analyses confirm that, besides the generality and stability under different circumstances, our method provides a unified explanation for the effectiveness of previous methods. Code is publicly available at https://github.com/Romainpkq/ revisit_demon_selection_in_ICL .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Topic Coverage-based Demonstration Retrieval for In-Context Learning 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- Topic Coverage-based Demonstration Retrieval for In-Context Learning 引用了 Language Models are Few-Shot Learners
- On the Noise Robustness of In-Context Learning for Text Generation 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- On the Noise Robustness of In-Context Learning for Text Generation 引用了 Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
- On the Noise Robustness of In-Context Learning for Text Generation 引用了 Language Models are Few-Shot Learners
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 Language Models are Few-Shot Learners
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
- From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and When 引用了 Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
- From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and When 引用了 Language Models are Few-Shot Learners
- What Makes a Good Natural Language Prompt? 引用了 Training language models to follow instructions with human feedback
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? 引用了 Language Models are Few-Shot Learners
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
- TestNUC: Enhancing Test-Time Computing Approaches and Scaling through Neighboring Unlabeled Data Consistency 引用了 On the Noise Robustness of In-Context Learning for Text Generation
- Calibrate Before Use: Improving Few-shot Performance of Language Models 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper19
- On the Noise Robustness of In-Context Learning for Text GenerationHongfu Gao, Feipeng Zhang, Wenyu Jiang, Jun Shu 等NeurIPS 2024 · 20 次引用
- What Makes a Good Natural Language Prompt?Do Xuan Long, Duy Dinh, Ngoc-Hai Nguyen, Kenji Kawaguchi 等ACL 2025 · 13 次引用
- From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and WhenKevin Christian Wibisono, Yixin WangNeurIPS 2024 · 5 次引用
- Topic Coverage-based Demonstration Retrieval for In-Context LearningWonbin Kweon, SeongKu Kang, Runchu Tian, Pengcheng Jiang 等EMNLP 2025 · 4 次引用
- TestNUC: Enhancing Test-Time Computing Approaches and Scaling through Neighboring Unlabeled Data ConsistencyHenry Peng Zou, Zhengyao Gu, Yue Zhou, Yankai Chen 等ACL 2025 · 3 次引用
它引用的 Paper10
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein 等ICML 2021 · 1,843 次引用
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel 等ACL 2022 · 1,494 次引用
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe 等EMNLP 2022 · 634 次引用
相关 Paper
- Active Example Selection for In-Context LearningYiming Zhang, Shi Feng, Chenhao TanEMNLP 2022 · 84 次引用
- DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge TransferRuoyu Wang, Junda Wu, Yu Xia, Tong Yu 等KDD 2026 · 6 次引用
- What Do Language Models Learn in Context? The Structured Task HypothesisJiaoda Li, Yifan Hou, Mrinmaya Sachan, Ryan CotterellACL 2024 · 5 次引用
- Learning to Select In-Context Demonstration Preferred by Large Language ModelZheng Zhang, Shaocheng Lan, Lei Song, Jiang Bian 等ACL Findings 2025 · 5 次引用
- How Many Demonstrations Do You Need for In-context Learning?Jiuhai Chen, Lichang Chen, Chen Zhu, Tianyi ZhouEMNLP Findings 2023 · 12 次引用
