How Should Diffusion Language Models Edit Code?
On the map: Diffusion models → Discrete and text diffusion
Abstract (arXiv)
Code editing requires a model to decide where to make changes, generate the new content, and preserve everything else. We study how masked diffusion language models divide these responsibilities across four editing interfaces: whole-file rewriting, search-and-replace, locate-then-infill, and token-level editing. Experiments on CanItEdit reveal a composition gap: diffusion models can generate coordinated changes when the correct edit locations are supplied, but much of this capability is lost when those locations must be predicted. Access to the intact original code helps the model fill multiple edit regions, yet does not resolve the difficulty of selecting those regions. By varying the editable regions while holding the generation model and decoding procedure fixed, we identify two distinct requirements for successful editing: covering every required change and placing precise boundaries around it. Missing a required region prevents the corresponding change, while widening regions to ensure coverage can sharply reduce success by requiring unchanged code to be regenerated. A sentence-level Wiki editing probe shows the same qualitative gap between supplied and predicted locations beyond code. These findings show why strong infilling capability alone does not ensure reliable editing: the interface must expose all required changes while limiting regeneration of unchanged code.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Discrete and text diffusion, one of 14 directions in Diffusion models. Builds on 18 of its 20 references that are in the map. First posted on arXiv 29 Sep 2026.
Builds on
18 of 20 references.
Closest ancestors · 11
Same direction, newest first
- 2026Predict, Don't Iterate: Efficient Adaptive-Length Infilling for Diffusion Language Models2 Sep
- 2026Improved Large Language Diffusion Models24 Jun
- 2026DreamOn: Diffusion Language Models For Code Infilling Beyond Fixed-size Canvas1 Feb
- 2025Dream-Coder 7B: An Open Diffusion Language Model for Code1 Sep
- 2025Any-Order Flexible Length Masked Diffusion31 Aug
- 2025Dream 7B: Diffusion Large Language Models21 Aug
- 2025DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation25 Jun
- 2025Large Language Diffusion Models14 Feb
- 2024Simple and Effective Masked Diffusion Language Models11 Jun
- 2024Simplified and Generalized Masked Diffusion for Discrete Data6 Jun
- 2022DiffusER: Discrete Diffusion via Edit-based Reconstruction30 Oct
Other references · 7
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2022Efficient Training of Language Models to Fill in the Middlecited by 255
- 2025Edit Flows: Flow Matching with Edit Operationscited by 55
- 2023Can It Edit? Evaluating the Ability of Large Language Models to Follow Code Editing Instructionscited by 48
- 2025Bridging the Editing Gap in LLMs: FineEdit for Precise and Targeted Text Modificationscited by 21
- 2026Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Modelcited by 13
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Diff Diffusion: Predicting Edit Paths with Diffusion Models for Efficient Code Editing
- 2026When Models Edit Too Much: On the Fidelity of Minimal Code Edits
- 2024The Butterfly Effect of Model Editing: Few Edits Can Trigger Large Language Models Collapse
- 2025How Robust is Model Editing after Fine-Tuning? An Empirical Study on Text-to-Image Diffusion Models
- 2026Targeted Remasking: Replacing Token Editing with Token-to-Mask Refinement in Discrete Diffusion Language Models
- 2026Edit-Based Refinement for Parallel Masked Diffusion Language Models
- 2024Specify and Edit: Overcoming Ambiguity in Text-Based Image Editing
- 2026Knowledge Editing for Masked Diffusion Language Models