Learning Generation Orders for Masked Discrete Diffusion Models via Variational Inference

David Fox, Sam Bowyer, Song Liu, Laurence Aitchison, Raul Santos-Rodriguez, Mengyue Yang

TL;DR

This paper introduces a novel variational inference framework for learning optimal token generation orders in Masked Discrete Diffusion Models (MDMs). By treating the generation order as a latent variable, their method achieves competitive performance with significantly fewer generation steps, addressing a key challenge in balancing efficiency and sample quality for these models.

What Problem Does This Paper Address?

Autoregressive models generate sequences one token at a time, which is inherently slow. Discrete Diffusion Models (DDMs), and specifically Masked Diffusion Models (MDMs), offer a promising alternative by enabling parallel token generation, leading to much faster inference. However, a critical challenge remains: how to choose which tokens to unmask and generate in parallel at each step to achieve a good balance between generation speed and the quality of the generated output. Current methods often rely on fixed, heuristic strategies (like always unmasking a certain number of tokens or those with the highest predicted probabilities), which can be too rigid and may not generalize well. While some learned approaches exist, framing this problem within a variational inference (VI) perspective for learning generation orders is underexplored.

Methods

The core contribution is a variational inference framework for learning the generation order in MDMs. Instead of using fixed heuristics, the authors propose to learn a probabilistic model for the "unmasking" process. This is achieved by:

  • Factorizing the Generative Model: They explicitly separate the MDM into two components: one that decides which tokens to unmask (the generation order) and another that decides what value to assign to the unmasked token.
  • Variational Inference Formulation: They treat the generation order as a latent variable and derive an Evidence Lower Bound (ELBO) objective for training. This allows them to optimize both the denoiser and the generation order predictor simultaneously.
  • Learned Approximate Posterior: They introduce a parameterized family of distributions for the approximate posterior of the generation order. This posterior is designed to be computationally efficient, support parallel generation, encode a notion of order, and ensure at least one token is unmasked per step.
  • REINFORCE with RLOO: Due to the discrete nature of the generation order, they use the REINFORCE algorithm with REINFORCE-Leave-One-Out (RLOO) control variates to estimate gradients and reduce variance during training.

Datasets

  • GSM8K: This dataset was used for preliminary experiments and evaluation.

Key Insights and Ideas

  • Learning vs. Heuristics for Generation Order: The paper strongly suggests that learning an adaptive generation order can outperform fixed heuristic strategies, especially in scenarios demanding high parallelism.
  • Variational Inference as a Unifying Framework: Framing the learned generation order within VI provides a principled way to jointly optimize the denoiser and the unmasking policy, potentially leading to better overall performance.
  • The Trade-off is Dynamic: The "optimal" generation order isn't static; it depends on the specific task and the desired balance between speed and quality. A learned approach can adapt to this dynamic.
  • Parallelism Can Hurt: While parallelism is the main advantage of MDMs, too much can degrade performance. The learned approach aims to find the sweet spot, avoiding over-parallelization.

Key Results

The paper reports preliminary experiments on the GSM8K dataset, showing competitive results:

  • High Accuracy with Few Steps: Their method achieved 33.1% accuracy with an average of only 4 generation steps.
  • Comparison to Baselines: This significantly outperforms heuristic sampling strategies like "Top Probability" and "Top Probability Margin," which achieved 23.7-29.0% accuracy in the same number of steps.
  • Budget Sensitivity: The performance gap between their method and baselines narrows as the number of allowed decoding steps (budget) increases, suggesting that the learned order is particularly beneficial when aggressive parallelism is required.

Limitations and Future Work

  • Preliminary Experiments: The authors acknowledge that these are preliminary experiments and a full analysis would require more extensive testing.
  • Dataset and Model Size: They suggest analyzing performance on more diverse datasets and with MDMs of varying sizes.
  • Approximate Posterior Exploration: While they found their chosen posterior form (Eq. 14) to perform well, they believe further experimentation with different approximate posterior designs could be fruitful.
  • Generalization: Further work is needed to understand how well this learned generation order generalizes across different tasks and data modalities.

Summary updated

BibTeX
@inproceedings{fox2026learning,
  author = {David Fox and Sam Bowyer and Song Liu and Laurence Aitchison and Raul Santos-Rodriguez and Mengyue Yang},
  title = {{Learning Generation Orders for Masked Discrete Diffusion Models via Variational Inference}},
  booktitle = {DeLTa @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=1TXouwH5ha},
}
Figure