Search papers, labs, and topics across Lattice.
The authors investigate "over-editing"—the widespread tendency of LLMs to rewrite functional code far beyond what is needed to patch a bug—by evaluating frontier models on 400 BigCodeBench problems injected with controlled AST-level corruptions. While production code maintenance requires minimal, reviewable diffs, the study finds that high Pass@1 routinely coexists with bloated patches and elevated cognitive complexity, a failure mode that neither model scale nor extended reasoning budgets resolve. Notably, targeted preservation prompting curbs excess Levenshtein distance by 33% while boosting Pass@1 by 2.3 points, and post-training via reinforcement learning successfully generalizes edit fidelity to out-of-domain bugs where supervised fine-tuning overfits.
High Pass@1 masks a critical failure mode in frontier code models: models routinely ship bloated, unreviewable diffs for trivial bugs, an issue that scaling cannot solve but RL post-training can directly optimize.
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.