TL;DR
This paper introduces Multi-token Residual Prediction (MRP), a lightweight module that significantly speeds up Diffusion Language Models (DLMs) by predicting the difference in model outputs between consecutive denoising steps, rather than recomputing the entire output. This allows DLMs to decode multiple tokens per step with minimal quality loss, achieving up to 1.4x lossless speedup in speculative decoding and recovering significant accuracy in aggressive decoding modes.
What Problem Does This Paper Address?
Diffusion Language Models (DLMs) offer parallelism by denoising multiple tokens simultaneously, but this often comes at the cost of generation quality. Traditional DLM decoding involves iteratively unmasking tokens based on model confidence. Increasing the number of tokens unmasked per step (to improve speed) typically leads to a monotonic decrease in quality because the decisions for each token are made without full awareness of the others being revealed in the same step. This creates a fundamental trade-off between generation speed and quality. The paper aims to break this trade-off by enabling more efficient multi-token denoising without sacrificing accuracy.
Methods
The core innovation is the Multi-token Residual Prediction (MRP) module. The key insight is that the model's output (logits or hidden states) at adjacent denoising steps are remarkably similar. Instead of running the entire DLM backbone again to get the next step's output, MRP predicts only the residual (the difference) between the current and next step's outputs. This residual is much simpler to predict than the full output.
MRP is a lightweight module that takes the backbone's hidden states and token embeddings as input and predicts the logit residual. This residual is then added to the backbone's original logits to produce corrected logits. This approach is applied in three main ways:
- Direct Decoding: The corrected logits are used to unmask additional tokens directly, offering a tunable quality-speed trade-off.
- Speculative Decoding: MRP proposes additional tokens (drafts), which are then verified by the backbone. Accepted tokens are exactly what the backbone would have predicted, leading to lossless acceleration.
- Remasking Decoding: In aggressive, low-threshold decoding (where many tokens are unmasked quickly, hurting quality), MRP uses the corrected confidence to remask over-eager reveals, recovering lost accuracy.
Datasets
The paper uses the SFTDatasetV3 for training, which is a large corpus of conversational data from three public instruction-tuning sources. For evaluation, they use standard benchmarks:
- GSM8K: Mathematics reasoning.
- MATH500: Mathematics reasoning.
- HumanEval: Code generation.
- MBPP: Code generation.
Key Insights and Ideas
- The Residual is Key: The most crucial insight is that the difference (residual) between consecutive denoising steps in DLMs is significantly smaller and easier to predict than the full output. This is because the denoising process is inherently iterative and small changes occur between steps.
- Lightweight Module Suffices: Because the residual is simple, a small, lightweight MRP module can effectively capture this signal, making it computationally efficient.
- Unified Approach for Different Regimes: MRP is versatile and can be applied to both high-quality (static) and high-throughput (dynamic) decoding regimes, offering distinct benefits in each.
- Lossless Acceleration: Speculative decoding with MRP achieves lossless speedup by using the backbone to verify MRP's predictions, ensuring no quality degradation.
- Accuracy Recovery: Remasking decoding effectively recovers accuracy lost in aggressive, low-threshold decoding by using MRP to filter out premature reveals.
Key Results
- Speedup: MRP achieves up to 1.4x lossless speedup in SGLang for speculative decoding on SDAR models.
- Accuracy Improvement: In dynamic denoising, MRP Remasking recovers significant accuracy, improving performance by up to 22.6 points on HumanEval and 17.7 points on GSM8K at low thresholds.
- Trade-off: Direct decoding offers a favorable quality-speed trade-off, allowing practitioners to choose an operating point based on latency or quality needs.
- Model Scale Consistency: The benefits of MRP are consistent across different model scales (1.7B, 4B, 8B).
- Depth Scaling: A small MRP module (few layers) is generally sufficient, with diminishing returns for deeper modules, especially in speculative decoding.
Limitations and Future Work
- Threshold Sensitivity: MRP Remasking is most effective at lower thresholds where the backbone unmasks aggressively. The authors suggest co-designing threshold schedules with MRP for even stronger acceleration.
- Fixed Steps: The current MRP module uses a fixed number of residual steps (K). An adaptive schedule for K could better match compute to difficulty.
- Domain Differences: MRP shows larger quality degradation on code generation compared to reasoning tasks. This suggests that the inter-step residual structure might differ across domains, and future work could explore domain-aware adaptations.
Summary updated