arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.24831cs.SEcs.LG
收藏

FGDM:基于推理的多智能体框架用于软件缺陷检测的链式思维和树式思维提示

FGDM: Reasoning Aware Multi-Agentic Framework for Software Bug Detection using Chain of Thought and Tree of Thought Prompting

SRM University, Andhra Pradesh(安得拉邦SRM大学)

Srita Padmanabhuni, Bhargavi Karuturi, Jerusha Karen Indupalli, Santhan Reddy Chilla, Vivek Yelleti

AI总结:

本文提出FGDM框架,利用链式思维和树式思维提示,通过流程图识别代码错误并生成修复代码,有效提升大型代码库中缺陷检测的性能。

摘要:

深度学习方法在自动化软件缺陷检测中日益突出;然而,它们缺乏对给定代码的全局理解。因此,其性能往往会下降,尤其是在应用于大型相互关联的代码库或复杂的模块化程序时。最近,大型语言模型(LLMs)已证明能够有效捕捉代码库中多个相互关联模块之间的依赖关系。这促使我们提出了流程图驱动的多智能体框架(FGDM),该框架由四个智能体按顺序操作组成。该框架将接收到的代码转换为流程图,识别出错误的部分,并进一步生成修复后的代码。所有使用的智能体都利用链式思维(COT)和树式思维(TOT)提示。此外,我们还集成了FAISS向量数据库以检索相似的先前缺陷及其修复。我们通过100个程序的实验展示了所提框架的有效性,包括Ansible、Black、FastAPI、Keras、Luigi、Matplotlib、Pandas、Scrapy、SpaCy和Tornado等项目中的C和Python程序。我们的实验表明,FGDM优于现有方法,并在Levenshtein距离上平均减少了24.33和8.37,且在Python和C中分别达到了0.951和0.974的余弦相似度。

英文摘要:

Deep Learning methods are becoming prominent in automated software bug detection; however, they lack the global understanding of the given code. Consequently, their performance tends to degrade, especially when they are applied to large interconnected code bases or complex modular programs. Recently, Large Language Models (LLMs) have proven to be effective at capturing dependencies among multiple interconnected modules in the codebase. This motivated us to propose the Flow-Graph-Driven Multi-Agent Framework (FGDM), which is composed of four agents that operate in a sequential manner. The framework converts the received code to a flow graph, identifies the erroneous segments, and further generates the repaired code. All the employed agents utilize Chain-of-Thought (COT) and Tree-of-Thoughts (TOT) prompts. Additionally, we also integrated with the FAISS vector database to retrieve similar previous bugs and their repairs. We demonstrated the efficacy of the proposed framework over 100 programs from several projects, including Ansible, Black, FastAPI, Keras, Luigi, Matplotlib, Pandas, Scrapy, SpaCy, and Tornado in both C and Python programs. Our experiments demonstrate that the FGDM outperforms the extant approaches and yielded reductions with a mean of 24.33 and 8.37 in Levenshtein distance and similarities of 0.951 and 0.974 in cosine similarity for Python and C, respectively.

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

↑