TL;DR
ReMaRL (Remasking with Reinforcement Learning) is a lightweight, 0.3M-parameter policy that optimizes the decoding process of frozen masked diffusion language models. By learning to strategically unmask new tokens or "remask" earlier ones to fix errors—optimized directly for final-answer correctness via Group Relative Policy Optimization (GRPO)—it achieves state-of-the-art performance on math and code benchmarks with very few model calls.
What Problem Does This Paper Address?
Masked Diffusion Language Models (MDLMs) generate text by predicting tokens in parallel across the entire sequence. However, this parallel nature introduces a "coordination problem": if two tokens depend on each other, predicting them simultaneously can lead to a set of tokens that are individually plausible but collectively inconsistent.
To fix this, decoding algorithms must decide which tokens to reveal (unmask) at each step. Some advanced methods also allow "remasking"—hiding a previously revealed token so the model can try again with more context. Existing strategies rely on hand-tuned heuristics or supervised models trained to detect errors. The gap is that these methods don't directly optimize for the ultimate goal: is the final answer correct?
Methods
The authors introduce ReMaRL, a policy that learns to select which positions to unmask, retain, or remask.
- Frozen Backbone: The underlying diffusion model (e.g., LLaDA-8B) remains completely frozen, making training highly efficient.
- Lightweight Policy: The policy is a small MLP (0.3M parameters) that takes features like token confidence, mask status, and the diffusion model's internal hidden states to output a "correction" to the standard confidence score.
- Stochastic Selection (P2'): It builds on a new stochastic adaptation of the P2 planner. It uses a Gumbel top-k sampling strategy to choose positions, allowing for exploration during training.
- Reinforcement Learning (GRPO): The policy is trained using Group Relative Policy Optimization. It generates groups of potential answers for a prompt and receives a binary reward based on whether the final answer is correct. This aligns the decoding strategy directly with task performance.
Datasets
The researchers evaluated ReMaRL on two primary domains:
- Mathematics: Training on a mixture of GSM8K and MATH (~15k questions); evaluation on GSM8K and MATH500.
- Coding: Training on KodCode (~9.1k problems); evaluation on HumanEval and MBPP.
- Backbones: The primary experiments used LLaDA-8B-Instruct, with additional validation on Dream-v0-Instruct-7B.
Key Insights and Ideas
- Emergent Autoregression: Interestingly, even without being told to do so, the learned policy tends to prioritize unmasking tokens from left to right, mimicking autoregressive models. This suggests that the "left-to-right" bias in human language is a naturally efficient strategy for these models (see Figure 6a).
- Remasking is a Safety Net: ReMaRL remasks tokens less frequently than heuristic baselines but does so more effectively. It learns to identify which "uncertain" tokens are actually wrong and need a second look.
- Extreme Data Efficiency: The policy is remarkably data-efficient. Training on as few as 32 questions per dataset allowed the model to approach the performance of the full-data policy (see Figure 4).
- Tuning Matters: The authors found that simply tuning the "temperature" of the position selection (the P2' baseline) yields a very strong decoder even without RL, ranking second in many tests.
Key Results
- Math Superiority: On GSM8K and MATH500, ReMaRL achieved the highest scores among all compared policies within the 4–64 model call range. For example, at 8 calls on GSM8K, it reached ~54% accuracy, significantly outperforming standard confidence-based unmasking (~13%).
- Coding Excellence: At inference budgets of 8 and 16 calls, ReMaRL achieved the highest pass@1 scores on both HumanEval and MBPP.
- Transferability: A policy trained for a specific budget (e.g., 32 calls) generalizes well when given more calls at inference time (see Figure 3).
- Model Agnostic: The method successfully improved the Dream-7B model, proving it isn't overfitted to a single architecture.
Limitations and Future Work
- Fixed Schedules: ReMaRL learns which positions to unmask, but the number of tokens unmasked at each step follows a fixed linear schedule. Learning an adaptive unmasking rate is a logical next step.
- Reward Dependency: The current training relies on objective binary rewards (correct/incorrect). Applying this to open-ended text generation (like creative writing) would require integrating complex reward models (LLM-as-a-judge).
- Wall-clock Time: The paper measures efficiency in "Number of Function Evaluations" (NFE). While the policy is lightweight, the authors note that NFE doesn't perfectly capture real-world speedups due to factors like KV-caching and sequence length overhead.
Summary updated