arXiv:2505.07372cs.SEcs.AI2025-05

用大模型自动生成并筛选代码修复数据,显著提升自动修 Bug 效果。

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

  • 大模型生成3万组带缺陷与修复的代码对,覆盖12语言13类漏洞。
  • 经多维度评估筛选后,修复准确率较基线提升47%(Top@1)。
  • 无需复杂推理,即可超越现有系统,适合代码维护研究者。

本文提出一种新型自动化程序修复(APR)方法,利用大语言模型(LLM)生成合成训练数据以缓解高质量数据稀缺问题。通过两阶段流程:首先在12种编程语言、13类漏洞中生成约3万对有缺陷与修复的代码;随后基于正确性、代码质量、安全性、性能和完整性五项标准进行跨模型评估。在VulRepair测试集上的实验显示,经质量过滤的合成数据集在完美预测率上取得显著提升,Top@1达17.18%,相比基线11.68%提高47%;Top@5达23.00%,较基线18.88%提升22%。统计检验(ANOVA与Tukey检验)确认结果显著。最优配置虽采用计算量更低的解码策略,仍优于现有系统。该方法构建了大模型自我生成与评估训练数据的自循环范式,为解决软件工程中数据匮乏问题提供新路径。

原文摘要 · Abstract (English)

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.

程序修复大模型合成数据自举

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。