arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.04479cs.AIcs.SE
收藏

ToolFuzz——自动化智能体工具测试

ToolFuzz -- Automated Agent Tool Testing

ETH Zurich(苏黎世联邦理工学院)

Ivan Milev, Mislav Balunović, Maximilian Baader, Martin Vechev

AI总结:

本文提出ToolFuzz,首个自动化测试智能体工具文档的方法,可发现工具运行时错误和错误响应,并在多个工具和基准上验证其效果优于提示工程方法。

摘要:

大型语言模型(LLM)智能体在实际应用中利用LLM的高级推理能力。为了与环境交互,这些智能体通常依赖工具,例如网络搜索或数据库API。由于智能体在用户查询的同时向LLM提供工具文档,因此该文档的完整性和正确性至关重要。然而,工具文档常常存在过度规定、规定不足或规定不当的问题,从而影响智能体的准确性。标准软件测试方法难以识别这些错误,因为它们是用自然语言表达的。因此,尽管工具文档测试十分重要,目前仍不存在自动化的方法来测试智能体的工具文档。为了解决这一问题,我们提出了ToolFuzz,这是首个用于自动化测试工具文档的方法。ToolFuzz旨在发现两类错误:(1)导致工具运行时错误的用户查询,以及(2)导致智能体响应不正确的用户查询。ToolFuzz能够生成大量且多样化的自然输入,以较低的假阳性率有效发现工具描述错误。此外,我们提出了两种直接的提示工程方法。我们在32个常见的LangChain工具、35个新创建的自定义工具以及2个新的基准上评估了这三种工具测试方法,以进一步加强评估。我们发现许多公开可用的工具存在规定不足的问题。具体而言,我们表明ToolFuzz识别出的错误输入数量是提示工程方法的20倍,使其成为构建可靠AI智能体的关键组成部分。

英文摘要:

Large Language Model (LLM) Agents leverage the advanced reasoning capabilities of LLMs in real-world applications. To interface with an environment, these agents often rely on tools, such as web search or database APIs. As the agent provides the LLM with tool documentation along the user query, the completeness and correctness of this documentation is critical. However, tool documentation is often over-, under-, or ill-specified, impeding the agent's accuracy. Standard software testing approaches struggle to identify these errors as they are expressed in natural language. Thus, despite its importance, there currently exists no automated method to test the tool documentation for agents. To address this issue, we present ToolFuzz, the first method for automated testing of tool documentations. ToolFuzz is designed to discover two types of errors: (1) user queries leading to tool runtime errors and (2) user queries that lead to incorrect agent responses. ToolFuzz can generate a large and diverse set of natural inputs, effectively finding tool description errors at a low false positive rate. Further, we present two straightforward prompt-engineering approaches. We evaluate all three tool testing approaches on 32 common LangChain tools and 35 newly created custom tools and 2 novel benchmarks to further strengthen the assessment. We find that many publicly available tools suffer from underspecification. Specifically, we show that ToolFuzz identifies 20x more erroneous inputs compared to the prompt-engineering approaches, making it a key component for building reliable AI agents.

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

↑