arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2606.07904cs.AIcs.SE
收藏

Contract2Tool: 学习可靠工具增强型LLM代理的前提条件和效果

Contract2Tool: Learning Preconditions and Effects for Reliable Tool-Augmented LLM Agents

Independent Researcher(独立研究者);United States of America(美国)

Rahul Suresh Babu, Laxmipriya Ganesh Iyer

AI总结:

提出Contract2Tool框架,从元数据、文档和执行轨迹中推断工具契约,实现因果工具过滤,在保持可靠性的同时大幅减少工具选择和token使用。

摘要:

工具增强型大语言模型代理越来越依赖外部API,但标准工具模式描述的是如何调用工具,而非工具何时因果合适或产生何种任务状态。因果工具过滤通过使用轻量级契约来弥补这一差距,这些契约指定了每个工具的前提条件、效果、风险级别和成本。然而,手动编写和维护此类契约无法扩展到大型或变化的工具生态系统。我们引入了Contract2Tool,这是一个从元数据、模式、文档和执行轨迹中推断工具契约的框架。Contract2Tool将可观察的工具证据转换为标准化的符号契约,这些契约可以在内部评估并部署到下游的因果工具过滤中。我们根据黄金标准的前提条件、效果和风险标签评估学习到的契约,并测量它们在多步代理任务中的下游效用。我们的结果表明,混合文档和轨迹证据产生的契约足够准确,可以保留黄金契约的大部分可靠性和效率优势。学习契约的CMTF实现了0.980的下游成功率,接近黄金契约CMTF的0.990,同时将可见工具从100个减少到1个,并将平均token使用量从26,172减少到2,528(相对于所有工具暴露)。这些结果表明,学习到的契约可以在工具模式和可靠代理执行之间提供可扩展的契约层。

英文摘要:

Tool-augmented large language model agents increasingly rely on external APIs, but standard tool schemas describe how to call a tool, not when the tool is causally appropriate or what task state it produces. Causal tool filtering addresses this gap by using lightweight contracts that specify each tool's preconditions, effects, risk level, and cost. However, manually writing and maintaining such contracts does not scale to large or changing tool ecosystems. We introduce Contract2Tool, a framework for inferring tool contracts from metadata, schemas, documentation, and execution traces. Contract2Tool converts observable tool evidence into normalized symbolic contracts that can be evaluated intrinsically and deployed inside downstream causal tool filtering. We evaluate learned contracts against gold preconditions, effects, and risk labels, and measure their downstream utility on multi-step agent tasks. Our results show that hybrid documentation-and-trace evidence produces contracts accurate enough to preserve most of the reliability and efficiency benefits of gold contracts. Learned-contract CMTF achieves 0.980 downstream success, close to 0.990 for gold-contract CMTF, while reducing visible tools from 100 to 1 and reducing average token usage from 26,172 to 2,528 relative to all-tools exposure. These results suggest that learned contracts can provide a scalable contract layer between tool schemas and reliable agent execution.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑