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

通过基于图的检索与Reflexion实现故障定位的多智能体方法

A Multi-Agent Approach to Fault Localization via Graph-Based Retrieval and Reflexion

Md Nakhla Rafi, Dong Jae Kim, Tse-Hsun Chen, Shaowei Wang

AI总结:

针对LLM故障定位中的token限制、长输入退化和可扩展性问题,提出三智能体LLM4FL框架,结合覆盖率分割、图检索导航与言语强化反思,在Defects4J上显著提升Top-1准确率。

摘要:

识别并解决软件故障仍然是一个具有挑战性且资源密集的过程。传统故障定位技术(如基于频谱的故障定位(Spectrum-Based Fault Localization,SBFL))利用测试覆盖率的统计分析,但往往准确性有限。尽管基于学习的方法改进了故障定位,它们却需要大量训练数据集和高昂计算资源。大型语言模型(LLM)的最新进展通过增强代码理解与推理提供了新机遇。然而,现有基于LLM的故障定位技术面临重大挑战,包括token限制、长输入导致的性能下降,以及复杂软件系统中的可扩展性问题。为克服这些障碍,我们提出LLM4FL,这是一个利用三个专用LLM智能体的多智能体故障定位框架。首先,上下文提取智能体采用顺序敏感的分割策略,在LLM的token限制内划分大型覆盖率数据,分析失败上下文,并对与失败相关的方法进行优先级排序。随后,调试器智能体处理所提取的数据,它采用基于图的检索增强代码导航来推理失败原因并对可疑方法排序。最后,审查者智能体使用言语强化学习重新评估已识别的故障方法,开展自我批评与迭代细化。在包含来自14个Java项目的675个故障的Defects4J(V2.0.0)基准上评估时,LLM4FL的Top-1准确率相比AutoFL提升18.55%,相比SoapFL提升4.82%。它优于DeepFL和Grace等监督技术,且无需任务特定训练。此外,其覆盖率分割和提示链策略提升了性能,使Top-1准确率最高提高22%。

英文摘要:

Identifying and resolving software faults remains a challenging and resource-intensive process. Traditional fault localization techniques, such as Spectrum-Based Fault Localization (SBFL), leverage statistical analysis of test coverage but often suffer from limited accuracy. While learning-based approaches improve fault localization, they demand extensive training datasets and high computational resources. Recent advances in Large Language Models (LLMs) offer new opportunities by enhancing code understanding and reasoning. However, existing LLM-based fault localization techniques face significant challenges, including token limitations, performance degradation with long inputs, and scalability issues in complex software systems. To overcome these obstacles, we propose LLM4FL, a multi-agent fault localization framework that utilizes three specialized LLM agents. First, the Context Extraction Agent applies an order-sensitive segmentation strategy to partition large coverage data within the LLM's token limit, analyze failure context, and prioritize failure-related methods. The Debugger Agent then processes the extracted data, which employs graph-based retrieval-augmented code navigation to reason about failure causes and rank suspicious methods. Finally, the Reviewer Agent re-evaluates the identified faulty methods using verbal reinforcement learning, engaging in self-criticism and iterative refinement. Evaluated on the Defects4J (V2.0.0) benchmark, which includes 675 faults from 14 Java projects, LLM4FL achieves an 18.55\% improvement in Top-1 accuracy over AutoFL and 4.82\% over SoapFL. It outperforms supervised techniques such as DeepFL and Grace, all without requiring task-specific training. Furthermore, its coverage segmentation and prompt chaining strategies enhance performance, increasing Top-1 accuracy by up to 22\%.

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

↑