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

SelfHeal:LLM代理中故障修复模式的实证分析与故障修复

SelfHeal: Empirical Fix Pattern Analysis and Bug Repair in LLM Agents

Oakland University(奥克兰大学)

Niful Islam, Muhammad Anas Raza, Mohammad Wardat

AI总结:

本文研究LLM代理中的故障修复模式,提出首个基准数据集AgentDefect,并设计SelfHeal多智能体系统,利用ReAct代理结合内部和外部知识实现高效故障修复。

摘要:

大型语言模型(LLMs)已革新软件开发和AI应用。尽管LLMs专为文本处理设计,但LLM代理通过自主行动、工具使用和多步骤任务完成扩展了这一能力。随着该领域发展,开发人员面临调试复杂系统的新挑战。为此,我们首次对LLM代理中的故障修复模式进行实证研究。我们研究了来自Stack Overflow、GitHub和HuggingFace Forums的3个平台的故障帖子和代码片段。我们分析了其修复模式、修复应用的组件、涉及的编程语言和框架。此外,我们引入了首个LLM代理故障基准数据集AgentDefect,包含37个运行时故障实例及其修复代码和测试文件。最后,我们提出了SelfHeal,一个设计用于修复LLM代理故障的多智能体系统。该系统利用两个独立的ReAct代理:修复代理和批评代理。这些代理使用提供内部知识(修复规则)和外部知识(网络搜索)的工具来提出和验证修复方案。我们的评估显示,SelfHeal以Gemini 3 Pro为骨干LLM,在显著程度上优于基线和最先进方法。

英文摘要:

Large Language Models (LLMs) have transformed software development and AI applications. While LLMs are designed for text processing, LLM agents extend this capability by enabling autonomous actions, tool use, and multi-step task completion. As this field grows, developers face new challenges in debugging these complex systems. To address this challenge, we present the first empirical study on bug fix patterns in LLM agents. We study buggy posts and code snippets from three platforms: Stack Overflow, GitHub, and HuggingFace Forums. We examine their fix patterns, the components where fixes are applied, and the programming languages and frameworks involved. Furthermore, we introduce AgentDefect, the first benchmark dataset for bugs in LLM agents. The dataset contains 37 runtime buggy instances along with fixed code and test files. Finally, we present SelfHeal, a multi-agent system designed to fix bugs in LLM agents. The system leverages two independent ReAct agents: the fix agent and the critic agent. These agents use tools that provide both internal knowledge (fix rules) and external knowledge (web search) to propose and validate fixes. Our evaluation shows that SelfHeal with Gemini 3 Pro as the backbone LLM outperforms both baseline and state-of-the-art approaches by a significant margin.

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

↑