ChatPaper.aiChatPaper

QiMeng-PRepair: 編集を考慮した報酬最適化による高精度コード修復

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

April 7, 2026
著者: Changxin Ke, Rui Zhang, Jiaming Guo, Yuanbo Wen, Li Ding, Shuo Wang, Xuyuan Zhu, Xiong Peng, Di Huang, Zidong Du, Xing Hu, Qi Guo, Yunji Chen
cs.AI

要旨

大規模言語モデル(LLM)は強力なプログラム修正性能を達成するが、過剰編集(正しいコードを上書きしバグ位置特定を妨げる過度な修正)が生じやすい問題を抱える。本研究ではその影響を体系的に定量化し、バグ部分のみを修正しながら正しいコードの再利用を最大化する「精密修正」タスクを提案する。この知見に基づき、過剰編集を軽減し修正精度を向上させるフレームワークPRepairを開発した。PRepairは2つの構成要素を持つ:制御されたバグ注入とmin-maxサンプリングにより多様なバグ付きプログラムを生成するSelf-Breaking、および編集量を考慮した報酬を用いて最小限かつ正確な編集を促進するEdit-Aware Group Relative Policy Optimization(EA-GRPO)でモデルを訓練するSelf-Repairingである。実験結果では、修正正確性と編集範囲を統合的に評価する指標fix_1@1においてPRepairが最大31.4%の修正精度向上を達成し、推測的編集と組み合わせることでデコーディング処理量を大幅に増加させることを示し、精密かつ実用的なコード修正の可能性を実証した。
English
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 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.
PDF31April 9, 2026