arXiv Computation and Language

CROCODIL: Cross-Model Code Editing with LLMs

CROCODIL is a post‑training framework designed to improve cross‑model code editing with large language models (LLMs). It addresses the problem that different LLMs, trained on distinct datasets, often make excessive edits when applied to code generated by another model. By combining a similarity reward that discourages large changes with an execution reward that ensures build and test success, CROCODIL encourages smaller, functionally correct edits.

arXiv AI
Sep 4

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

The paper investigates the problem of over‑editing by large language models when repairing code, showing that even state‑of‑the‑art models like GPT‑5.5 frequently rewrite more code than necessary. Using a benchmark of 400 BigCodeBench problems with controlled AST corruptions, the authors quantify excess edits and demonstrate that a simple preservation instruction can reduce unnecessary changes and improve pass rates. They further explore training strategies, finding that reinforcement learning yields the best balance between edit fidelity and performance retention, highlighting edit fidelity as a distinct, measurable dimension of code‑repair quality.

By Tongyao Zhu, Wei Hern Lim, Min-Yen Kan
arXiv AI
Sep 10

Diffs vs. Whole Files: An Empirical Comparison of Iterative Edit-Based and Direct Generation for Flutter/Dart Code Models

The paper compares two output regimes for code-editing language models: direct generation, where the model outputs the entire modified file, and iterative diff-based generation, where the model emits a sequence of localized edits. Experiments on Flutter/Dart tasks show that direct generation consistently outperforms diff-based generation across metrics such as compilation success, token efficiency, and quality judgments. However, diff-based generation can be competitive for short, spatially localized edits, particularly in refactoring and error-handling tasks with few edit steps.

By Andrej Andrejev
arXiv AI
Oct 27

Evaluating Harmful Memorization in LLM Code Generation

The paper introduces the Harmful Memorization Index (HMI) to measure when large language models (LLMs) fail to adapt to small semantic changes in coding tasks, producing code that is superficially similar to the original solution. It proposes an automated code‑rewriting pipeline that generates semantically different variants of tasks by altering core logic elements, and uses HMI to combine similarity metrics with performance degradation. Experiments on MBPP+ and BigCodeBench show that HMI does not simply grow with model size, is higher for certain logic‑edit types, and that supervised fine‑tuning can increase HMI while PPO offers a better accuracy–HMI trade‑off.

By Lizhe Zhang, Wentao Chen, Li Zhong, Letian Peng, Zilong Wang, Jingbo Shang
arXiv AI
4d ago

How Do Developers Edit AI-Generated Code, and How Well Do LLMs Infer Their Edits? Insights from 53.6K Developer Edits

The paper introduces DECODE, a dataset of 53.6K real‑world in‑IDE edits of AI‑generated code from over 1,000 developers, and uses it to study when, why, and how developers modify such code. Findings show developers spend little effort editing and often abandon AI outputs, highlighting the need for LLMs to infer intent from edits. Experiments reveal that while frontier models can generate edits that align with developer intent, they tend to over‑edit and revert changes; fine‑tuning improves performance but does not fully close the gap.

By Jenny T. Liang, Mihika Bairathi, Wayne Chi, Ameet Talwalkar, Nishant Subramani, Valerie Chen
Hugging Face Trending Papers
Sep 3

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

The paper investigates the problem of over‑editing by large language models (LLMs) when repairing code, showing that even state‑of‑the‑art models like GPT‑5.5 often rewrite more code than necessary. Using a benchmark of 400 BigCodeBench problems with controlled AST‑level corruptions, the authors quantify over‑editing and demonstrate that a simple preservation instruction can significantly reduce excess edits and cognitive complexity while improving Pass@1. They further explore post‑training strategies, finding that reinforcement learning yields the best balance between edit fidelity and performance retention, thereby establishing edit fidelity as a distinct, measurable dimension of code‑repair quality.

arXiv AI
Oct 1

How Should Diffusion Language Models Edit Code?

arXiv:2609.38257v1 Announce Type: cross Abstract: Code editing requires a model to decide where to make changes, generate the new content, and preserve everything else. We study how masked diffusion...

By Xijia Tao, Ziru Liu, Shansan Gong, Jiacheng Ye, Kecheng Chen, Zirui Wu, Lin Zheng, Xinyu Fu, Rui Liu, Lingpeng Kong
arXiv AI
Sep 30

Generalizable Lifelong Model Editing via Preference Optimization

The paper introduces GLIME, a lifelong model editing framework that integrates knowledge editing with preference optimization to handle continual updates in large language models. GLIME employs replay-based editing and a gradient constraint to prevent overfitting to target prompts and preserve previously edited knowledge. Experiments demonstrate that GLIME enhances knowledge generalization while maintaining editing performance and overall model capabilities.

By Dahyun Jung, Suhyune Son, Heuiseok Lim
arXiv AI
Oct 15

Diff Diffusion: Predicting Edit Paths with Diffusion Models for Efficient Code Editing

Diff Diffusion is a diffusion-inspired large language model framework designed for efficient code editing. It predicts edit paths from an original snippet to its revised form by representing denoising as structured edit operations, and uses multi-stage training and efficient parallel decoding to focus computation on changed regions. The approach matches or outperforms autoregressive baselines while achieving up to 2.78× faster inference and a 39.0% reduction in median model latency in production.

By Xiaolong Xu, Hao Jiang, Bo Jiang, Zhiwen Deng, Ningyuan Sun, Bingzhou Chen, Jin Chen, Chenxing Wei