Where-to-Unmask: Ground-Truth-Guided Unmasking Order Learning for Masked Diffusion Language Models

Hikaru Asano, Tadashi Kozuno, Kuniaki Saito, Yukino BabaarXiv 2026

TL;DR

Masked Diffusion Language Models (MDLMs) generate text by iteratively filling in blanks, but deciding which blank to fill first (the unmasking order) is typically left to simple heuristics. This paper introduces Gt-Margin, a ground-truth-guided metric that establishes an optimal "easy-to-hard" unmasking sequence, and uses it to train a supervised planning module. This plug-and-play planner significantly boosts reasoning performance on complex tasks without altering the underlying text-generation model.

What Problem Does This Paper Address?

Unlike standard autoregressive models (like GPT) that generate text strictly from left to right, Masked Diffusion Language Models (MDLMs) can fill in tokens in any arbitrary order. This non-monotonic flexibility makes them highly promising for tasks like text editing, infilling, and complex logical reasoning.

However, every generation step in an MDLM requires two coupled decisions:

  1. What-to-unmask: Which token belongs in a given blank?
  2. Where-to-unmask: Which blank should be filled next?

While standard MDLM training directly optimizes token prediction (what-to-unmask), the choice of where-to-unmask at inference time usually relies on brittle uncertainty heuristics (e.g., picking the position the model feels most confident about). If the model makes a wrong choice early on, it commits to an incorrect token, causing errors to cascade through the rest of the text. Existing methods try to fix this using Reinforcement Learning, but they require computationally expensive on-policy rollouts. This paper tackles the challenge of efficiently learning an optimal unmasking order using direct supervision from ground-truth data.

Methods

The authors break their approach down into two main steps: defining an "oracle" unmasking order and training a deployable planner to mimic it.

1. Gt-Margin (The Oracle Signal)

To find the ideal unmasking sequence, the authors ask: If we already know the correct answer, what order should we follow? They define Gt-Margin as the difference between the model's probability for the correct (ground-truth) token and its highest alternative at a given position.

  • A large positive margin means the correct token clearly dominates, making it safe to unmask.
  • A low or negative margin indicates ambiguity, suggesting the model should wait for more context.

Ranking positions from largest to smallest margin creates an "easy-to-hard" oracle unmasking trajectory.

2. Learning an Oracle-Guided Planner

Because ground-truth tokens aren't available during actual inference, the authors train a separate, lightweight Unmasking Ordering Planner.

Overview of learning an oracle-guided unmasking ordering planner.
  • Input Representation: The planner takes the prompt and the partially masked sequence, augmented by a "hypothesis" text where blanks are filled with the token model's current top predictions.
  • Objective: Formulated as a learning-to-rank (LTR) problem, the planner is trained using a listwise PiRank loss to score masked positions so that their ranking matches the easy-to-hard sequence discovered by the Gt-Margin oracle.
  • Partial-Plan Decoding: At inference time, the planner is plugged in to guide the unmasking choices. Crucially, it is only used during the first half of generation (the high-uncertainty phase) before switching to standard heuristics, which saves compute while retaining performance.

Datasets

The method was evaluated on four challenging benchmarks where generation order heavily impacts the trajectory:

  • GSM8K: Grade-school math word problems.
  • MATH: Competition-level mathematics problems (high variance and long reasoning chains).
  • StrategyQA: Commonsense reasoning questions requiring multi-step strategies.
  • Sudoku 9×9: Highly structured puzzle-solving based on exact-match constraints.

The base models used for evaluation were LLaDA-8B and Dream-7B.

Key Insights and Ideas

  • Early Steps are Make-or-Break: Through perturbation experiments, the authors discovered that messing up the unmasking order in the first 10–20% of generation steps drastically destroys final accuracy. Conversely, late-stage mistakes matter very little. This justifies their Partial-Plan Decoding strategy.
  • Jumping beats walking: Standard heuristics often collapse into a rigid, pseudo-autoregressive left-to-right generation schedule. In contrast, the Gt-Margin oracle frequently makes non-local "jumps" across the sequence to resolve contextually easy tokens first, building a reliable framework of anchor tokens before filling in the hardest details.

Key Results

The supervised planner consistently outperformed standard inference heuristics across logical reasoning tasks without altering the base language model's weights:

  • GSM8K: On LLaDA-8B, switching from the standard Margin heuristic to the learned Planner boosted exact-match accuracy from 60.5% to 70.5% (the theoretical oracle ceiling was 84.5%).
  • MATH: Accuracy rose from 18.0% to 28.5% using the planner.
  • Sudoku 9×9: While the Gt-Margin oracle achieved near-perfect accuracy (99.5%), the trained planner struggled to capture this behavior (dropping to 8.5%). This highlights that distilling oracle orders for rigidly structured, combinatorial tasks remains a difficult challenge.

Limitations and Future Work

  • Combinatorial Constraints: The planner failed to generalize well on Sudoku, indicating that the current architecture struggles to learn exact, rule-bound structural dependencies purely from listwise ranking supervision.
  • Fixed Completion Length: The controlled decoding setup relies on a pre-determined, dataset-specific fixed completion length ($L$), which limits its immediate applicability to open-ended generation where the output length is highly variable.
  • Future Directions: The authors suggest exploring joint training of the token prediction model and the planner, as well as adapting the framework to handle variable-length generation dynamically.

Summary updated

BibTeX
@misc{asano2026where,
  author = {Hikaru Asano and Tadashi Kozuno and Kuniaki Saito and Yukino Baba},
  title = {{Where-to-Unmask: Ground-Truth-Guided Unmasking Order Learning for Masked Diffusion Language Models}},
  year = {2026},
  eprint = {2602.09501},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.09501},
}
Figure