TL;DR
Diffusion language models promise fast, parallel text generation, yet they are usually trapped inside a rigid, pre-determined output length—like trying to write an essay when someone has already stapled down the exact number of blank spaces you must fill. DyStruct breaks this constraint without any costly retraining, using Bayesian inference at decoding time to dynamically grow the text window, group tokens into logical blocks, and focus compute where the reasoning is hardest. The result is an off-the-shelf decoding upgrade that makes diffusion language models simultaneously more accurate and nearly twice as fast.
What Problem Does This Paper Address?
Standard autoregressive large language models (LLMs) generate text one token at a time, creating a serious latency bottleneck for long sequences. Diffusion language models (DLMs) flip the script: they start with a canvas of [MASK] tokens and iteratively refine all positions in parallel.
There’s a catch, though. Standard DLMs require you to specify a fixed generation length before decoding begins. Ask a simple question with a large canvas, and you get redundant babble; ask a complex question with a small canvas, and the answer gets cut off.
Recent attempts to allow flexible-length generation in DLMs fall into two camps: methods that require expensive retraining of the underlying model, and training-free methods (like DAEDAL) that expand the sequence using purely local, heuristic confidence rules. Because local heuristics don't organize the overarching structure of newly added tokens, expanding the canvas on the fly often leads to fragmented, incoherent text. The authors ask: Can a frozen DLM dynamically decide how much to grow and how to organize its thoughts in a principled, structure-aware way?
Methods
Instead of relying on ad-hoc heuristics, DyStruct formulates variable-length decoding as a unified Bayesian structural inference problem. Rather than unmasking a single giant block, it iteratively appends smaller windows of [MASK] tokens and runs a quick, temporary diagnostic pass to measure positional "instability" (derived from token entropy, confidence, and hidden-state shifts).
Using these diagnostic signals, DyStruct performs four steps at each expansion stage:
- Adaptive Window Growth: It samples the length of the next
[MASK]window from a Poisson distribution scaled by how stable the previous window was. Smooth sailing means a bigger leap forward; high uncertainty triggers a cautious, smaller window. - CRP-Style Block Partitioning: Not all parts of a sentence crystallize at the same rate. DyStruct divides the new window into contiguous blocks using a Chinese Restaurant Process (CRP) prior—a classic Bayesian nonparametric tool where each token sequentially decides whether to join the current block or start a new one based on local boundary evidence. You don't need to pre-specify how many blocks to use; the data decides.
- Context-Aware Scheduling: Instead of refining left-to-right or all-at-once, blocks are ordered via a Gibbs distribution. Blocks that are stable and "anchored" next to already-decoded text go first, establishing solid ground before tackling uncertain interior blocks—which are also given more refinement steps.
- Edge-Welding: Because blocks are decoded semi-independently, their seams might clash (e.g., awkward phrasing or syntax mismatches). DyStruct performs localized boundary repair—remasking and refining low-confidence tokens right at the block interfaces to "weld" them smoothly together.
Datasets
Because DyStruct is completely training-free, no training datasets are required. The authors evaluate the framework on two frozen DLM backbones (LLaDA-8B-Base and Dream-7B-Base) across five established benchmarks spanning three domains:
- Mathematics: GSM8K and MATH.
- Code Synthesis: HumanEval and MBPP.
- Symbolic & Multi-step Logic: Big-Bench Hard (BBH).
No new benchmarks are introduced.
Key Insights and Ideas
- Compute should follow uncertainty, not sequence length: Standard DLMs spend equal effort refining obvious transition words and gnarly logical operators. By partitioning text into blocks and scaling unmasking iterations to block instability, DyStruct acts like a smart test-taker—breezing past easy phrasing and lingering on complex math or logic.
- Start small to go fast: Even though DyStruct runs extra diagnostic and welding passes, it actually lowers overall wall-clock latency. Why? Starting with a 48-token window and growing progressively means early forward passes operate on much shorter sequences than a rigid 256-token baseline, drastically cutting total FLOPs.
- Independent blocks need "welding": Ablation studies reveal that without local boundary repair ("edge-welding"), HumanEval code accuracy drops by nearly 2 points. In strict domains like code, independently scheduled blocks easily drift out of syntactic alignment unless reconciled at the seams.
- Heuristic expansion can actively hurt: The heuristic baseline (DAEDAL) actually degraded performance on complex tasks like BBH and across the stronger Dream-7B model, underscoring that growing a sequence without structural planning causes errors to cascade.
Key Results
DyStruct consistently outperforms both fixed-length baselines and the training-free flexible-length baseline (DAEDAL) across all five benchmarks on both model backbones.
- Reasoning & Code Gains: On LLaDA-8B-Base, DyStruct boosts multi-step logical reasoning (BBH) by +4.4 points (44.9% $\rightarrow$ 49.3%) and GSM8K from 70.3% to 72.1%. On Dream-7B-Base, it jumps HumanEval pass@1 by +6.8 points over the base model (40.2% $\rightarrow$ 47.0%) and +12.3 points over DAEDAL.
- Nearly 2x Faster Inference: On GSM8K, DyStruct cuts inference time per question from 23.2s down to 13.0s on LLaDA-8B, and from 24.1s down to 13.6s on Dream-7B—beating both standard fixed-length decoding and DAEDAL.
Limitations and Future Work
DyStruct operates purely at inference time on frozen models. While this makes it a convenient plug-and-play upgrade, the underlying DLM was never explicitly trained to expect dynamic windows, CRP block partitions, or edge-welding. The authors note that folding this Bayesian structural inference directly into the training loop could unlock even stronger generation quality in future work.
Summary updated