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

DevFeed: [When Models Edit Too Much: On the Fidelity of Minimal Code Edits](<https://devfeed.tech/articles/when-models-edit-too-much-on-the-fidelity-of-minimal-code-edits-93688.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2609.04061>)

Author: Tongyao Zhu, Wei Hern Lim, Min-Yen Kan

Published: 2026-10-21T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Code quality](<https://devfeed.tech/topics/code-quality.md>), [post-training](<https://devfeed.tech/topics/post-training.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>), [machine learning overfitting](<https://devfeed.tech/topics/machine-learning-overfitting.md>)

Tags: [ast](<https://devfeed.tech/tags/ast.md>), [code](<https://devfeed.tech/tags/code.md>), [cognitive-complexity](<https://devfeed.tech/tags/cognitive-complexity.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [gpt-5-5](<https://devfeed.tech/tags/gpt-5-5.md>), [large-language-models-llms](<https://devfeed.tech/tags/large-language-models-llms.md>), [learning](<https://devfeed.tech/tags/learning.md>), [levenshtein-distance](<https://devfeed.tech/tags/levenshtein-distance.md>), [patch](<https://devfeed.tech/tags/patch.md>), [post-training](<https://devfeed.tech/tags/post-training.md>), [reinforcement-learning](<https://devfeed.tech/tags/reinforcement-learning.md>), [repair](<https://devfeed.tech/tags/repair.md>)

## AI overview

The study measures code-repair over-editing using 400 BigCodeBench problems with controlled AST corruptions and known minimal patches. It reports that strong models can pass tests while making unnecessarily large edits and increasing cognitive complexity. A preservation instruction reduced average excess Levenshtein distance from 0.195 to 0.131, cut added cognitive complexity by 26.6%, and raised Pass@1 by 2.3 points; the gains did not simply result from larger models or reasoning budgets. In post-training, supervised fine-tuning overfit to familiar corruption patterns, while reinforcement learning offered the strongest reported trade-off between out-of-domain edit fidelity and performance retention.

## Source excerpt

arXiv:2609.04061v2 Announce Type: replace 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.