cs.SEOct 13, 2026

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

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

Organizations: ByteDance, Shenzhen, China

Abstract

Diffusion large language models (dLLMs) are appealing for code generation because they can update many tokens in parallel, yet many are optimized for sequence synthesis rather than edit prediction. This setting is poorly matched to modern AI-assisted IDEs, where edit prediction must infer the next code change from recent edits, the current file, and cursor-local context. Such changes are usually sparse and preserve most source tokens, so regenerating a full code segment wastes computation. We propose Diff Diffusion, a diffusion-inspired LLM framework for code editing that predicts edit paths from an original snippet to its revised form. Diff Diffusion represents denoising as structured edit operations, and combines this formulation with multi-stage training and efficient parallel decoding. By focusing computation on changed regions, Diff Diffusion supports accurate low-latency edits and multi-position parallel modification. Across public edit-completion benchmarks, edit-prediction evaluations, and online validation, Diff Diffusion matches or leads autoregressive baselines while delivering 2.78 times faster inference on public edit-completion benchmarks and a 39.0% P50 model-latency reduction in production. This work provides a new modeling perspective for AI applications that require high accuracy and low latency.

Figures & tables

Appendix figures & tables2 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. To Diff or Not to Diff? Structure-Aware and Adaptive Output Formats for Efficient LLM-based Code Editing

    Apr 30, 2026Wei Cheng, Yongchang Cao, Chen Shen +4Code GenerationLLM Inference Acceleration

  2. How Should Diffusion Language Models Edit Code?

    Sep 29, 2026Xijia Tao, Ziru Liu, Shansan Gong +7Masked Diffusion ModelsLanguage Model Editing

  3. Learning from 53.6K Real-World Developer Edits of AI-Generated Code

    Jul 27, 2026Jenny T. Liang, Mihika Bairathi, Wayne Chi +3Code Generation EvaluationCode Language Models