TL;DR
This paper introduces PRISM, a novel "plug-and-play" method that enables Masked Diffusion Models (MDMs) to self-correct low-quality tokens during inference. PRISM achieves this by fine-tuning existing MDMs with a new loss function that provably learns per-token quality scores, significantly improving generation quality across various tasks like Sudoku, text, and code.
What Problem Does This Paper Address?
Masked Diffusion Models (MDMs) are powerful generative models for discrete data (like text or code) that work by gradually unmasking tokens. While flexible, they can produce low-quality or incorrect tokens during this iterative unmasking process. A natural desire is for these models to "self-correct" by identifying and revising these errors at inference time. However, existing methods for MDM self-correction either require complex architectural changes or rely on imprecise quality estimates, limiting their practicality and applicability. This paper aims to bridge this gap by providing a lightweight, model-agnostic approach to self-correction that is theoretically grounded and empirically effective.
Methods
The core contribution is PRISM (Plug-in Remasking for Inference-time Self-correction of Masked Diffusions). PRISM is a plug-and-play fine-tuning framework that adapts any pretrained MDM. It works by:
- Augmenting the MDM: PRISM adds a lightweight auxiliary head to a pretrained MDM. This head, alongside the original unmasking posterior head, shares the same backbone.
- Introducing a Self-Correction Loss: PRISM defines a novel loss function that provably learns per-token quality scores. This loss encourages the model to assign a high score to tokens that are likely given the surrounding context and a low score to those that are not.
- Inference-time Remasking: During inference, PRISM uses these learned per-token quality scores to identify potentially erroneous tokens. These low-quality tokens are then remasked and potentially revised in subsequent steps, alongside the standard unmasking process.
The theoretical foundation lies in showing that this loss function's unique minimizer is the true per-token quality, defined as the likelihood of a token given the rest of the sequence.
Datasets
The paper evaluates PRISM on several datasets and tasks:
- Sudoku: A corpus of 48k training and 2k evaluation puzzles.
- OpenWebText: Used for unconditional text generation, with a 170M parameter MDM fine-tuned on 164M tokens.
- LLaDA-8B-Instruct: An 8B parameter MDM used for code generation, fine-tuned on the opc-sft-stage-2 dataset (≈0.1M pairs).
Key Insights and Ideas
- Provable Per-Token Quality: The most significant insight is the theoretical guarantee that PRISM's loss function provably learns per-token quality scores without needing to generate a full clean sequence or rely on reinforcement learning.
- Plug-and-Play Efficiency: PRISM's ability to fine-tune existing MDMs without architectural changes is a major practical advantage, making self-correction accessible to a wider range of models.
- Beyond Proxy-X: Unlike previous methods that relied on indirect proxies for quality, PRISM directly learns a principled per-token quality score.
- Low-Cost Fine-tuning: PRISM achieves significant improvements with relatively few GPU hours and data, demonstrating its efficiency.
- Scalar Quality Sufficiency: The paper argues that a scalar per-token quality score is often sufficient for effective self-correction, offering a good trade-off between performance and computational cost compared to learning full likelihoods.
Key Results
- Sudoku: PRISM achieves a higher accuracy on Sudoku puzzles compared to baselines like ReMDM and ReMDM-conf, with learned per-token quality scores accurately identifying incorrect cells.
- Text Generation: On unconditional text generation with a 170M MDM, PRISM outperforms baselines in Generative Perplexity and MAUVE scores, especially at lower sampling steps.
- Code Generation: For LLaDA-8B-Instruct, PRISM fine-tuned with PRISM achieves state-of-the-art results on MBPP and HumanEval benchmarks, outperforming baselines with significantly less fine-tuning compute (≈30 hours).
- Calibration: PRISM's learned per-token quality scores are well-calibrated to the empirical likelihoods, indicating the model has learned a meaningful representation of token quality.
- Error Correction: PRISM successfully corrects syntax and logical errors in code generation tasks, demonstrating its practical self-correction capabilities.
Limitations and Future Work
- Local Errors vs. Global Reasoning: The paper acknowledges that PRISM's token-level quality estimation might not capture global structural errors or complex reasoning failures, as seen in a failure case on a musical symbol task.
- Training Efficiency Trade-off for Likelihood Learning: While extending PRISM to learn full per-position likelihoods is possible, it introduces a training efficiency trade-off, requiring more optimization.
- Future Work: The authors suggest exploring frameworks that enable discrete diffusion models to correct global reasoning errors and investigating how the training efficiency gap for likelihood learning evolves at larger scales. They also propose PRISM as a general-purpose self-corrector that can be applied to other pretrained MDMs.
Summary updated