Not All Demonstration Examples are Equally Beneficial: Reweighting Demonstration Examples for In-Context Learning
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have recently gained the In-Context Learning (ICL) ability with the models scaling up, allowing them to quickly adapt to downstream tasks with only a few demonstration examples prepended in the input sequence. Nonetheless, the current practice of ICL treats all demonstration examples equally, which still warrants improvement, as the quality of examples is usually uneven. In this paper, we investigate how to determine approximately optimal weights for demonstration examples and how to apply them during ICL. To assess the quality of weights in the absence of additional validation data, we design a masked self-prediction (MSP) score that exhibits a strong correlation with the final ICL performance. To expedite the weight-searching process, we discretize the continuous weight space and adopt beam search. With approximately optimal weights obtained, we further propose two strategies to apply them to demonstrations at different model positions. Experimental results on 8 text classification tasks show that our approach outperforms conventional ICL by a large margin. Our code are publicly available at https:github.com/Zhe-Young/WICL.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 20 of its 39 references that are in the map. First posted on arXiv 12 Oct 2023.
Builds on
20 of 39 references.
References · 20
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Out of One, Many: Using Language Models to Simulate Human Samplescited by 737
- 2018Learning to Reweight Examples for Robust Deep Learningcited by 670
- 2021True Few-Shot Learning with Language Modelscited by 343
- 2022Demystifying Prompts in Language Models via Perplexity Estimationcited by 215
8 more
- 2022Active Example Selection for In-Context Learningcited by 195
- 2021Efficient Large Scale Language Modeling with Mixtures of Expertscited by 175
- 2021Noisy Channel Language Model Prompting for Few-Shot Text Classificationcited by 163
- 2022Ground-Truth Labels Matter: A Deeper Look into Input-Label Demonstrationscited by 116
- 2023Finding Support Examples for In-Context Learningcited by 104
- 2022Z-ICL: Zero-Shot In-Context Learning with Pseudo-Demonstrationscited by 70
- 2021FLEX: Unifying Evaluation for Few-Shot NLPcited by 67
- 2021True Few-Shot Learning with Prompts -- A Real-World Perspectivecited by 38
Built on by
Citing papers per year: 2024: 6; 2025: 2; 2026: 1.
9 papers.
- 2025More is not always better? Enhancing Many-Shot In-Context Learning with Differentiated and Reweighting Objectivescited by 12
- 2024Mitigating Copy Bias in In-Context Learning through Neuron Pruningcited by 11
- 2024Can Large Language Models Always Solve Easy Problems if They Can Solve Harder Ones?cited by 9
- 2024Vocabulary-Defined Semantics: Latent Space Clustering for Improving In-Context Learningcited by 7
- 2024ICDPO: Effectively Borrowing Alignment Capability of Others via In-context Direct Preference Optimizationcited by 6
- 2024Instruction Tuning Vs. In-Context Learning: Revisiting Large Language Models in Few-Shot Computational Social Sciencecited by 4
- 2025Prompting Large Language Models with Partial Knowledge for Answering Questions with Unseen Entitiescited by 4
- 2026Experience Transfer for Multimodal LLM Agents in Minecraft Gamecited by 4
- 2024Label Set Optimization via Activation Distribution Kurtosis for Zero-shot Classification with Generative Modelscited by 0
- 2026Experience Transfer for Multimodal LLM Agents in Minecraft Game7 Apr 2026
- 2025Prompting Large Language Models with Partial Knowledge for Answering Questions with Unseen Entities2 Aug 2025
- 2025More is not always better? Enhancing Many-Shot In-Context Learning with Differentiated and Reweighting Objectives7 Jan 2025
- 2024Label Set Optimization via Activation Distribution Kurtosis for Zero-shot Classification with Generative Models24 Oct 2024
- 2024Mitigating Copy Bias in In-Context Learning through Neuron Pruning2 Oct 2024
- 2024Instruction Tuning Vs. In-Context Learning: Revisiting Large Language Models in Few-Shot Computational Social Science23 Sep 2024
- 2024Can Large Language Models Always Solve Easy Problems if They Can Solve Harder Ones?18 Jun 2024
- 2024ICDPO: Effectively Borrowing Alignment Capability of Others via In-context Direct Preference Optimization14 Feb 2024
- 2024Vocabulary-Defined Semantics: Latent Space Clustering for Improving In-Context Learning29 Jan 2024