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

d2: Improving Reasoning in Diffusion Language Models via Trajectory Likelihood Estimation

Guanghan Wang, Gilad Turok, Yair Schiff, Marianne Arriola, Volodymyr Kuleshov

Introduction

In the rapidly evolving landscape of Large Language Models (LLMs), reinforcement learning (RL) techniques like RLHF and GRPO have become the "secret sauce" for unlocking advanced reasoning capabilities. However, this success has largely been confined to Autoregressive (AR) models, which generate text sequentially from left to right. Because AR models factorize probabilities neatly, calculating the likelihood of a generated sequence is straightforward.

Diffusion Language Models (DLMs) present a compelling alternative, offering benefits like parallel generation and highly controllable text synthesis by iteratively refining a noisy or masked sequence. Yet, applying RL to DLMs introduces a major hurdle: calculating the exact likelihood of a sampling trajectory is computationally exorbitant. A naive calculation requires $T$ forward passes (where $T$ is the number of diffusion steps). Consequently, standard RL algorithms become prohibitively slow or suffer from biased approximations.

To bridge this gap, researchers have introduced d2, a novel reinforcement learning framework specifically designed to boost the reasoning capabilities of masked DLMs through efficient trajectory likelihood estimation.

The d2 Framework: Efficient Trajectory Likelihood Estimation

The core innovation of the d2 framework is a new policy gradient algorithm—inspired by Group Relative Policy Optimization (GRPO)—that relies on highly accurate trajectory likelihood estimates. To make this computationally feasible, the authors developed two distinct estimators tailored to different model classes:

1. d2-AnyOrder (Exact Likelihood)

Designed for a specific class of models known as Any-Order DLMs, this estimator utilizes a clever "packing" trick. By constructing a sequence of length $2L$ (concatenating clean tokens and mask tokens) and applying a specialized attention mask, d2-AnyOrder can compute the exact trajectory likelihood in a single forward pass. This eliminates the massive computational overhead usually required to track the probability of a specific reasoning path.

2. d2-StepMerge (Approximate Likelihood)

Standard masked diffusion models (like LLaDA) do not natively support any-order decoding; forcing them to do so results in likelihood estimates that deviate from the ground truth by an order of magnitude. For these models, the authors propose d2-StepMerge. This method merges the $T$ diffusion steps into $N$ contiguous blocks, allowing for a mathematically tractable compute-bias tradeoff. More blocks ($N$) yield higher accuracy at the cost of compute, while fewer blocks are faster but introduce more bias. The authors mathematically bound this approximation error and identify $N=16$ as a "sweet spot" that achieves near-peak performance with significantly fewer FLOPs than full trajectory evaluation.

Key Results and State-of-the-Art Performance

The d2 framework was rigorously evaluated across a variety of challenging benchmarks, including logical reasoning (Sudoku, Countdown), mathematical reasoning (GSM8K, MATH500), coding (HumanEval, MBPP), and alignment (OpenWebText).

The results establish a new state-of-the-art for non-autoregressive reasoning:

  • Sudoku: When applied to the LLaDA-8B model, d2-StepMerge improved accuracy from a baseline of 11.8% to a staggering 91.9%.
  • Grade School Math (GSM8K): d2 reached 85.0% accuracy, significantly outperforming prior diffusion-based RL methods (such as d1 and wd1).
  • Length Generalization: The framework demonstrated superior robustness. When trained on sequences of 256 tokens, d2 maintained its performance much better than baselines when tested on 512-token sequences, indicating the acquisition of robust, generalizable reasoning patterns.

Limitations and Future Directions

While d2 represents a significant breakthrough for diffusion-based reasoning, it operates under certain constraints. The most efficient variant, d2-AnyOrder, requires models to be pre-trained with specific "any-order" objectives. Although gaining traction, these models are not yet the industry standard. Furthermore, while d2-StepMerge is vastly faster than naive approaches, it still requires multiple forward passes ($N > 1$), making it more compute-intensive than RL for standard AR models.

Looking forward, as any-order models mature, d2-AnyOrder has the potential to become a universal standard for training efficient, controllable, and reasoning-capable diffusion models. Future work will also explore scaling these techniques to even more complex reasoning tasks that require long-form "Chain-of-Thought" generation.

Summary updated

BibTeX
@inproceedings{wang2026d,
  author = {Guanghan Wang and Gilad Turok and Yair Schiff and Marianne Arriola and Volodymyr Kuleshov},
  title = {{d2: Improving Reasoning in Diffusion Language Models via Trajectory Likelihood Estimation}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=ldCiNVFt8O},
}
Figure