mlsanityData to 14 Oct 2026

Demonstration Selection for In-Context Learning via Reinforcement Learning

arXiv 2412.03966 ↗First posted 5 Dec 2024cs.AI cs.CLcited by 8

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  4. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  5. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  6. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  7. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
  8. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
  9. 2024Qwen2 Technical Reportcited by 2,120
  10. 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
  11. 2022Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Themcited by 1,807
  12. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
24 more
  1. 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,407
  2. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
  3. 2022Automatic Chain of Thought Prompting in Large Language Modelscited by 688
  4. 2019Text Summarization with Pretrained Encoderscited by 556
  5. 2020Efficient Intent Detection with Dual Sentence Encoderscited by 433
  6. 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 386
  7. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  8. 2021Generated Knowledge Prompting for Commonsense Reasoningcited by 214
  9. 2022Active Example Selection for In-Context Learningcited by 196
  10. 2020The Next Decade in AI: Four Steps Towards Robust Artificial Intelligencecited by 195
  11. 2019Benchmarking Natural Language Understanding Services for building Conversational Agentscited by 166
  12. 2022A Comprehensive Survey of Few-shot Learning: Evolution, Applications, Challenges, and Opportunitiescited by 163
  13. 2023Compositional Exemplars for In-context Learningcited by 144
  14. 2022Diverse Demonstrations Improve In-context Compositional Generalizationcited by 139
  15. 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
  16. 2023Coverage-based Example Selection for In-Context Learningcited by 59
  17. 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
  18. 2023Which Examples to Annotate for In-Context Learning? Towards Effective and Efficient Selectioncited by 37
  19. 2023Unlocking the Potential of User Feedback: Leveraging Large Language Model as User Simulator to Enhance Dialogue Systemcited by 32
  20. 2023RetICL: Sequential Retrieval of In-Context Examples with Reinforcement Learningcited by 24
  21. 2024Closing the gap between open-source and commercial large language models for medical evidence summarizationcited by 21
  22. 2024Mitigating Boundary Ambiguity and Inherent Bias for Text Classification in the Era of Large Language Modelscited by 9
  23. 2024Effective Demonstration Annotation for In-Context Learning via Language Model-Based Determinantal Point Processcited by 9
  24. 2024Enhancing Text Annotation through Rationale-Driven Collaborative Few-Shot Promptingcited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 5.

8 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Linear-Time Demonstration Selection for In-Context Learning via Gradient Estimation
  2. 2024Demonstration Notebook: Finding the Most Suited In-Context Learning Example from Interactions
  3. 2023Dr.ICL: Demonstration-Retrieved In-context Learning
  4. 2026Demonstrations, CoT, and Prompting: A Theoretical Analysis of ICL
  5. 2025Efficient and Effective In-context Demonstration Selection with Coreset
  6. 2025Unraveling Indirect In-Context Learning Using Influence Functions
  7. 2026Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learning
  8. 2025Provoking Multi-modal Few-Shot LVLM via Exploration-Exploitation In-Context Learning