Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Model
Chenghao Fan, Wen Heng, Bo Li, Sichen Liu, Yuxuan Song, Jing Su, Xiaoye Qu, Kai Shen, Wei Wei
TL;DR
This work introduces Stable-DiffCoder, a diffusion-based block code model that reuses the Seed-Coder pipeline to achieve superior performance under the same data and compute budgets. By coupling block diffusion continual pretraining with a tailored warmup and block-wise clipped noise scheduling, the approach learns token reasoning efficiently and demonstrates strong results across code generation, reasoning, and editing benchmarks, often surpassing ~8B autoregressive baselines. The study provides a principled analysis of training-inference alignment, curriculum design, and stability improvements, showing that diffusion-based training can yield quality gains beyond autoregressive training alone and can aid low-resource languages through data augmentation. Overall, the results establish diffusion-based code modeling as a viable and competitive alternative to AR training for both base and instruction-tuned models, with practical implications for faster generation and broader language support.
Abstract
Diffusion-based language models (DLLMs) offer non-sequential, block-wise generation and richer data reuse compared to autoregressive (AR) models, but existing code DLLMs still lag behind strong AR baselines under comparable budgets. We revisit this setting in a controlled study and introduce Stable-DiffCoder, a block diffusion code model that reuses the Seed-Coder architecture, data, and training pipeline. To enable efficient knowledge learning and stable training, we incorporate a block diffusion continual pretraining (CPT) stage enhanced by a tailored warmup and block-wise clipped noise schedule. Under the same data and architecture, Stable-DiffCoder overall outperforms its AR counterpart on a broad suite of code benchmarks. Moreover, relying only on the CPT and supervised fine-tuning stages, Stable-DiffCoder achieves stronger performance than a wide range of \~8B ARs and DLLMs, demonstrating that diffusion-based training can improve code modeling quality beyond AR training alone. Moreover, diffusion-based any-order modeling improves structured code modeling for editing and reasoning, and through data augmentation, benefits low-resource coding languages.
