TL;DR
Masked diffusion language models speed up text generation by unmasking multiple tokens at once, but choosing these tokens independently often leads to conflicting, low-quality outputs. This paper introduces ADAS, a training-free reranking method that uses a model's own attention weights to penalize selecting highly coupled, uncertain tokens simultaneously. ADAS significantly boosts accuracy in highly parallel decoding regimes by an average of 9–10 percentage points with a negligible 3.1% runtime overhead.
What Problem Does This Paper Address?
Standard autoregressive language models generate text token-by-token, which can be painfully slow for long outputs like code or multi-step reasoning. Masked Diffusion Language Models (MDLMs) offer a faster alternative by predicting and revealing a subset of multiple tokens in parallel during each denoising step.
However, aggressive parallel decoding is fragile. Existing samplers typically rank candidate positions independently based on token-wise confidence scores. This approach ignores token interactions: if two positions are highly dependent on each other (e.g., a variable name and its subsequent reference in a block of code), unmasking both simultaneously without knowing the outcome of either can lead to mutually incompatible choices and catastrophic generation failures. The core challenge is determining not just what token to place at a masked position, but which positions can be safely committed together in the same step.
Methods
The authors propose ADAS (Attention-Discounted Adaptive Sampler), a training-free, plug-and-play reranking module that upgrades greedy token selection inside existing MDLM decoders (such as Top-$k$, Fast-dLLM, or EB-Sampler) while leaving their stopping criteria unchanged.
Instead of treating token selection as purely additive, ADAS builds the unmasking set greedily. For each candidate token, its confidence score is dynamically discounted if it attends strongly to tokens already selected in that step, especially if those selected tokens are highly uncertain.
The risk-adjusted marginal utility for a candidate token $i$ given an already selected set $S$ is calculated as:
$$u(i | S, A) = c_i - \alpha \sum_{s \in S} Ais(1 - c_s)$$
Where:
- $c_i$ is the standard token confidence score.
- $A_{is}$ is the interaction matrix obtained by averaging attention scores across heads from the denoiser's final self-attention layer.
- $(1 - c_s)$ represents the prediction uncertainty of the already selected token $s$.
- $\alpha$ is a hyperparameter controlling the strength of the attention discount (set to a global default of 40).
Datasets
The method was evaluated using two open-weight MDLMs (Dream-7B-Base and LLaDA-8B-Base) across four challenging reasoning and code generation benchmarks:
- GSM8K: Grade-school math word problems.
- MATH500: High-school competition-level math problems.
- HumanEval: Python coding tasks evaluating functional correctness.
- MBPP: Mostly Basic Python Problems.
Additionally, the authors designed a controlled synthetic dataset of arithmetic predicates to isolate and validate the relationship between self-attention and token dependency.
Key Insights and Ideas
- Attention as a Dependency Proxy: The authors empirically demonstrate that self-attention between masked positions accurately predicts the distributional change (KL divergence) that occurs when one of those tokens is revealed.
- Uncertainty Gating is Crucial: A candidate token shouldn't be penalized simply for being coupled to another selected token; it matters how reliable that selected token's commitment is. Weighting the attention discount by the selected token's uncertainty $(1 - c_s)$ significantly improves cross-state calibration.
- Soft vs. Hard Constraints: Unlike prior methods (such as DAPD) that build a binary graph to completely forbid simultaneous updates of connected tokens, ADAS applies a continuous, "soft" marginal discount. This allows highly coupled tokens to still be unmasked together if their individual confidence gains outweigh the estimated commitment risk.
Key Results
- Robustness in High Parallelism: ADAS dramatically flattens the quality degradation typically seen when unmasking many tokens in parallel (the low Number of Function Evaluations, or NFE, regime).
- Substantial Accuracy Gains: At matched denoiser evaluations, plugging ADAS into the base samplers improves absolute performance by an average of 9.11 percentage points for LLaDA-8B-Base and 10.46 percentage points for Dream-7B-Base. The gains are most pronounced in code generation tasks (HumanEval and MBPP), where strict syntax rules make simultaneous coupled errors highly damaging.
- Minimal Overhead: Because ADAS only reads the final layer's attention matrix and updates scores incrementally, it adds a mere 3.1% runtime overhead per model forward pass.
Limitations and Future Work
- Imperfection of Attention: Self-attention is an imperfect proxy for harmful dependence; it can sometimes reflect syntax, positioning, or formatting rather than true semantic or stochastic coupling.
- Irreversible Commitments: ADAS commits to unmasking tokens irreversibly within a step. Incorporating a "revise-or-remask" mechanism to repair early errors after neighboring context arrives is a promising direction for future work.
- Evaluation Scope: The method was validated only on reasoning and code generation tasks using two base models. Its performance on open-ended generation, larger models, or using layer-agnostic attention signals remains untested.
Summary updated