When Models Edit Too Much: On the Fidelity of Minimal Code Edits

Tongyao Zhu, Wei Hern Lim and Min-Yen Kan at the National University of Singapore define over-editing as a measurable failure of code repair, build a controlled benchmark from 400 BigCodeBench problems, and show that edit fidelity is a separate axis from correctness that post-training can improve.
Ask this paper
Construction of the benchmark: AST-level corruptions are injected into reference solutions so each problem has a known minimal patch, which gives an exact reference for how large the edit should have been.
Over-editing is widespread in frontier models: high Pass@1 coexists with unnecessarily large edits and added cognitive complexity, including in GPT-5.5.
A preservation instruction helps and is nearly free: average excess Levenshtein distance drops from 0.195 to 0.131, added cognitive complexity falls 26.6 percent, and Pass@1 rises 2.3 points.
The gains are not a budget effect: they do not follow from a larger reasoning budget or a larger model, so this is not something scale resolves.
SFT overfits, RL generalizes: supervised fine-tuning latches onto the seen corruption patterns, while reinforcement learning gives the best out-of-domain trade-off between edit fidelity and retained performance.
Abstract
Large language models (LLMs) are increasingly used to edit existing code, but correctness alone is not enough: useful repairs should also be minimal, reviewable, and faithful to the original implementation. We study over-editing, the tendency of a model to rewrite code beyond what is required to fix a bug. We construct an evaluation framework from 400 BigCodeBench problems by injecting controlled AST-level corruptions into reference solutions, giving each repair task a known minimal patch. Across frontier LLMs, over-editing is widespread even among strong models like GPT-5.5: high Pass@1 can coexist with unnecessarily large edits and added cognitive complexity. A preservation instruction substantially reduces this behavior, lowering average excess Levenshtein distance from 0.195 to 0.131, reducing added cognitive complexity by 26.6%, and increasing Pass@1 by 2.3 points. However, these gains do not simply follow from a larger reasoning budget or larger models. We next ask whether minimal editing can be learned directly during post-training. We observe that supervised fine-tuning overfits to seen corruption patterns, whereas reinforcement learning gives the best out-of-domain edit-fidelity and performance-retention trade-off. These results position edit fidelity as a distinct axis of code-repair quality and show that it can be measured and learned.