Abstract
Autoregressive (AR) models remain the standard for natural language generation but still suffer from high latency due to strictly sequential decoding. Recent diffusion-inspired approaches, such as LlaDA and Dream, mitigate this by generating in parallel, yet they suffer from two core limitations: information loss, as predictive distributions for non-finalized tokens are discarded at each step, and premature commitment, where local decisions are made without sufficient global coordination. We introduce Latent Refinement Decoding (LRD), a two-stage framework with Latent Refinement and a Predictive Feedback Loop. The first stage maintains masked positions as distributional mixtures of predicted tokens and the mask embedding, allowing the model to establish more globally consistent beliefs. The second stage progressively finalizes confident tokens while retaining uncertain ones for iterative feedback. KL-divergence dynamics provide a principled and reliable criterion for convergence and early stopping. Experiments across coding (HumanEval +6.3, MBPP +2.6) and reasoning (GSM8K +2.9, MATH500 +3.8) show that LRD improves accuracy while delivering speedups of up to 10.6x, making it a strong and versatile alternative for parallel sequence generation.
Introduction
While Autoregressive (AR) models like GPT-4 are the gold standard for text generation, they are inherently slow because they generate text one token at a time. Recent "diffusion-inspired" models, such as LLaDA and Dream, attempt to solve this by generating all tokens in parallel. However, these parallel models face a "hard masking" dilemma. At each step, if the model isn't confident about a token, it resets that position to a generic [MASK] token. This causes two major issues: information loss, where the model throws away its "partial beliefs" from previous steps, and premature commitment, where the model locks in local token choices before establishing a globally consistent plan, leading to error propagation.
Methodology
Latent Refinement Decoding (LRD) addresses these issues by moving away from binary (Mask vs. Token) choices into the continuous embedding space. The framework operates in two distinct phases.
Phase 1: Latent Refinement
Instead of resetting uncertain positions to a pure [MASK], LRD creates a "mixed embedding." This is a weighted combination of the [MASK] vector and the expected value of the predicted tokens (using top-p nucleus sampling). The weight is determined by entropy: if the model is confused (high entropy), the embedding looks more like a [MASK]; if it's confident (low entropy), it looks more like the predicted token. The model "thinks latently" for a few steps, updating these soft embeddings in parallel without committing to specific words, allowing it to establish a globally coherent "belief state."
Phase 2: Predictive Feedback Loop
Once the beliefs stabilize, the model begins a "soft-to-hard" transition. It finalizes the most confident tokens into discrete words while keeping the uncertain ones in their "soft" mixed-embedding form to provide context for the next iteration.
Adaptive Early Stopping
Rather than running for a fixed number of steps, LRD monitors the KL-divergence between consecutive predictions. When the model stops changing its mind (i.e., the KL-divergence drops below a threshold), it stops decoding, saving significant computation.
Experimental Setup
The researchers evaluated LRD across four demanding benchmarks:
- Coding: HumanEval (handwritten Python problems) and MBPP (entry-level programming tasks).
- Reasoning: GSM8K (grade-school math) and MATH500 (challenging competition-level mathematics).
These were tested on two major diffusion model families: LLaDA (8B) and Dream (7B), including both base and instruction-tuned variants.
Results and Analysis
LRD consistently outperformed standard decoding baselines in both quality and efficiency. On HumanEval, LRD improved the pass@1 score by +6.3 points for Dream-Base-7B. On the difficult MATH500 benchmark, it saw gains of up to +3.8 points.
The efficiency gains are equally significant. Because LRD converges faster and utilizes early stopping based on KL-divergence stability, it achieved a 10.6x speedup on the Dream-Ins-7B model for long sequences (1024 tokens). The KL-divergence metric provides a principled "thermometer" to tell the model when it's done "cooking" the answer, as shown in the convergence dynamics.
Key Insights
- The Power of "Soft" Beliefs: Keeping uncertain positions "blurry" as distributional mixtures is superior to forcing them to be a
[MASK]. It allows the Transformer's self-attention mechanism to pass nuanced, probabilistic information across the sequence. - Global Before Local: By using an initial latent refinement phase, the model builds a global skeleton of the answer before committing to specific vocabulary, avoiding the "greedy" trap of AR models.
Conclusion
Latent Refinement Decoding (LRD) represents a significant step forward for diffusion-based language models. By preserving partial beliefs in the latent space, it overcomes the limitations of hard masking, leading to better global coherence and higher accuracy. While it introduces some overhead per step, the overall reduction in decoding steps and the use of adaptive early stopping result in massive speedups. Future work may involve integrating LRD with system-level optimizations like KV caching to further enhance its performance.
Summary updated