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

PAFT:面向最小编辑程序修复的保留意识微调

PAFT: Preservation Aware Fine-Tuning for Minimal-Edit Program Repair

School of Artificial Intelligence (School of Software), Yanshan University(燕山大学人工智能学院(软件学院));Department of Computer Science, Aalto University(阿尔托大学计算机科学系)

Boyang Yang, Zijian Cai, Shunfu Jin, Haoye Tian

AI总结:

PAFT通过保留意识微调方法,在Defects4J和HumanEval-Java上将pass@1提升65.6%,同时降低平均编辑距离32.6%,实现更小、更局部化的合理补丁。

摘要:

大型语言模型(LLMs)在自动化程序修复中效果显著,但合理的补丁往往重写过多代码,增加审查和维护成本。这种过度编辑常见于大多数bug局部化,而标准监督微调无法提供明确的保留信号。我们提出PAFT,一种面向最小编辑程序修复的保留意识微调方法。PAFT通过对齐错误和修复代码获取token级保留信号,结合全序列掩码和编辑难度课程学习。在Defects4J和HumanEval-Java上,PAFT在标准监督微调(StdFT)基础上将pass@1提升至最高65.6%,同时将平均编辑距离(AED)降低至最高32.6%。在Defects4J使用DeepSeek-Coder-6.7B时,PAFT也优于AdaPatcher,将pass@1从5.9%提升至10.1%,同时将中位数AED从61.0降至42.0。总体而言,PAFT保留稳定上下文,将编辑集中在故障区域,生成更小、更局部化的合理补丁,无需推理时间搜索、重排序或后处理。

英文摘要:

Large language models (LLMs) are effective for automated program repair, but plausible patches that pass the full test suite often rewrite more code than necessary, increasing review and maintenance costs. This over-editing is common because most bugs are localized, while standard supervised fine-tuning provides no explicit signal about which tokens should be preserved and which should be changed. We propose PAFT, a preservation-aware fine-tuning method for minimal-edit program repair. PAFT derives token-level preservation signals by aligning buggy and fixed code, combines them with full-sequence masking, and applies an edit-difficulty curriculum. Across Defects4J and HumanEval-Java, PAFT improves pass@1 by up to 65.6% over standard supervised fine-tuning (StdFT) while reducing average edit distance (AED) by up to 32.6%. On Defects4J with DeepSeek-Coder-6.7B, PAFT also outperforms AdaPatcher, a strong preference-based repair baseline, improving pass@1 from 5.9% to 10.1% while reducing median AED from 61.0 to 42.0. Overall, PAFT preserves stable context and concentrates edits on faulty regions, yielding smaller, more localized, plausible patches without inference-time search, reranking, or post-processing.

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

↑