NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Beyond Fully Random Masking: Attention-Guided Denoising and Optimization for Diffusion Language Models

Jia Deng, Junyi Li, Wayne Xin Zhao, Jinpeng Wang, Hongyu Lu, Ji-Rong WenarXiv 2026

TL;DR

Diffusion Large Language Models (dLLMs) offer a promising alternative to traditional autoregressive models through parallel decoding, but standard post-training methods rely on fully random token masking. This paper introduces AGDO (Attention-Guided Denoising and Optimization), a framework that leverages a dLLM's internal bidirectional attention to determine an optimal, dependency-aware denoising order. By prioritizing and weighting tokens based on their contextual support, AGDO significantly boosts reasoning and coding performance with negligible computational overhead.

What Problem Does This Paper Address?

Autoregressive (AR) language models generate text sequentially from left to right. In contrast, Diffusion LLMs (dLLMs) start with a completely masked sequence and iteratively denoise tokens in parallel, offering massive potential advantages in inference efficiency.

However, effectively fine-tuning these models after pre-training (post-training via Supervised Fine-Tuning or Reinforcement Learning) remains a challenge. Most existing methods randomly mask tokens during training. The authors argue that this creates a fundamental mismatch: random masking completely ignores the intrinsic, bidirectional token dependencies that naturally emerge during inference. Forcing a model to learn from an arbitrary or fully random unmasking order hinders its ability to master complex, multi-step reasoning tasks like mathematics and coding.

Methods

The authors propose AGDO (Attention-Guided Denoising and Optimization), a two-stage post-training framework that aligns training schedules directly with the model's internal attention structure.

  1. Attention-Guided Denoising Order: Instead of random masking, AGDO computes a valid attention score ($S$) for each token, which measures how strongly a masked token attends to already unmasked context. Tokens with the highest scores are unmasked first, ensuring the model builds its generation on a stable contextual foundation.
  2. AGDO-SFT (Supervised Fine-Tuning): AGDO calculates an influence score ($I$) for each token, identifying "attention hubs"—tokens that exert a disproportionate influence on the rest of the sequence. The cross-entropy loss is then weighted to emphasize these critical tokens.
  3. AGDO-RL (Reinforcement Learning): The authors extend Group Relative Policy Optimization (GRPO) to dLLMs. AGDO-RL adjusts token-level advantage estimations using the same influence scores, amplifying policy updates for tokens central to the reasoning chain.

Datasets

The framework was evaluated across several rigorous benchmarks:

  • Mathematical Reasoning: GSM8K, MATH-500, and Minerva.
  • Code Generation: LiveBench and LiveCodeBench-V2.
  • General NLP/Commonsense: HellaSwag and CommonsenseQA (to ensure no regression on general tasks).

For training, the authors utilized 2,000 mathematical reasoning samples and 2,000 distilled coding samples from CodeContest (generated via Qwen2.5-32B-Instruct).

Key Insights and Ideas

  • Attention is Sparse and Consistent: Empirical analysis reveals that despite query, key, and value representations being recomputed at every denoising step, tokens consistently attend to the same small, stable set of context tokens throughout the entire process. This manifests as persistent vertical lines in attention maps.
Figure 1: Attention dynamics during the denoising process on Dream-v0-Instruct-7B (Ye et al., 2025). Figure (a) to (d) display the attention distributions among tokens at randomly selected denoising steps. Figure (e) to (h) illustrate how the attention of a randomly chosen token towards other tokens changes throughout the denoising process. The red dashed lines indicate the steps at which the corresponding token is unmasked.
  • Attention Predicts Stability: There is a clear positive correlation between a token's valid attention score ($S$) and its probability stability ($\Delta P$) during generation. Forcing a token to denoise before its attention-supported context is available leads to high uncertainty and fluctuating probabilities.
Figure 2: Relationship between the valid attention score S and the average probability change ∆P.
  • Internalizing the Trajectory: Optimization with AGDO causes a distinct rightward shift in the distribution of valid attention scores during inference. This means the model successfully internalizes the strategy, naturally learning to prioritize generating tokens that possess robust logical dependencies on the existing context.

Key Results

AGDO was validated on two prominent dLLMs: Dream-v0-Instruct-7B and LLaDA-8B-Instruct. It consistently established a new state-of-the-art for dLLM post-training:

  • SFT Improvements: On the Dream-7B model, AGDO-SFT achieved an average accuracy of 36.0% across all math and coding tasks, outperforming standard random-mask SFT (33.9%) and blockwise SFT (34.4%).
  • RL Advancements: AGDO-RL achieved an average accuracy of 38.8%, substantially outperforming other diffusion RL frameworks like Diff-GRPO (35.0%) and TraceRL (36.5%).
  • Coding Performance: On the execution-based LiveBench coding task, AGDO-RL reached 18.4% accuracy, notably outperforming Diff-GRPO's 15.2%.
  • Efficiency: Crucially, performing the online attention analysis adds negligible overhead, accounting for only 3% of the total rollout time during reinforcement learning iterations.

Limitations and Future Work

  • Full-Attention Constraint: AGDO's current design relies on extracting and analyzing full bidirectional attention matrices. The authors acknowledge that they have not yet explored or validated its performance on block-attention-based dLLMs, which are frequently used to scale models to ultra-long context windows.
  • Future Directions: The team plans to investigate the specific attention characteristics of block-attention dLLMs to design tailored algorithmic variations of AGDO.

Summary updated

BibTeX
@misc{deng2026beyond,
  author = {Jia Deng and Junyi Li and Wayne Xin Zhao and Jinpeng Wang and Hongyu Lu and Ji-Rong Wen},
  title = {{Beyond Fully Random Masking: Attention-Guided Denoising and Optimization for Diffusion Language Models}},
  year = {2026},
  eprint = {2606.12273},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.12273},
}

Loading related content...

Figure