Abstract
Diffusion Language Models (dLLMs) offer a promising alternative to autoregressive models by enabling parallel token generation. However, their efficiency relies on unmasking heuristics that are often suboptimal and difficult to tune. This paper introduces a reinforcement learning approach using Group Relative Policy Optimization (GRPO) to learn an unmasking policy. By training a lightweight transformer on confidence scores, the authors demonstrate that learned policies can match or exceed state-of-the-art heuristics, generalize across models and sequence lengths, and adapt to non-standard generation settings.
Introduction
Unlike standard Autoregressive (AR) models that generate text sequentially from left to right, Diffusion Language Models (dLLMs) start with a sequence of mask tokens and iteratively reveal the underlying text. This mechanism allows for parallel generation, where multiple tokens can be unmasked in a single step, potentially offering significant speed advantages.
However, a critical challenge remains: determining the optimal number of tokens to unmask at each step. Unmasking too many tokens simultaneously can lead to a loss of coherence and a drop in quality, while unmasking too few sacrifices the speed benefits of the diffusion approach. Existing state-of-the-art methods, such as Fast-dLLM, rely on "confidence threshold" heuristics. While effective in specific settings, these handcrafted solutions are sensitive to hyperparameters and often fail to generalize to more parallel generation regimes.
Methodology
The researchers propose treating the unmasking process as a Markov Decision Process (MDP) and training a policy to navigate it using Reinforcement Learning.
Policy Architecture and Input
The unmasking policy is designed to be extremely lightweight, consisting of a single-layer transformer that is less than 0.01% the size of the underlying dLLM. A key insight of the work is that the policy does not need access to the dLLM's internal hidden states. Instead, it operates solely on the confidence scores (probabilities) produced by the dLLM for each masked position, which serve as a sufficient statistic for making unmasking decisions.
Training with GRPO
The policy is trained using Group Relative Policy Optimization (GRPO), a value-function-free RL algorithm. GRPO evaluates a group of trajectories against each other to identify the unmasking decisions that lead to the best outcomes. To stabilize training and encourage the discovery of effective strategies, the authors occasionally employ "Expert Steering," where a heuristic expert like Fast-dLLM is included in the GRPO group to provide a baseline.
Reward Function
To balance the competing goals of speed and accuracy, the authors utilize a multiplicative reward function: $$R = \text{Accuracy} \times \text{Penalty}(\text{Steps})$$ This formulation ensures that the model prioritizes correctness above all else, only optimizing for speed once it can reliably solve the task. This approach prevents "reward hacking," a common issue with additive rewards where a model might prioritize speed at the expense of accuracy.
Key Results
The learned policies were evaluated on reasoning-heavy benchmarks, including GSM8k and MATH-500, across different block lengths (BL).
Efficiency and the "Glass Ceiling" of Heuristics
In standard semi-autoregressive settings (e.g., BL=32), handcrafted heuristics perform reasonably well. However, in "full diffusion" settings (BL=256), where the model attempts to unmask the entire sequence at once, heuristics encounter a "glass ceiling" where accuracy plateaus or even declines as more steps are taken. In contrast, the RL-trained policies adapt to these highly parallel settings, maintaining high accuracy while significantly reducing the number of required Network Function Evaluations (NFEs).
Generalization and Transfer
One of the most significant findings is the robustness of the learned policies:
- Zero-Shot Transfer: A policy trained on one dLLM (e.g., LLaDA) can be applied to a completely different dLLM (e.g., Dream) without retraining, as the relationship between confidence and correctness remains consistent across models.
- Length Generalization: Policies trained on 256-token sequences successfully generalize to 512-token sequences, maintaining their efficiency-accuracy trade-off.
Conclusion and Future Work
By replacing handcrafted heuristics with learned policies, this work demonstrates a path toward more efficient and adaptable Diffusion Language Models. While the policies currently show some domain sensitivity—requiring fine-tuning when moving from math to coding—the results suggest that learned unmasking is a superior approach for sequential decision-making in dLLMs. Future research may explore remasking capabilities and the application of these techniques to multimodal diffusion models for image and video generation.
Summary updated