arXiv AI By Andrej Andrejev

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

Read the original on arXiv AI →

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.

Machine-generated by The Flow from the publisher's headline and feed description — not written or checked by a human. The full article lives at arXiv AI.

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
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
3d 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 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