Texas A&M's EGSPO Teaches Diffusion Language Models to Reason, Hitting 94% on Sudoku
A new policy gradient recipe treats denoising as a Markov decision process, delivering state of the art results on coding and reasoning benchmarks
ProTakeaways
- New RL method EGSPO-SA formulates diffusion language model training as a finite-horizon MDP with exact policy gradients
- Beats prior baselines on Sudoku (94.3%), Countdown (85.2%), MBPP (51.1%), and HumanEval (44.5%)
- Entropy-guided step selection focuses gradient updates on the denoising steps where the model is least confident
- Stepwise advantages come free from one-shot greedy completions, avoiding costly rollouts or value networks
- Works on both LLaDA-8B-Instruct and Dream-7B-Instruct with LoRA rank 128, no SFT required
- Code released at github.com/vishnutez/egspo-dllm-rl under standard training protocol
Reinforcement learning turned autoregressive LLMs into reasoning machines, but the same recipes have been stumbling on diffusion language models. A team from Texas A&M has now published a paper that reformulates the problem from first principles, and their two methods (EGSPO and EGSPO-SA) beat every existing RL fine-tuning approach for diffusion LMs on Sudoku, Countdown, MBPP, and HumanEval, while matching the best results on GSM8K and MATH500.
Why GRPO breaks on diffusion models
Diffusion language models like LLaDA-8B and Dream-7B generate text by iteratively denoising a masked sequence rather than predicting tokens left to right. That gives them bidirectional context and parallel token generation, but it breaks the machinery RL depends on.
RL for autoregressive models relies on causal token-wise factorization, which yields a natural token-space Markov decision process and enables efficient computation of log-likelihoods and importance ratios. DLMs fundamentally break this structure: generation proceeds through a denoising trajectory in masked space, and the likelihood of the final output does not admit a readily usable token-wise decomposition. Prior approaches (d1, wd1, SPG, ESPO) worked around this by inventing surrogate likelihoods or mean-field approximations, but those introduce bias and hide the sequential structure of denoising.
Treating denoising as a decision process
The authors instead frame the entire denoising trajectory as a finite-horizon MDP: each state is the partially unmasked sequence at step t, each action is the next denoised state, and reward only arrives at the final clean output. From this they derive an exact, unbiased policy gradient that decomposes over denoising steps in terms of stepwise advantages, with no need to evaluate intractable sequence likelihoods.
That would still be too expensive to run directly. A typical diffusion run has 100 to 1000 denoising steps, each requiring a separate forward pass. So the paper contributes two practical tricks that make the theory scalable.
Trick one: spend gradient budget where the model is confused

Rather than update the policy at every denoising step, EGSPO picks the top-K steps by entropy of the model's next-token distribution. The paper proves this greedy choice minimizes an upper bound on the gradient approximation error. Intuitively, at these steps the model is least confident about which tokens to unmask, so allocating gradient computation to them directly minimizes the gradient approximation error.
A useful empirical finding from the ablations: the selected steps are not the heavily masked early ones. Contrary to the naive expectation that early, heavily masked steps would dominate, selected steps span the diffusion horizon with a modest concentration on intermediate timesteps. In early steps, the model is confident across the unmasked-token choices; intermediate steps are where partial structure has formed but multiple completions remain plausible, yielding the highest token-level uncertainty.
Trick two: free value estimates via greedy completion
Estimating the value function V_t at intermediate states would normally require expensive Monte Carlo rollouts. EGSPO-SA exploits a DLM-specific quirk: the model already outputs a full distribution over clean tokens from any masked state, so a one-shot greedy unmasking gives a free reward estimate at no extra cost from the forward pass already computed during rollout.

The stepwise advantage becomes r(x_0) - r(x_hat_0|t+1): how much better the full denoising trajectory did versus a lazy one-shot completion. Since this estimator is biased, the authors blend it with the raw sequence reward via a scalar λ, giving a bias-variance knob rather than committing fully to either.
What the numbers say
On LLaDA-8B-Instruct under a matched protocol (2 tokens/step, 0-shot, LoRA rank 128), EGSPO-SA delivers:
- Sudoku: 94.3% vs 72.9% for ESPO and 22.1% for d1
- Countdown: 85.2% vs 82.0% for ESPO and 71.5% for SPG
- MBPP: 51.1% vs 49.0% for ESPO and 44.7% for d1
- HumanEval: 44.5% vs 36.0% for ESPO and 37.8% for d1
- GSM8K: 86.1%, matching SPG
- MATH500: 41.6%, within 0.2% of SPG
The compute story is equally striking. On Sudoku, EGSPO-SA converges to near-perfect reward while d1 plateaus below 0.2 across FLOPs, samples seen, and gradient steps. Similar gains transfer to Dream-7B, showing the method is not tied to one architecture.
When to use it, and when not to
The bias-variance behavior of the stepwise advantage explains where EGSPO-SA helps most. Logical reasoning tasks like Sudoku impose global constraints across the trajectory, so per-step credit assignment carries real information. Math benchmarks like GSM8K couple denoising steps less tightly, and the sequence-level reward alone is already low-variance; in a few configurations plain EGSPO (with λ=0) slightly outperforms EGSPO-SA there.
Two limitations worth flagging. The framework assumes monotonic unmasking, so it does not yet cover remasking-capable diffusion models where tokens get revised after decoding. And all experiments use verifiable rewards (correct answers, passing unit tests). Extending to learned reward models or preference data would require revisiting the entropy bound, which relies on bounded rewards.
The code is available on GitHub, and the training protocol is standard enough that swapping it into an existing diffusion LM RL pipeline should be straightforward.