轻量级函数调用的动态工具依赖检索
Dynamic Tool Dependency Retrieval for Lightweight Function Calling
AI总结:
本文提出动态工具依赖检索方法,通过结合初始查询和逐步展开的工具调用计划,提升函数调用的准确性和效率,实验表明其在多个数据集和模型上均优于现有静态检索方法。
摘要:
由大型语言模型(LLMs)驱动的函数调用代理通过选择外部工具来自动化复杂任务。在设备端代理通常使用检索模块选择相关工具,以提高性能并减少上下文长度。然而,现有检索方法依赖于静态和有限的输入,无法捕捉多步骤工具依赖和演进的任务上下文。这种限制常常引入不相关的工具,导致代理误导,降低效率和准确性。我们提出了动态工具依赖检索(DTDR),一种轻量级检索方法,它基于函数调用演示建模工具依赖,实现计划展开时的自适应检索。我们在多个数据集和LLM基础架构上评估了DTDR与最先进的检索方法,评估检索精度、下游任务准确性以及计算效率。此外,我们探索了将检索到的工具整合到提示中的策略。我们的结果表明,DTDR在多个数据集和LLM基础架构上均优于现有静态检索方法,函数调用成功率提高了23%至104%。
英文摘要:
Function calling agents powered by Large Language Models (LLMs) select external tools to automate complex tasks. On-device agents typically use a retrieval module to select relevant tools, improving performance and reducing context length. However, existing retrieval methods rely on static and limited inputs, failing to capture multi-step tool dependencies and evolving task context. This limitation often introduces irrelevant tools that mislead the agent, degrading efficiency and accuracy. We propose Dynamic Tool Dependency Retrieval (DTDR), a lightweight retrieval method that conditions on both the initial query and the evolving tool calling plan. DTDR models tool dependencies from function calling demonstrations, enabling adaptive retrieval as plans unfold. We benchmark DTDR against state-of-the-art retrieval methods across multiple datasets and LLM backbones, evaluating retrieval precision, downstream task accuracy, and computational efficiency. Additionally, we explore strategies to integrate retrieved tools into prompts. Our results show that DTDR improves function calling success rates between $23\%$ and $104\%$ compared to state-of-the-art static retrievers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。