DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge Transfer
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
- 2024CoPS: Empowering LLM Agents with Provable Cross-Task Experience Sharing22 Oct
- 2024AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning17 Jun
- 2024Towards Efficient LLM Grounding for Embodied Multi-Agent Collaboration23 May
- 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models6 Oct
- 2023A Survey on Large Language Model based Autonomous Agents22 Aug
- 2023ExpeL: LLM Agents Are Experiential Learners20 Aug
Other references · 58
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2025Qwen3 Technical Reportcited by 8,820
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,777
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
- 2022Scaling Instruction-Finetuned Language Modelscited by 3,024
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
38 more
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2022WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agentscited by 1,251
- 2020ALFWorld: Aligning Text and Embodied Environments for Interactive Learningcited by 1,205
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
- 2022Super-NaturalInstructions: Generalization via Declarative Instructions on 1600+ NLP Taskscited by 868
- 2019ALFRED: A Benchmark for Interpreting Grounded Instructions for Everyday Taskscited by 783
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
- 2021MetaICL: Learning to Learn In Contextcited by 454
- 2017Information-theoretic analysis of generalization capability of learning algorithmscited by 303
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 245
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
- 2022OPT-IML: Scaling Language Model Instruction Meta Learning through the Lens of Generalizationcited by 236
- 2022Demystifying Prompts in Language Models via Perplexity Estimationcited by 216
- 2022Active Example Selection for In-Context Learningcited by 196
- 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 161
- 2024EASYTOOL: Enhancing LLM-based Agents with Concise Tool Instructioncited by 154
- 2023Compositional Exemplars for In-context Learningcited by 144
- 2023Finding Support Examples for In-Context Learningcited by 104
- 2024GUI Agents: A Surveycited by 103
- 2023How Does Information Bottleneck Help Deep Learning?cited by 93
- 2022An Information-theoretic Approach to Prompt Engineering Without Ground Truth Labelscited by 89
- 2022Structured Prompting: Scaling In-Context Learning to 1,000 Examplescited by 81
- 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Modelscited by 80
- 2023In-context Pretraining: Language Modeling Beyond Document Boundariescited by 79
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2023Multilingual LLMs are Better Cross-lingual In-context Learners with Alignmentcited by 71
- 2023Making Language Models Better Tool Learners with Execution Feedbackcited by 70
- 2022Self-Generated In-Context Learning: Leveraging Auto-regressive Language Models as a Demonstration Generatorcited by 68
- 2023LASER: LLM Agent with State-Space Exploration for Web Navigationcited by 66
- 2023In-context Example Selection with Influencescited by 61
- 2023Learning to Retrieve In-Context Examples for Large Language Modelscited by 60
- 2023Active Learning Principles for In-Context Learning with Large Language Modelscited by 54
- 2024Let's Learn Step by Step: Enhancing In-Context Learning Ability with Curriculum Learningcited by 47
- 2023Pre-Training to Learn in Contextcited by 42
- 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regressioncited by 41
- 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
Citing papers per year: 2026: 5.
5 papers.
- 2026Skill-R1: Agent Skill Evolution via Reinforcement Learningcited by 15
- 2026Generate, Filter, Control, Replay: A Comprehensive Survey of Rollout Strategies for LLM Reinforcement Learningcited by 9
- 2026OLIVIA: Online Learning via Inference-time Action Adaptation for Decision Making in LLM ReAct Agentscited by 2
- 2026Skill-CMIB: Multimodal Agent Skill for Consistent Action via Conditional Multimodal Information Bottleneckcited by 1
- 2026FrugalSOT - Frugal Search Over the Modelscited by 0
- 2026FrugalSOT - Frugal Search Over the Models21 Aug 2026
- 2026OLIVIA: Online Learning via Inference-time Action Adaptation for Decision Making in LLM ReAct Agents11 May 2026
- 2026Skill-R1: Agent Skill Evolution via Reinforcement Learning10 May 2026
- 2026Skill-CMIB: Multimodal Agent Skill for Consistent Action via Conditional Multimodal Information Bottleneck8 May 2026
- 2026Generate, Filter, Control, Replay: A Comprehensive Survey of Rollout Strategies for LLM Reinforcement Learning8 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2025Leveraging In-Context Learning for Language Model Agents
- 2026CB-Agent: Concept-Based In-Context Learning for Sequential Action Selection
- 2025Self-Generated In-Context Examples Improve LLM Agents for Sequential Decision-Making Tasks
- 2025Agent-as-Tool: A Study on the Hierarchical Decision Making with Reinforcement Learning
- 2025AutoTool: Dynamic Tool Selection and Integration for Agentic Reasoning
- 2025Learning When to Plan: Efficiently Allocating Test-Time Compute for LLM Agents
- 2025Refract ICL: Rethinking Example Selection in the Era of Million-Token Models
- 2025Agentic Reasoning and Tool Integration for LLMs via Reinforcement Learning