NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Dynamically Structured Diffusion Language Model Decoding via Bayesian Inference

Bian Sun, Kevin Zhai, Mubarak Shah, Zhenyi WangNeurIPS 2026

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).

Overview of the DyStruct decoding pipeline

Using these diagnostic signals, DyStruct performs four steps at each expansion stage:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Table 1: Dynamic structured decoding outperforms baselines. DAEDAL serves as a heuristic length- adjustment decoding baseline. Across these settings, we keep all shared decoding and evaluation parameters identical wherever applicable, so that performance differences primarily reflect the effect of the method-specific decoding mechanisms. Besides, to ensure a fair computational comparison, all models utilize a base budget of 256 unmasking iterations and a maximum generation limit of 256 tokens. DyStruct dynamically scales this base iteration budget across adaptively sized blocks based on block instability. Numbers in parentheses indicate default few-shot examples. Values in gray are standard errors (SE) from lm-eval [Gao et al., 2023].
  • 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.
Figure 2: Inference efficiency comparison. The pro- posed DyStruct achieves the lowest inference time across different backbone models on the GSM8K dataset. Time is reported in seconds per iteration (s/it).

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

BibTeX
@inproceedings{sun2026dynamically,
  author = {Bian Sun and Kevin Zhai and Mubarak Shah and Zhenyi Wang},
  title = {{Dynamically Structured Diffusion Language Model Decoding via Bayesian Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Z6jLmoD11G},
}
Figure