QiMeng-PRepair: Precise Code Repair via Edit-Aware Reward Optimization

📅 2026-04-07
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the tendency of large language models to over-edit correct code during program repair, which often degrades repair accuracy. To mitigate this issue, the authors propose a “precise repair” task that emphasizes maximal reuse of correct code while modifying only the erroneous parts, and introduce the PRepair framework to realize this objective. The approach innovatively integrates an edit-aware reward mechanism and a precise repair paradigm, combining controlled defect injection, min-max sampling, edit-aware grouped relative policy optimization (EA-GRPO), and speculative editing. A two-stage training strategy—Self-Breaking followed by Self-Repairing—further enhances precision. Experimental results demonstrate that the method achieves up to a 31.4% improvement on the fix₁@1 metric while significantly increasing decoding throughput, confirming its efficiency and practicality.
📝 Abstract
Large Language Models (LLMs) achieve strong program repair performance but often suffer from over-editing, where excessive modifications overwrite correct code and hinder bug localization. We systematically quantify its impact and introduce precise repair task, which maximizes reuse of correct code while fixing only buggy parts. Building on this insight, we propose PRepair, a framework that mitigates over-editing and improves repair accuracy. PRepair has two components: Self-Breaking, which generates diverse buggy programs via controlled bug injection and min-max sampling, and Self-Repairing, which trains models with Edit-Aware Group Relative Policy Optimization (EA-GRPO) using an edit-aware reward to encourage minimal yet correct edits. Experiments show that PRepair improves repair precision by up to 31.4% under $\mathrm{fix}_1@1$, a metric that jointly considers repair correctness and extent, and significantly increases decoding throughput when combined with speculative editing, demonstrating its potential for precise and practical code repair.
Problem

Research questions and friction points this paper is trying to address.

over-editing
program repair
code reuse
bug localization
repair precision
Innovation

Methods, ideas, or system contributions that make the work stand out.

Edit-Aware Reward
Precise Code Repair
Over-editing Mitigation
EA-GRPO
Self-Breaking
🔎 Similar Papers
No similar papers found.
C
Changxin Ke
State Key Lab of Processors, Institute of Computing Technology, CAS; University of Chinese Academy of Sciences
Rui Zhang
Rui Zhang
Institute of Computing Technology, Chinese Academy of Sciences (ICT-CAS)
Computer VisionDeep Learning
Jiaming Guo
Jiaming Guo
Institute of Computing Technology, Chinese Academy of Sciences
Artificial intelligenceReinforcement Learning
Yuanbo Wen
Yuanbo Wen
Institute of Computing Technology, Chinese Academy of Sciences
Machine Learning System
L
Li Ding
State Key Lab of Processors, Institute of Computing Technology, CAS; Institute of Microelectronics, CAS
Shuo Wang
Shuo Wang
Institute of Automation, Chinese Academy of Sciences
RoboticsIntelligent RobotBiomimetic RobotMulti-Robot Systems
X
Xuyuan Zhu
University of Chinese Academy of Sciences
X
Xiong Peng
University of Chinese Academy of Sciences
Di Huang
Di Huang
ICT, CAS
Z
Zidong Du
State Key Lab of Processors, Institute of Computing Technology, CAS
Xing Hu
Xing Hu
Institute of Computing Technology, Chinese Academy of Sciences
micro-architectureDeep learning architecture
Q
Qi Guo
State Key Lab of Processors, Institute of Computing Technology, CAS
Yunji Chen
Yunji Chen
Institute of Computing Technology, Chinese Academy of Sciences
processor architecturemicroarchitecturemachine learning