Abstract
Discrete diffusion models have traditionally struggled with a "failure to remask" property, where tokens are locked in once predicted, preventing error correction. We present ReMDM (Remasking Discrete Diffusion Model), a principled framework that enables iterative refinement by allowing tokens to be remasked and corrected during inference. This approach unlocks inference-time compute scaling, allowing discrete diffusion models to approach the quality of autoregressive models by increasing the number of sampling steps.
Introduction
In the landscape of generative modeling, continuous diffusion models (such as those used for image generation) excel by repeatedly refining a noisy signal. However, discrete diffusion models—widely used for text, molecular sequences, and discretized images—have historically lacked this flexibility. Most performant discrete models rely on a masking mechanism: they begin with a sequence of [MASK] tokens and gradually fill them in.
A significant limitation of these models is that once a token is unmasked, it is typically fixed. If a model makes a sub-optimal choice early in the process, it has no mechanism to revise that choice based on the context generated later. This lack of error correction limits sample quality and makes controlled generation difficult. ReMDM addresses this by introducing a non-Markovian probabilistic framework that allows for dynamic remasking during the sampling process.
Methodology: The ReMDM Sampler
ReMDM is a sampler that can be applied to existing, pretrained masked diffusion models without the need for retraining. It introduces a principled way to perform iterative refinement through several key technical components:
1. The Remasking Schedule ($ \sigma_t $)
This user-defined parameter specifies the probability of a decoded token being turned back into a [MASK] at any given step. By adjusting this schedule, users can control the degree of "rethinking" the model performs throughout the generation process.
2. Confidence-Based Remasking
Rather than remasking tokens randomly, the ReMDM sampler can target tokens where the model exhibits low decoding probability (confidence). This allows the model to specifically rethink its most uncertain predictions, effectively fixing local inconsistencies—such as grammatical errors in text—that often arise during parallel decoding.
3. Inference Strategies
- Switch Strategy: The model follows standard decoding for the first half of the process and then activates remasking to refine the final output.
- Loop Strategy: The model holds the noise level constant and iteratively refines a sequence in a loop, allowing for deep refinement of a specific state.
Experimental Results
The researchers evaluated ReMDM across three distinct domains: natural language, images, and molecular design.
Natural Language Quality
Using the OpenWebText (OWT) dataset and the LLaDA 8B model, ReMDM demonstrated significant improvements in text quality. On OWT, ReMDM achieved a 15.62x improvement in MAUVE score compared to standard masked diffusion. As the number of sampling steps ($ T $) increased to 4,096, ReMDM reached a MAUVE score of 0.656, coming remarkably close to the 0.760 score of a comparable Autoregressive (AR) model—a gap previously thought to be much wider.
On downstream tasks, applying ReMDM to the LLaDA 8B model improved performance on the Countdown reasoning task and TruthfulQA, outperforming both the base model and previous corrector methods like Discrete Flow Matching (DFM).
Image and Molecule Generation
- ImageNet: On discretized 256x256 images, ReMDM produced higher quality outputs (lower FID) as the computational budget ($ T $) increased.
- QM9 (Molecules): In molecule design, ReMDM allowed for stronger guidance. By remasking tokens that did not fit desired chemical properties, it pushed the Pareto frontier of what these models can design compared to standard sampling.
Discussion: Inference-Time Scaling
The core insight of ReMDM is the enablement of inference-time compute scaling. In standard masked diffusion, adding more steps often yields diminishing returns because the model simply finishes the sequence earlier. With ReMDM, additional steps are transformed into rounds of error correction. This "compute-for-quality" trade-off allows discrete diffusion models to scale their performance at test time, similar to how search or chain-of-thought scales in other architectures.
Limitations
While ReMDM offers a powerful path forward, it is sensitive to hyperparameters such as the remasking schedule ($ \sigma_t $) and softmax temperature ($ \tau $). The optimal settings tend to vary between tasks (e.g., text vs. molecules). Furthermore, the increased quality comes at the cost of higher latency, as more forward passes are required to achieve the best results.
Conclusion
ReMDM provides a robust framework for giving discrete diffusion models a "second chance to think." By allowing for principled remasking and iterative refinement, it bridges the performance gap between parallel-decoding diffusion models and autoregressive models, offering a new avenue for high-quality, scalable discrete sequence generation.
Summary updated