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

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Wang, Ruoyu, Wu, Junda, Xia, Yu, Yu, Tong, Rossi, Ryan A., McAuley, Julian, Yao, Lina
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916873564585984
author Wang, Ruoyu
Wu, Junda
Xia, Yu
Yu, Tong
Rossi, Ryan A.
McAuley, Julian
Yao, Lina
author_facet Wang, Ruoyu
Wu, Junda
Xia, Yu
Yu, Tong
Rossi, Ryan A.
McAuley, Julian
Yao, Lina
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2507_23554
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge Transfer
Wang, Ruoyu
Wu, Junda
Xia, Yu
Yu, Tong
Rossi, Ryan A.
McAuley, Julian
Yao, Lina
Artificial Intelligence
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.
title DICE: Dynamic In-Context Example Selection in LLM Agents via Efficient Knowledge Transfer
topic Artificial Intelligence
url https://arxiv.org/abs/2507.23554