arXiv(opens in a new tab)cs.LGSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.04531

Distilled Continuous Diffusion Language Models Can Write Code in Few Steps---or One

Fred Zhangzhi Peng, Kaiwen Zheng, Anru R. Zhang

ABSTRACT

Language generation is almost universally treated as a sequential process: autoregressive models emit one token at a time, while diffusion language models replace token-level seriality with a long trajectory of iterative refinement. In this work, we introduce PlaidQ, a 0.7B continuous diffusion language model for code generation, and show that its trajectory can be aggressively distilled into only a few denoising steps—or even one, enabling efficient code generation. PlaidQ repurposes a pretrained autoregressive model as a bidirectional denoiser over continuous token embeddings. We distill PlaidQ with distribution matching for few-step generation and paired-trajectory supervision for one-step generation. At matched model scale, PlaidQ is competitive with discrete diffusion language models on code generation. Distillation then shifts the quality-compute frontier: a 16-step student reaches 31.78 and 40.49 pass@10 on HumanEval and MBPP+, surpassing the same PlaidQ teacher sampled for 512 steps. At the extreme, paired-trajectory distillation achieves 7.07 pass@1 on HumanEval with a single denoising step, producing functionally correct programs. Together, these results establish continuous diffusion as a viable path to few-step and one-step code generation. Broadly, continuous diffusion is not merely another representation for language: it provides an interface through which language models can inherit the acceleration and distillation machinery of continuous diffusion modeling. Training and inference code and model checkpoints are available at https://github.com/pengzhangzhi/plaidq.

Figure

Figure 1: A single denoising step produces executable programs. Starting from Gaussian noise, PlaidQ-D1 generates the completion in one denoising step followed by one final decoding pass. Gray denotes the prompt, while blue denotes the generated executable completion. These selected outputs pass their benchmark tests, showing that one-step continuous diffusion can already recover compact, functionally correct programs.

*Corresponding author: zhangzhi.peng@duke.edu

1 INTRODUCTION

The growing deployment of large language models has made inference efficiency a central concern, motivating work on efficient serving, quantization, and speculative decoding (Kwon et al., 2023; Frantar et al., 2022; Leviathan et al., 2023). Autoregressive models generate each token conditioned on all preceding tokens, creating a dependency chain whose depth grows with the output length. These systems techniques can reduce the cost of individual decoding operations or amortize target-model evaluations, but they do not change this next-token factorization. Generation therefore remains fundamentally sequential. A more direct route to faster sampling would reduce the number of sequential generation steps themselves, rather than only making each step cheaper.

Non-autoregressive language generation offers a different route. Rather than traversing a sequence from left to right, masked refinement, discrete diffusion, and discrete flow models maintain a partially corrupted sequence and update many positions simultaneously (Sahoo et al., 2024; Lou et al., 2024; Gat et al., 2024; Shi et al., 2024). Recent work has improved their training objectives, transition parameterizations, scaling behavior, and initialization from autoregressive models, substantially narrowing the gap with autoregressive language modeling (Lou et al., 2024; Sahoo et al., 2024; Gat et al., 2024; Gong et al., 2025a; Nie et al., 2025). These results establish diffusion language models as a credible alternative: generation can exploit bidirectional context and revise many tokens within each denoising step.

This parallelism, however, does not remove the need to coordinate decisions across the sequence. Within a typical reverse step, multiple categorical predictions are independently sampled from the same current context. Models therefore rely on iterative unmasking, denoising, or correction to propagate information and resolve inconsistencies across positions (Sahoo et al., 2024; Zheng et al., 2025b; Nie et al., 2025). Reducing the number of steps removes precisely these opportunities for coordination, making coherent few-step generation especially difficult. The sequential bottleneck is therefore shifted from token positions to the denoising trajectory rather than eliminated.

A parallel line of work models language in continuous token, simplex, bitstream, or latent spaces using diffusion, flow matching, and normalizing flows. Recent work approaches or matches discrete diffusion on text-generation benchmarks (Gulrajani & Hashimoto, 2023; Jo & Hwang, 2025; Zhang et al., 2025a; Yang et al., 2026; Chen et al., 2026; Shen et al., 2026; Hu et al., 2026; Batzolis et al., 2026; Guo et al., 2026; Liang et al., 2026a; Chemseddine et al., 2026; Deschenaux & Gulcehre, 2026), while other methods compress continuous generation to one or a few steps (Chen et al., 2025; Lee et al., 2026; Lemercier et al., 2026; Davis et al., 2026; Agarwal et al., 2026; Yoo et al., 2026; Peng et al., 2026a). Most results, however, are reported on unconditional text-generation benchmarks using generative perplexity, a proxy that can favor degenerate outputs such as low-entropy repetition without establishing sequence-level correctness (Zhang et al., 2026a). We ask:

Can continuous diffusion enable code generation in only a few steps—or even one?

Present work. We introduce PlaidQ, a 0.7B continuous diffusion language model that repurposes a pretrained autoregressive model as a bidirectional denoiser over continuous token embeddings (Peng et al., 2026b). Rather than generating the next token, PlaidQ predicts every completion position in parallel. Autoregressive initialization provides a strong linguistic starting point and substantially improves diffusion training compared with training from scratch. Scaling this formulation to a 152k-token vocabulary creates a large categorical-reconstruction memory bottleneck; we address it with SWVR, an exact streamed kernel that avoids materializing the full vocabulary probability tensor. We further adopt a hybrid Muon–AdamW optimizer to improve convergence (Liu et al., 2025; Loshchilov & Hutter, 2019). Finally, we treat fast generation as learned trajectory compression: distribution matching distills the teacher into PlaidQ-D4, PlaidQ-D8, and PlaidQ-D16 (Yin et al., 2024b;a), while paired trajectory supervision produces PlaidQ-D1 for the extreme one-step regime.

Results. Distillation fundamentally changes the low-step scaling regime. At 16 steps, PlaidQ-D16 reaches 31.78 and 40.49 pass@10 on HumanEval and MBPP+, surpassing the best teacher PlaidQ results obtained with 128–512 steps—28.57 and 35.21—with at least 8× fewer denoising steps. At eight steps, it retains approximately 90% and 98% of the corresponding 128-step performance. At four steps, distillation raises pass@10 from 7.90 to 15.85 on HumanEval and from 7.91 to 30.94 on MBPP+. Most strikingly, paired trajectory distillation raises one-step HumanEval pass@1 from

Figure

Figure 2: PlaidQ generates code through a continuous denoising trajectory. The prompt remains fixed while PlaidQ refines every completion embedding in parallel. At each step, vocabulary probabilities are converted into a clean-embedding prediction through the token codebook. Tokens are decoded only once, after the final denoising step.

0.09 to 7.07 and reaches 8.53 pass@10. A continuous diffusion language model can therefore be compressed into a single learned denoising step while retaining measurable functional correctness (Figures 1 and 6).

PlaidQ is also a strong base generator. At 128 steps, classifier-free guidance reaches 39.87 pass@10 on HumanEval and 44.79 on MBPP+, and PlaidQ leads comparable-scale diffusion language models on five of eight completion metrics (Table 1). Although trained only for prefix completion, the same model transfers zero-shot to code infilling, scoring 37.91 on HumanEval-Infill versus 32.5 for Open-dCoder (Table 2). The training components are independently effective: autoregressive initialization and alignment reduce validation NLL from 3.65 to 3.59, SWVR reduces activation memory by 29.6% while matching the dense loss and gradients, and hybrid Muon–AdamW consistently improves validation loss over AdamW alone (Figures 7 to 9).

References (85)