mlsanityData to 14 Oct 2026

DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge Transfer

arXiv 2507.23554 ↗First posted 31 Jul 2025cs.AIcited by 5

On the map: LLM agents and tool use → General LLM agent frameworks and benchmarks

Abstract (arXiv)

Large language model-based agents, empowered by in-context learning (ICL), have demonstrated strong capabilities in complex reasoning and tool-use tasks. However, existing works have shown that the effectiveness of ICL is highly sensitive to the choice of demonstrations, with suboptimal examples often leading to unstable or degraded performance. While prior work has explored example selection, including in some agentic or multi-step settings, existing approaches typically rely on heuristics or task-specific designs and lack a general, theoretically grounded criterion for what constitutes an effective demonstration across reasoning steps. Therefore, it is non-trivial to develop a principled, general-purpose method for selecting demonstrations that consistently benefit agent performance. In this paper, we address this challenge with DICE, Dynamic In-Context Example Selection for LLM Agents, a theoretically grounded ICL framework for agentic tasks that selects the most relevant demonstrations at each step of reasoning. Our approach decomposes demonstration knowledge into transferable and non-transferable components through a causal lens, showing how the latter can introduce spurious dependencies that impair generalization. We further propose a stepwise selection criterion with a formal guarantee of improved agent performance. Importantly, DICE is a general, framework-agnostic solution that can be integrated as a plug-in module into existing agentic frameworks without any additional training cost. Extensive experiments across diverse domains demonstrate our method's effectiveness and generality, highlighting the importance of principled, context-aware demo selection for robust and efficient LLM agents.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in General LLM agent frameworks and benchmarks, one of 16 directions in LLM agents and tool use. Builds on 64 of its 72 references that are in the map. First posted on arXiv 31 Jul 2025.

Builds on

64 of 72 references.

Closest ancestors · 6

Same direction, newest first

  1. 2024CoPS: Empowering LLM Agents with Provable Cross-Task Experience Sharing22 Oct
  2. 2024AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning17 Jun
  3. 2024Towards Efficient LLM Grounding for Embodied Multi-Agent Collaboration23 May
  4. 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models6 Oct
  5. 2023A Survey on Large Language Model based Autonomous Agents22 Aug
  6. 2023ExpeL: LLM Agents Are Experiential Learners20 Aug

Other references · 58

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2025Qwen3 Technical Reportcited by 8,820
  4. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  5. 2018Representation Learning with Contrastive Predictive Codingcited by 7,777
  6. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  7. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
  8. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  9. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
  10. 2022Scaling Instruction-Finetuned Language Modelscited by 3,024
  11. 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
  12. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
38 more
  1. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
  2. 2022WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agentscited by 1,251
  3. 2020ALFWorld: Aligning Text and Embodied Environments for Interactive Learningcited by 1,205
  4. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
  5. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
  6. 2022Super-NaturalInstructions: Generalization via Declarative Instructions on 1600+ NLP Taskscited by 868
  7. 2019ALFRED: A Benchmark for Interpreting Grounded Instructions for Everyday Taskscited by 783
  8. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  9. 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
  10. 2021MetaICL: Learning to Learn In Contextcited by 454
  11. 2017Information-theoretic analysis of generalization capability of learning algorithmscited by 303
  12. 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 245
  13. 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
  14. 2022OPT-IML: Scaling Language Model Instruction Meta Learning through the Lens of Generalizationcited by 236
  15. 2022Demystifying Prompts in Language Models via Perplexity Estimationcited by 216
  16. 2022Active Example Selection for In-Context Learningcited by 196
  17. 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 161
  18. 2024EASYTOOL: Enhancing LLM-based Agents with Concise Tool Instructioncited by 154
  19. 2023Compositional Exemplars for In-context Learningcited by 144
  20. 2023Finding Support Examples for In-Context Learningcited by 104
  21. 2024GUI Agents: A Surveycited by 103
  22. 2023How Does Information Bottleneck Help Deep Learning?cited by 93
  23. 2022An Information-theoretic Approach to Prompt Engineering Without Ground Truth Labelscited by 89
  24. 2022Structured Prompting: Scaling In-Context Learning to 1,000 Examplescited by 81
  25. 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Modelscited by 80
  26. 2023In-context Pretraining: Language Modeling Beyond Document Boundariescited by 79
  27. 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
  28. 2023Multilingual LLMs are Better Cross-lingual In-context Learners with Alignmentcited by 71
  29. 2023Making Language Models Better Tool Learners with Execution Feedbackcited by 70
  30. 2022Self-Generated In-Context Learning: Leveraging Auto-regressive Language Models as a Demonstration Generatorcited by 68
  31. 2023LASER: LLM Agent with State-Space Exploration for Web Navigationcited by 66
  32. 2023In-context Example Selection with Influencescited by 61
  33. 2023Learning to Retrieve In-Context Examples for Large Language Modelscited by 60
  34. 2023Active Learning Principles for In-Context Learning with Large Language Modelscited by 54
  35. 2024Let's Learn Step by Step: Enhancing In-Context Learning Ability with Curriculum Learningcited by 47
  36. 2023Pre-Training to Learn in Contextcited by 42
  37. 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regressioncited by 41
  38. 2024DriVLMe: Enhancing LLM-based Autonomous Driving Agents with Embodied and Social Experiencescited by 27

50 most cited of 58 All 58 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 5.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Leveraging In-Context Learning for Language Model Agents
  2. 2026CB-Agent: Concept-Based In-Context Learning for Sequential Action Selection
  3. 2025Self-Generated In-Context Examples Improve LLM Agents for Sequential Decision-Making Tasks
  4. 2025Agent-as-Tool: A Study on the Hierarchical Decision Making with Reinforcement Learning
  5. 2025AutoTool: Dynamic Tool Selection and Integration for Agentic Reasoning
  6. 2025Learning When to Plan: Efficiently Allocating Test-Time Compute for LLM Agents
  7. 2025Refract ICL: Rethinking Example Selection in the Era of Million-Token Models
  8. 2025Agentic Reasoning and Tool Integration for LLMs via Reinforcement Learning