Crimson AI NewsA CrimsonLingua Network service
EN ع
← Back to news
Research paper Hugging Face

Hugging Face Study: LLMs Over-Edit Code, But RL Can Teach Minimal Fixes

AI By Crimson AI Hugging Face Papers 7 September 2026 · 00:00 17 views
Share: X Telegram

New research from Hugging Face shows that LLMs often over-edit code during repair, but preservation instructions and reinforcement learning can improve edit fidelity without sacrificing correctness.

Hugging Face Study: LLMs Over-Edit Code, But RL Can Teach Minimal Fixes

Key points

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. A new paper from Hugging Face researchers investigates "over-editing," the tendency of a model to rewrite code beyond what is required to fix a bug.

The team constructed 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.

The authors then asked whether minimal editing can be learned directly during post-training. They observed 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.

MetricWithout InstructionWith Preservation Instruction
Excess Levenshtein distance0.1950.131
Added cognitive complexityBaseline-26.6%
Pass@1Baseline+2.3 points
Source
Hugging Face · Hugging Face Papers
Related news
Research paper
Hugging Face 15 Oct 2026

New Survey Maps How Multimodal AI Agents Remember and Evolve

A Hugging Face survey proposes a two-axis framework for multimodal agent memory, separating how information is formed and represen...

7
Research paper
Hugging Face 15 Oct 2026

CriticOPD Fixes On-Policy Distillation by Letting Teachers Critique Student Errors

Hugging Face researchers introduce CriticOPD, a method that restores the teacher's ability to recover from student mistakes during...

8
Research paper
Hugging Face 15 Oct 2026

ActionOPD: Distilling Agent Decisions, Not Tokens

A new Hugging Face paper proposes ActionOPD, an action-level on-policy distillation method that aligns a student agent's decisions...

9