定义与检测基于大语言模型的自主智能体的缺陷
Defining and Detecting the Defects of the Large Language Model-based Autonomous Agents
AI总结:
本文首次定义了基于LLM的智能体的8种缺陷类型,并设计了静态分析工具Agentable,结合代码属性图与LLM检测缺陷,在自建数据集上准确率达88.79%。
摘要:
AI智能体是能够感知环境、自主规划和执行任务的系统。LLM的最新进展为AI智能体引入了一种变革性范式,使其能够通过提示与外部资源和工具进行交互。在此类智能体中,工作流将开发者编写的代码(负责管理框架构建和逻辑控制)与LLM生成的自然语言(用于增强动态决策和交互)结合在一起。然而,开发者在行为和预期结果方面实现的逻辑与LLM动态生成的内容之间存在差异,这可能导致缺陷,例如工具调用失败和任务执行错误。这些问题带来了特定风险,在基于LLM的AI智能体中引发各种缺陷,如服务中断。尽管这些问题很重要,但目前缺乏系统性的工作专注于分析基于LLM的AI智能体以发现其代码中的缺陷。本文提出了首个致力于识别和检测LLM智能体缺陷的研究。我们从StackOverflow收集并分析了6,854条相关帖子,定义了8种类型的智能体缺陷。针对每种类型,我们提供了详细描述及示例。随后,我们设计了一款名为Agentable的静态分析工具来检测这些缺陷。Agentable利用代码属性图和LLM,通过高效识别特定代码模式并分析自然语言描述来分析智能体工作流。为评估Agentable,我们构建了两个数据集:AgentSet(包含84个真实世界的智能体)和AgentTest(包含78个专门设计用于包含各类缺陷的智能体)。结果显示,Agentable的总体准确率达到88.79%,召回率达到91.03%。此外,我们的分析揭示了AgentSet中的889个缺陷,突显了这些缺陷的普遍性。
英文摘要:
AI agents are systems capable of perceiving their environment, autonomously planning and executing tasks. Recent advancements in LLM have introduced a transformative paradigm for AI agents, enabling them to interact with external resources and tools through prompts. In such agents, the workflow integrates developer-written code, which manages framework construction and logic control, with LLM-generated natural language that enhances dynamic decision-making and interaction. However, discrepancies between developer-implemented logic and the dynamically generated content of LLMs in terms of behavior and expected outcomes can lead to defects, such as tool invocation failures and task execution errors. These issues introduce specific risks, leading to various defects in LLM-based AI Agents, such as service interruptions. Despite the importance of these issues, there is a lack of systematic work that focuses on analyzing LLM-based AI Agents to uncover defects in their code. In this paper, we present the first study focused on identifying and detecting defects in LLM Agents. We collected and analyzed 6,854 relevant posts from StackOverflow to define 8 types of agent defects. For each type, we provided detailed descriptions with an example. Then, we designed a static analysis tool, named Agentable, to detect the defects. Agentable leverages Code Property Graphs and LLMs to analyze Agent workflows by efficiently identifying specific code patterns and analyzing natural language descriptions. To evaluate Agentable, we constructed two datasets: AgentSet, consists of 84 real-world Agents, and AgentTest, which contains 78 Agents specifically designed to include various types of defects. Our results show that Agentable achieved an overall accuracy of 88.79% and a recall rate of 91.03%. Furthermore, our analysis reveals the 889 defects of the AgentSet, highlighting the prevalence of these defects.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。