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

通过合成用户输入测试与理解LLM智能体中的错误规划

Testing and Understanding Erroneous Planning in LLM Agents through Synthesized User Inputs

The Hong Kong University of Science and Technology(香港科技大学)

Zhenlan Ji, Daoyuan Wu, Pingchuan Ma, Zongjie Li, Shuai Wang

AI总结:

提出PDoctor自动化测试方法,将LLM智能体错误规划检测形式化为约束可满足性问题,通过Z3合成用户输入并推导约束作为测试预言机,有效检测主流框架规划错误并提供错误特征见解。

摘要:

基于大语言模型(LLMs)的智能体通过将LLMs与规划、记忆和工具使用等关键模块相结合,在解决广泛任务方面展现了有效性。越来越多的客户在各种对可靠性至关重要的商业应用中采用LLM智能体,包括心理健康支持、化学合成和软件开发。然而,我们的观察和日常使用表明,LLM智能体容易做出错误规划,尤其是在任务复杂且需要长期规划时。在本文中,我们提出PDoctor,一种测试LLM智能体并理解其错误规划的新颖自动化方法。作为该方向的首次工作,我们将错误规划的检测形式化为约束可满足性问题:如果LLM智能体的规划执行违反了从用户输入推导出的约束,则该规划被视为错误。为此,PDoctor首先为用户查询定义领域特定语言(DSL),并在Z3约束求解器的辅助下合成多样化的输入。这些合成输入是自然语言段落,指定了完成一系列任务的要求。然后,PDoctor从这些要求中推导约束以形成测试预言机。我们使用三种主流智能体框架和两个强大的LLM(GPT-3.5和GPT-4)评估PDoctor。结果表明,PDoctor能有效检测智能体规划中的各类错误,并为智能体开发者和用户提供有价值的见解和错误特征。我们最后讨论了扩展PDoctor的潜在替代设计和方向。

英文摘要:

Agents based on large language models (LLMs) have demonstrated effectiveness in solving a wide range of tasks by integrating LLMs with key modules such as planning, memory, and tool usage. Increasingly, customers are adopting LLM agents across a variety of commercial applications critical to reliability, including support for mental well-being, chemical synthesis, and software development. Nevertheless, our observations and daily use of LLM agents indicate that they are prone to making erroneous plans, especially when the tasks are complex and require long-term planning. In this paper, we propose PDoctor, a novel and automated approach to testing LLM agents and understanding their erroneous planning. As the first work in this direction, we formulate the detection of erroneous planning as a constraint satisfiability problem: an LLM agent's plan is considered erroneous if its execution violates the constraints derived from the user inputs. To this end, PDoctor first defines a domain-specific language (DSL) for user queries and synthesizes varying inputs with the assistance of the Z3 constraint solver. These synthesized inputs are natural language paragraphs that specify the requirements for completing a series of tasks. Then, PDoctor derives constraints from these requirements to form a testing oracle. We evaluate PDoctor with three mainstream agent frameworks and two powerful LLMs (GPT-3.5 and GPT-4). The results show that PDoctor can effectively detect diverse errors in agent planning and provide insights and error characteristics that are valuable to both agent developers and users. We conclude by discussing potential alternative designs and directions to extend PDoctor.

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

↑