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.


翻译:工具增强型大语言模型代理日益依赖外部应用程序编程接口,但标准工具模式仅描述如何调用工具,而非工具何时具有因果适用性或产生何种任务状态。因果工具过滤机制通过轻量级合约填补这一空白,该合约规定了每个工具的前提条件、效果、风险级别和成本。然而,人工编写和维护此类合约难以扩展至庞大或动态演化的工具生态系统。我们提出Contract2Tool框架,用于从元数据、模式、文档及执行轨迹中推断工具合约。Contract2Tool将可观测工具证据转化为标准化符号合约,该合约可被内在评估并部署至下游因果工具过滤中。我们基于黄金标准的前提条件、效果及风险标签评估学习所得的合约,并衡量其在多步骤代理任务中的下游效用。实验结果表明,结合文档与轨迹的证据混合方法生成合约的准确性足以保留黄金合约的大部分可靠性与效率优势。采用学习合约的因果工具过滤在下游任务中达到0.980成功率(接近黄金合约的0.990),同时将可见工具数量从100降至1,并将平均令牌使用量从全部工具暴露时的26,172降至2,528。这些结果表明,学习所得合约可为工具模式与可靠代理执行之间提供可扩展的合约层。

0
下载
关闭预览

相关内容

国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关VIP内容
相关基金
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员