Diffusion language models (DLMs) generate text by iteratively denoising masked sequences, but standard decoding either fixes the sequence length or relies on ad hoc stopping rules, often leading to unnecessary denoising steps. We recast length selection as a discrete-time survival problem over the end-of-sequence token and propose a plug-in, training-free length predictor that can be added to any existing DLM. Across reasoning and code-generation benchmarks, survival-guided length decoding speeds up inference by up to 7 times while preserving task accuracy. We further find that predicted lengths vary widely even within the same dataset, making model performance sensitive to the chosen length.
Figures & tables
Task
LLaDA
Dream
w/o
w/
w/o
w/
BBH
73
14 ( 5.2× )
56.3
10.5 ( 5.4× )
GSM8K
91
16 ( 5.2× )
81.4
12.3 ( 6.6× )
MATH
76
23 ( 3.3× )
64.5
16.1 ( 4.0× )
HumEval
54
9 ( 6.0× )
53.0
16.6 ( 3.2× )
MBPP
80
26 ( 3.1× )
64.8
16.6 ( 3.9× )
Table 1: Decoding speed (seconds per sample) for baseline ( w/o ) vs. length prediction ( w/ ). Parentheses report speedup relative to the baseline.
Task
LLaDA
Dream
w/o
w/
w/o
w/
BBH
49.5±0.6
51.8±0.6
63.7±0.5
63.8±0.5
GSM8K
69.9±1.3
70.0±1.3
74.5±1.2
74.6±1.2
MATH
31.6±0.6
31.0±0.6
39.6±0.7
39.5±0.7
HumEval
32.3±3.7
33.5±3.7
58.0±3.7
59.0±3.7
MBPP
40.0±2.0
40.2±2.1
58.0±2.0
58.0±2.0
Table 2: Task performance and standard deviation for baseline ( w/o ) vs. length prediction ( w/ ).
Task
LLaDA
Dream
Lˉ
Δ
Lˉ
Δ
BBH
537±204
−3.2±0.7
482±176
−2.7±0.6
GSM8K
278±29
−2.8±1.8
270±52
−2.6±1.8
MATH
498±64
−0.6±0.8
390±62
−0.7±0.9
HumEval
382±57
−1.8±5.2
396±107
−2.3±5.2
MBPP
495±44
0.0±3.0
378±95
−2.0±3.0
Table 3: We report the per-task mean predicted length ( Lˉ ) along with its standard deviation, as well as the performance change ( Δ ) and its standard deviation when using Lˉ as a fixed horizon, compared to our per-sample survival-guided length selection.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
x(0)=[x1:P,[MASK],…,[MASK]]
Appendix
Algorithm 1 Survival-guided length prediction for diffusion LMs
Task
w/o
DAEDAL
Ours
LLaDA (Instruct)
GSM8K
89 (1.0 × )
28 (3.2 × )
14 (6.4 × )
MATH
75 (1.0 × )
41 (1.8 × )
20 (3.8 × )
HumanEval
53 (1.0 × )
22 (2.4 × )
8 (6.6 × )
MBPP
78 (1.0 × )
68 (1.1 × )
23 (3.4 × )
Dream (Instruct)
Appendix
Table 4: Decoding speed (seconds per sample) on instruction-tuned models for DAEDAL and our length prediction method. Parentheses report speedup relative to the baseline decoder without (w/o) length prediction.
Task
w/o
DAEDAL
Ours
LLaDA (Instruct)
GSM8K
78.6 ± 1.4
79.2 ± 1.3
79.5 ± 1.5
MATH
26.6 ± 0.7
26.9 ± 0.8
27.1 ± 0.7
HumanEval
47.6 ± 3.6
48.3 ± 3.5
48.2 ± 3.7
MBPP
34.2 ± 2.1
34.8 ± 2.2
35.5 ± 2.0
Dream (Instruct)
Appendix
Table 5: Task performance on instruction-tuned models of baseline without length prediction compared with both DAEDAL and our survival-guided length selection method.
Task
Step 2
Step 5
Step 7
Step 10
BBH
0.5±2.3
8.2±7.6
7.2±8.6
8.4±9.5
GSM8K
3.8±4.2
4.1±5.6
4.2±5.8
4.2±6.3
MATH
−1.9±6.3
7.0±6.7
7.4±7.8
8.0±9.3
HumanEval
2.7±3.1
4.5±8.3
9.4±7.9
6.9±7.9
MBPP
−0.8±1.2
4.0±6.2
8.2±8.1
8.5±9.2
Appendix
Table 6: Absolute change in predicted length δL^(s)=L^(s)−L^(0) when the estimator is recomputed from later denoising steps for LLaDA.
Diffusion language model decoding generates text through iterative parallel refinement, balancing fewer denoising steps with accuracy, coherence, and control.
Unlike autoregressive language models, which terminate variable-length generation upon predicting an End-of-Sequence (EoS) token, Diffusion Language Models (DLMs) operate over a fixed maximum-length context window for a predetermined number of denoising steps. However, this process is independent of the required response length, resulting in computational waste for the majority of short responses common in reasoning and chat tasks. To address this problem, we conjecture that the latent prompt representation contains sufficient information to estimate the required output length. We provide empirical evidence for this phenomenon and propose a zero-shot mechanism to dynamically crop the context window before generation begins, leading to fewer diffusion steps and substantial computational savings. We evaluate our approach on four benchmarks with diverse tasks -- GSM8K (reasoning), HumanEval (code generation), IfEval (instruction following), and LongFormQA (question answering) -- revealing massive efficiency gains at minimal performance impact. We report significant reductions in FLOPs across all tasks, with no statistically significant performance degradation, and significant performance improvements in 2 out of 4 tasks.
Vittorio Rossi, Giacomo Cirò, Davide Beltrame +3
Department of Computing Sciences, Bocconi University, Milan, Italy.
Diffusion language models (DLMs) can accelerate generation by predicting multiple tokens in parallel, but there is a mismatch between how these tokens are predicted and how they ultimately contribute to generation. Parallel predictions can hardly condition on the tokens selected earlier within the same block, even though their validity depends on this realized prefix. Under the popular proposal-verification decoding, this mismatch makes errors highly asymmetric: an early rejection prevents all subsequent proposals from contributing decoding progress. We introduce BRISK-DLM, a framework that addresses both mismatches by optimizing proposal learning and selection for verified progress. BRISK-DLM trains on self-generated sequences, using risk-reward weighting to dynamically prioritize positions by their impact on verified progress and decoding cost. During inference, a lightweight prefix-conditioned corrector reranks existing candidates using previously selected tokens and preferences distilled from the model's own verifier. The corrector reuses the backbone's parallel representations and requires no additional backbone evaluation, while fused execution keeps its overhead small. BRISK-DLM improves end-to-end throughput by up to 37.4% while preserving task quality, establishing a new quality-throughput frontier for DLM generation.
Masked diffusion language models predict tokens from a partially observed response canvas, enabling bidirectional conditioning and parallel token refinement. Yet standard masked-diffusion decoders use a rigid inference interface: the number of masked positions allocated to the answer is fixed before generation begins. Choosing this length is difficult. A short canvas can truncate reasoning or code, while a long canvas wastes computation and can perturb denoising. We introduce CARVE (Counterfactual-Aware Reveal with Verified Expansion), a training-free variable-length algorithm for masked diffusion LMs. Starting from a shorter canvas, CARVE can grow the response during decoding by inserting additional [MASK] positions. Rather than keeping every insertion, CARVE tests a candidate expanded canvas and asks a counterfactual question: would the model make similar predictions for the unresolved positions in the original canvas if the extra masked space were present? The inserted masks are kept only when they induce low Jensen-Shannon (JS) divergence on aligned unresolved positions. This makes length growth a verified stability decision rather than a pure confidence heuristic. CARVE applies without retraining to both full-canvas and blockwise diffusion decoders. Across code generation and mathematical reasoning benchmarks, CARVE consistently improves average performance over fixed-length baselines across all evaluated model families. Crucially, CARVE achieves these accuracy gains while reducing inference cost, reaching half the FLOPs of fixed-length decoding in some settings.