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

Optimizing Decoding Paths in Masked Diffusion Models by Quantifying Uncertainty

Ziyu Chen, Xinbei Jiang, Peng Sun, Tao Lin · DOI

Abstract

Masked Diffusion Models (MDMs) offer a flexible alternative to traditional autoregressive models by learning to denoise sequences in arbitrary orders. However, their performance is highly sensitive to the specific sequence of unmasking, a challenge known as the "decoding path" problem. We introduce Denoising Entropy, a novel metric to quantify the uncertainty of generative paths. Leveraging this metric, we propose two algorithms: Entropy-based Best-of-N (E-BoN) for post-hoc selection and Entropy-guided Sequential Monte Carlo (E-SMC) for real-time path steering. Our experiments on reasoning and coding tasks demonstrate that minimizing path uncertainty consistently improves model reliability and output quality.

Introduction

Large Language Models (LLMs) typically rely on autoregressive (AR) decoding, generating tokens sequentially from left to right. While effective, this rigid structure limits the model's ability to revise previous tokens or explore non-linear generation paths. Masked Diffusion Models (MDMs) address this by allowing tokens to be unmasked in any order. Despite this theoretical flexibility, MDMs often struggle in practice because the space of possible decoding paths is vast. Current heuristics, such as random unmasking or greedy confidence-based selection, often lead the model into high-uncertainty regions, resulting in hallucinations or incoherent outputs.

Quantifying Path Uncertainty

To navigate the complex decoding space of MDMs, we propose a framework centered on Denoising Entropy. This approach treats the generation process as a trajectory through a state space, where each state represents a partially masked sequence.

Overview of Denoising Entropy metrics ($h_{DE}$ and $H_{DE}$) used to evaluate state and path uncertainty in MDM decoding.

We define two primary metrics:

  1. State Entropy ($h_{DE}$): This measures the average Shannon entropy of the model's predictions for all currently masked positions in a given state. It serves as a local indicator of model "confusion."
  2. Path Entropy ($H_{DE}$): This is the integral or average of State Entropy across the entire generation trajectory. It provides a global assessment of the quality and reliability of a specific decoding path.

Mathematically, State Entropy acts as an upper bound on the joint entropy of the sequence, making it a tractable proxy for generation quality. Empirically, lower Path Entropy correlates strongly with lower perplexity and higher task accuracy.

Entropy-Guided Decoding Strategies

We introduce two methods to utilize Denoising Entropy for improving MDM outputs:

Comparison of standard inference, Entropy-based Best-of-N (E-BoN), and Entropy-guided Sequential Monte Carlo (E-SMC) strategies.

Entropy-based Best-of-N (E-BoN)

E-BoN is a selection-based approach. The model generates $M$ independent candidate paths. Instead of using external reward models or majority voting, we simply select the path with the lowest total Path Entropy ($H_{DE}$). This method is computationally simple and effective for tasks where a final "best" answer is needed.

Entropy-guided Sequential Monte Carlo (E-SMC)

E-SMC provides active guidance during the generation process. The algorithm maintains $M$ parallel "particles" or partial solutions. At predefined intervals, the State Entropy ($h_{DE}$) of each particle is evaluated. Particles in high-uncertainty regions are pruned, while those in low-entropy, promising regions are replicated. This "resampling" mechanism prevents the model from drifting into low-probability regions of the data manifold, effectively steering the generation toward high-quality outcomes.

Experimental Evaluation

We evaluated our methods using state-of-the-art MDMs, including LLaDA-8B and Open-dCoder-0.5B, across several challenging benchmarks:

  • Reasoning: GSM8K, MATH500, and GPQA.
  • Planning: Sudoku and Countdown.
  • Code Generation: HumanEval/HumanEval+ and MBPP/MBPP+.

Key Results

  • Performance Gains: E-SMC consistently outperformed standard decoding. For instance, on LLaDA-Instruct-8B, E-SMC improved GSM8K accuracy from 79.3% to 81.2% and Countdown planning from 36.3% to 40.4%.
  • Efficiency: E-SMC proved more effective than standard ensembling techniques like Majority Vote for the same sampling budget.
  • Versatility: The entropy-guided approach provided a performance boost when combined with various existing samplers (e.g., PC-Sampler), highlighting its general applicability.

Discussion and Insights

A critical observation in our study is the "Entropy Drift" phenomenon: without guidance, MDM generation tends to accumulate uncertainty over time. E-SMC acts as a course-correction mechanism. Unlike greedy search, which can lead to repetitive and low-diversity text, E-SMC reduces uncertainty while preserving the natural variance of the model's output.

While E-SMC introduces computational overhead due to parallel path processing, its ability to find high-quality solutions in complex reasoning tasks justifies the cost. Future work could explore using Denoising Entropy as an internal reward signal for Reinforcement Learning, potentially training models to inherently prefer low-entropy decoding paths.

Conclusion

By quantifying path uncertainty through Denoising Entropy, we provide a principled way to steer Masked Diffusion Models. Our proposed E-BoN and E-SMC algorithms bridge the performance gap between MDMs and autoregressive models, turning the flexibility of non-linear decoding into a significant advantage for complex generative tasks.

Summary updated

BibTeX
@misc{chen2025optimizing,
  author = {Ziyu Chen and Xinbei Jiang and Peng Sun and Tao Lin},
  title = {{Optimizing Decoding Paths in Masked Diffusion Models by Quantifying Uncertainty}},
  year = {2025},
  eprint = {2512.21336},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.21336},
}
Figure