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

自bootstrap自动程序修复:利用LLMs生成和评估合成训练数据以修复bug

Self-Bootstrapping Automated Program Repair: Using LLMs to Generate and Evaluate Synthetic Training Data for Bug Repair

Departamento de Ciencias de la Computación, Universidad de Alcalá(阿尔卡拉大学计算机科学系)

David de-Fitero-Dominguez, Antonio Garcia-Cabot, Eva Garcia-Lopez

AI总结:

本文提出一种利用LLMs生成合成数据提升自动程序修复的方法,通过生成和评估代码bug与修复代码的配对示例,提升修复准确率,实验显示在VulRepair数据集上Top@1和Top@5表现显著提升。

摘要:

本文提出了一种通过合成数据生成提升自动程序修复(APR)的新方法。当前APR系统受限于高质量训练数据不足,特别是涵盖多种编程语言和bug类型的数据。本文提出两阶段方法:生成合成样本并严格评估质量。使用多个最先进的LLMs生成约30,000个包含12种编程语言和13种bug类别的代码bug与修复代码配对示例。随后,这些样本通过五个标准进行跨模型评估:正确性、代码质量、安全性、性能和完整性。在VulRepair测试集上的实验显示,质量过滤后的合成数据集在Perfect Prediction率上取得统计显著提升,Top@1和Top@5分别达到17.18%和23.00%,相比基线的11.68%和18.88%提升47%和22%。该方法通过ANOVA和Tukey's Honest Significant Difference分析验证。此外,最佳配置在使用更少计算资源的解码策略下仍超越现有系统。本研究建立了一种自bootstrap范式,LLMs生成并评估自身训练数据,为解决类似软件工程任务的数据稀缺问题和开发稳健、适应性强的自动代码维护工具提供了新方向。

英文摘要:

This paper presents a novel methodology for enhancing Automated Program Repair (APR) through synthetic data generation utilizing Large Language Models (LLMs). Current APR systems are constrained by the limited availability of high-quality training data encompassing diverse bug types across multiple programming languages. The proposed approach addresses this limitation through a two-phase process: a synthetic sample generation followed by a rigorous quality assessment. Multiple state-of-the-art LLMs were employed to generate approximately 30,000 paired examples of buggy and fixed code across 12 programming languages and 13 bug categories. Subsequently, these samples underwent cross-model evaluation against five criteria: correctness, code quality, security, performance, and completeness. Experimental evaluation on the VulRepair test set dataset showed statistically significant improvements in Perfect Prediction rates, with the quality-filtered synthetic dataset achieving 17.18% (Top@1) and 23.00% (Top@5) compared to the baseline's 11.68% and 18.88% respectively, representing a 47% relative improvement in Top@1 and 22% in Top@5. The methodology was validated through rigorous statistical testing, including ANOVA and post-hoc Tukey's Honest Significant Difference analysis. Furthermore, the best-performing configurations surpassed existing systems despite using a less computationally intensive decoding strategy. This research establishes a self-bootstrapping paradigm in which LLMs generate and evaluate their own training data, suggesting promising directions for addressing data scarcity in similar software engineering tasks and advancing the development of robust, adaptable tools for automated code maintenance.

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

↑