Tool agents -- LLM-based systems that interact with external APIs -- offer a way to execute real-world tasks. However, as tasks become increasingly complex, these agents struggle to identify and call the correct APIs in the proper order. To tackle this problem, we investigate converting API documentation into a structured API graph that captures API dependencies and leveraging it for multi-tool queries that require compositional API calls. To support this, we introduce In-N-Out, the first expert-annotated dataset of API graphs built from two real-world API benchmarks and their documentation. Using In-N-Out significantly improves performance on both tool retrieval and multi-tool query generation, nearly doubling that of LLMs using documentation alone. Moreover, graphs generated by models fine-tuned on In-N-Out close 90% of this gap, showing that our dataset helps models learn to comprehend API documentation and parameter relationships. Our findings highlight the promise of using explicit API graphs for tool agents and the utility of In-N-Out as a valuable resource. We will release the dataset and code publicly.


翻译:工具代理——基于大型语言模型(LLM)并与外部API交互的系统——提供了一种执行现实世界任务的途径。然而,随着任务日益复杂,这些代理难以按正确顺序识别和调用合适的API。为解决此问题,我们研究将API文档转换为结构化API图以捕获API依赖关系,并利用其处理需要组合API调用的多工具查询。为此,我们提出了In-N-Out,这是首个基于两个真实世界API基准及其文档构建的专家标注API图数据集。使用In-N-Out显著提升了工具检索和多工具查询生成的性能,其效果近乎是仅使用文档的LLM的两倍。此外,通过在In-N-Out上微调的模型生成的图弥补了90%的性能差距,表明我们的数据集有助于模型学习理解API文档及参数关系。我们的研究结果凸显了使用显式API图支持工具代理的潜力,以及In-N-Out作为宝贵资源的实用性。我们将公开数据集和代码。

0
下载
关闭预览

相关内容

应用程序接口(简称 API),又称为应用编程接口,就是软件系统不同组成部分衔接的约定。
图增强生成(GraphRAG)
专知会员服务
33+阅读 · 1月4日
【CVPR2024】ViewDiff: 3D一致的图像生成与文本到图像模型
专知会员服务
30+阅读 · 2024年3月10日
《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
用Rasa NLU构建自己的中文NLU系统
待字闺中
18+阅读 · 2017年9月18日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关资讯
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
用Rasa NLU构建自己的中文NLU系统
待字闺中
18+阅读 · 2017年9月18日
相关基金
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员