AgentWeave: Routing Before Reasoning for Efficient Function Calling in Tool-Rich Language Models
作者: Saurav Singla, Aarav Singla, Advik Gupta, Parnika Gupta
分类: cs.AI, cs.CL
发布日期: 2026-08-24
备注: 12 pages, 2 figures, 6 tables. Open-source implementation and reproducibility artifacts available in the AgentWeave repository
💡 一句话要点
提出AgentWeave以提高工具丰富语言模型的函数调用效率
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 语言模型 函数调用 路由机制 工具集合 推理效率 候选空间 智能助手
📋 核心要点
- 现有方法在处理大型工具集合时,候选动作空间的扩大导致模型推理效率低下,且成功率不理想。
- 论文提出AgentWeave,通过在推理前进行路由,构建有限的模型可见动作空间,从而提高函数调用的效率。
- 实验结果显示,AgentWeave在48个新任务中取得了12.5%的成功率,相比基线显著提升,同时减少了工具数量和输入令牌的使用。
📝 摘要(中文)
随着大型语言模型在工具、函数、API和专用代理的集合上操作,候选动作空间的扩大使得函数调用模型需要处理更多的模式,消耗更多的提示令牌,并区分越来越相似或无关的替代方案。本文提出了一种互补的系统策略:在语言模型推理之前减少候选集,同时保持下游模型不变。我们引入了AgentWeave,一个确定性的推理前路由层,通过资格、需求、能力和路由信号构建一个有限的模型可见动作空间。实验结果表明,AgentWeave在多个功能任务上显著提高了成功率,展示了候选空间构建对固定模型的函数调用行为的实质性影响。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在面对庞大工具集合时,候选动作空间过大导致的推理效率低下和成功率低的问题。现有方法在处理相似或无关的候选时表现不佳,影响了模型的实际应用。
核心思路:论文的核心思路是引入AgentWeave,一个在推理前进行路由的层,通过构建有限的模型可见动作空间来减少候选集,从而提高函数调用的效率。这样的设计使得模型在推理时能够专注于更相关的候选,提升了成功率。
技术框架:整体架构包括一个确定性的路由层,该层利用资格、需求、能力和路由信号来构建候选动作空间。具体流程为:首先分析输入,提取相关信号,然后通过路由层筛选出最有可能的候选,最后将这些候选传递给下游模型进行推理。
关键创新:最重要的技术创新在于AgentWeave的路由机制,它在推理前就对候选集进行了有效的缩减,显著提高了模型的推理效率和成功率。这与现有方法的直接推理不同,提供了一种新的思路。
关键设计:在设计上,AgentWeave使用了多种信号(如资格和能力)来评估候选的相关性,并通过确定性路由来确保高效性。实验中还采用了BFCL衍生的路由压力协议,以验证其有效性。
🖼️ 关键图片
📊 实验亮点
实验结果显示,AgentWeave在48个新任务中实现了12.5%的成功率,而所有工具、确定性随机前8和语义前8基线均未能取得成功。与所有工具的暴露相比,AgentWeave减少了70.18%的工具使用,输入令牌减少了61.70%,并且局部模型延迟降低了50.95%。
🎯 应用场景
该研究的潜在应用领域包括智能助手、自动化工具调用和多任务学习等场景。通过提高函数调用的效率,AgentWeave可以在实际应用中显著提升用户体验和系统性能,未来可能推动更复杂的智能系统的发展。
📄 摘要(原文)
Large language models increasingly operate over large collections of tools, functions, APIs, and specialized agents. As the candidate action space grows, a function-calling model must process more schemas, consume more prompt tokens, and distinguish among increasingly similar or irrelevant alternatives. We study a complementary systems strategy: reduce the candidate set before language-model inference while leaving the downstream model unchanged. We introduce AgentWeave, a deterministic pre-inference routing layer that constructs a bounded model-visible action space using eligibility, requirement, capability, and routing signals. We evaluate AgentWeave with a frozen BFCL-derived routing-pressure protocol using the public MadeAgents/Hammer2.1-1.5b model. On 48 fresh BFCL V4 multiple-function tasks, AgentWeave achieves 6/48 (12.5%) native BFCL successes, whereas all-tools, deterministic random top-8, and semantic top-8 baselines each achieve 0/48. The paired success difference is +12.5 percentage points with a 10,000-resample paired bootstrap 95% confidence interval of +4.17 to +22.92 points and exact McNemar p=0.03125. Relative to all-tools exposure, AgentWeave presents 70.18% fewer tools, uses 61.70% fewer input tokens, and exhibits 50.95% lower mean local-model latency. The result is deliberately narrow: this is a BFCL-derived routing-pressure study rather than an official full BFCL leaderboard score, and absolute task success remains low. The evidence nevertheless shows that candidate-space construction can materially affect a fixed model's function-calling behavior and motivates evaluating routing as a distinct stage before model reasoning.