Demonstration Selection for In-Context Learning via Reinforcement Learning
On the map: Deep reinforcement learning methods → RL training of language and agent models
Abstract (arXiv)
Diversity in demonstration selection is critical for enhancing model generalization by enabling broader coverage of structures and concepts. Constructing appropriate demonstration sets remains a key research challenge. This paper introduces the Relevance-Diversity Enhanced Selection (RDES), an innovative approach that leverages reinforcement learning (RL) frameworks to optimize the selection of diverse reference demonstrations for tasks amenable to in-context learning (ICL), particularly text classification and reasoning, in few-shot prompting scenarios. RDES employs frameworks like Q-learning and a PPO-based variant to dynamically identify demonstrations that maximize both diversity (quantified by label distribution) and relevance to the task objective. This strategy ensures a balanced representation of reference data, leading to improved accuracy and generalization. Through extensive experiments on multiple benchmark datasets, including diverse reasoning tasks, and involving 14 closed-source and open-source LLMs, we demonstrate that RDES significantly enhances performance compared to ten established baselines. Our evaluation includes analysis of performance across varying numbers of demonstrations on selected datasets. Furthermore, we investigate incorporating Chain-of-Thought (CoT) reasoning, which further boosts predictive performance. The results highlight the potential of RL for adaptive demonstration selection and addressing challenges in ICL.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Placed in RL training of language and agent models, one of 15 directions in Deep reinforcement learning methods. Builds on 36 of its 49 references that are in the map. First posted on arXiv 5 Dec 2024.
Builds on
36 of 49 references.
References · 36
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
- 2024Qwen2 Technical Reportcited by 2,120
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
- 2022Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Themcited by 1,807
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
24 more
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,407
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2022Automatic Chain of Thought Prompting in Large Language Modelscited by 688
- 2019Text Summarization with Pretrained Encoderscited by 556
- 2020Efficient Intent Detection with Dual Sentence Encoderscited by 433
- 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 386
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2021Generated Knowledge Prompting for Commonsense Reasoningcited by 214
- 2022Active Example Selection for In-Context Learningcited by 196
- 2020The Next Decade in AI: Four Steps Towards Robust Artificial Intelligencecited by 195
- 2019Benchmarking Natural Language Understanding Services for building Conversational Agentscited by 166
- 2022A Comprehensive Survey of Few-shot Learning: Evolution, Applications, Challenges, and Opportunitiescited by 163
- 2023Compositional Exemplars for In-context Learningcited by 144
- 2022Diverse Demonstrations Improve In-context Compositional Generalizationcited by 139
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2023Coverage-based Example Selection for In-Context Learningcited by 59
- 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
- 2023Which Examples to Annotate for In-Context Learning? Towards Effective and Efficient Selectioncited by 37
- 2023Unlocking the Potential of User Feedback: Leveraging Large Language Model as User Simulator to Enhance Dialogue Systemcited by 32
- 2023RetICL: Sequential Retrieval of In-Context Examples with Reinforcement Learningcited by 24
- 2024Closing the gap between open-source and commercial large language models for medical evidence summarizationcited by 21
- 2024Mitigating Boundary Ambiguity and Inherent Bias for Text Classification in the Era of Large Language Modelscited by 9
- 2024Effective Demonstration Annotation for In-Context Learning via Language Model-Based Determinantal Point Processcited by 9
- 2024Enhancing Text Annotation through Rationale-Driven Collaborative Few-Shot Promptingcited by 5
Built on by
Citing papers per year: 2025: 3; 2026: 5.
8 papers.
- 2025DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge Transfercited by 5
- 2025Thinking with Nothinking Calibration: A New In-Context Learning Paradigm in Reasoning Large Language Modelscited by 4
- 2026Learning to Select Visual In-Context Demonstrationscited by 2
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectivenesscited by 1
- 2026GRIP: Feedback-Guided Prompt Retrieval for Large Multimodal Modelscited by 1
- 2026Downstream-Aware Context Selection for Online In-Context Reinforcement Learningcited by 0
- 2026You Only Edit Once: Incentivizing In-Context Capability of LLMs via Local Demonstration Refinementcited by 0
- 2026Query-Adaptive Neuron Steering for LLMscited by 0
- 2026Query-Adaptive Neuron Steering for LLMs10 Oct 2026
- 2026You Only Edit Once: Incentivizing In-Context Capability of LLMs via Local Demonstration Refinement27 Sep 2026
- 2026Downstream-Aware Context Selection for Online In-Context Reinforcement Learning27 Sep 2026
- 2026GRIP: Feedback-Guided Prompt Retrieval for Large Multimodal Models10 Jun 2026
- 2026Learning to Select Visual In-Context Demonstrations24 Mar 2026
- 2025Thinking with Nothinking Calibration: A New In-Context Learning Paradigm in Reasoning Large Language Models5 Aug 2025
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectiveness1 Aug 2025
- 2025DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge Transfer31 Jul 2025
Similar, not cited
Close in wording, no citation either way
- 2025Linear-Time Demonstration Selection for In-Context Learning via Gradient Estimation
- 2024Demonstration Notebook: Finding the Most Suited In-Context Learning Example from Interactions
- 2023Dr.ICL: Demonstration-Retrieved In-context Learning
- 2026Demonstrations, CoT, and Prompting: A Theoretical Analysis of ICL
- 2025Efficient and Effective In-context Demonstration Selection with Coreset
- 2025Unraveling Indirect In-Context Learning Using Influence Functions
- 2026Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learning
- 2025Provoking Multi-modal Few-Shot LVLM via Exploration-Exploitation In-Context Learning