Skip to content
AI.info

Research

UnMaskFork: Test-Time Scaling for Masked Diffusion via Deterministic Action Branching

UnMaskFork: Test-Time Scaling for Masked Diffusion via Deterministic Action Branching Overview Research area: Machine learning; inference-time (test-time) scaling for Masked Diffusion Language Models

UnMaskFork: Test-Time Scaling for Masked Diffusion via Deterministic Action Branching
arXiv
2602.04344
Published
2026-02-04
Authors
Kou Misaki, Takuya Akiba

AI summary

UnMaskFork: Test-Time Scaling for Masked Diffusion via Deterministic Action Branching

Overview

Research area: Machine learning; inference-time (test-time) scaling for Masked Diffusion Language Models (MDLMs), specifically Monte Carlo Tree Search over unmasking trajectories for code generation and mathematical reasoning.

Technical level: Advanced. The paper assumes familiarity with masked diffusion language models, Monte Carlo Tree Search (MCTS), UCT scoring, number of function evaluations (NFE) as a compute budget, and ELBO/KL-divergence decompositions of diffusion reverse kernels.

Scope: One sentence: the paper proposes UnMaskFork (UMF), an MCTS-based test-time scaling framework that treats the choice among multiple pretrained MDLMs and deterministic inference configurations as discrete search actions, and shows that this beats Best-of-N and diffusion tree search baselines on coding benchmarks under matched NFE budgets.

What This Paper Is About

Test-time scaling works well for autoregressive LLMs, typically by increasing temperature and running Best-of-N or tree search, but the authors find that this standard recipe is ineffective for Masked Diffusion Language Models: raising temperature across the whole unmasking schedule increases diversity while degrading generation quality, because early stochastic errors propagate through later denoising steps and cause irreversible structural defects. The goal of the paper is to derive exploration diversity from structural variation instead of stochastic noise, by formulating the unmasking trajectory as a search tree whose branches are deterministic actions (different pretrained MDLMs, temperatures, and remasking strategies) optimized by MCTS under a fixed NFE budget.

Key Contributions

  1. Empirical demonstration that temperature-based stochastic scaling is inefficient for MDLMs. The authors show across coding benchmarks that increasing temperature across the entire unmasking schedule degrades generation quality, so the added diversity does not translate into performance gains in the budget regimes tested, and randomized remasking degrades performance further.

  2. The UMF framework. UMF casts masked diffusion inference as a search tree over unmasking trajectories, where an action is a tuple (model parameters θ_a, temperature T_a, remasking strategy g_a), and MCTS selects among actions using UCT. Because low-temperature, deterministic remasking makes transitions deterministic, UMF caches partial unmasking states and rollout rewards so that revisiting a state-action pair costs zero effective NFE.

  3. Reporting that UMF outperforms Best-of-N, DTS, and AB-MCTS on coding benchmarks.* UMF is evaluated on LiveCodeBench, HumanEval+, and MBPP+ against 28 baseline configurations, and also on the MATH dataset (105 problems) with a process reward model.

  4. An analysis (theoretical and empirical) of why deterministic multi-model branching beats stochastic diversity, framed as adaptive kernel selection with a sum-of-minimums inequality, plus a variance argument that stochastic rollouts require m ∝ Var[R]/ε² samples while deterministic rollouts need only a single rollout (m = 1).

Main Findings

  • UMF leads at NFE = 12288 on coding (Table 1): UMF reaches Pass@1 of 28.0 on LiveCodeBench, 88.0 on HumanEval+, and 72.0 on MBPP+. The strongest baseline, AB-MCTS (DCoder+LLaDA), scores 21.0 / 81.0 / 68.0; BoN Pair (DCoder+LLaDA) scores 19.0 / 75.0 / 66.0; DTS* Pair (DCoder+LLaDA) scores 18.0 / 75.0 / 68.0.

  • Random remasking is the worst-performing strategy family: BoN with LLaDA + random remasking reaches 2.0 / 23.0 / 29.0 and DTS* with LLaDA + random remasking reaches 1.0 / 27.0 / 31.0 at NFE = 12288.

  • Caching produces real gains (Table 3, LiveCodeBench): without cache versus with cache, Pass@1 is 18.0 vs. 18.0 at NFE = 768, 19.0 vs. 19.0 at 1536, 21.0 vs. 22.0 at 3072 (+4.76%, cache hit rate 47.8%, 2108 NFEs saved), 23.0 vs. 24.0 at 6144 (+4.35%, hit rate 54.5%, 6375 NFEs saved), and 26.0 vs. 28.0 at 12288 (+7.69%, hit rate 55.8%, 14186 NFEs saved).

  • Scaling continues past the main budget: extending LiveCodeBench to NFE = 24576 gives Pass@1 of 30.0%, a +2.0 point improvement over the 12288 result.

  • MATH results (Table 2, 105 problems): Pass@1 is 49.52 at NFE = 768, 52.38 at 1536, 53.33 at 3072, 59.05 at 6144, and 60.95 at 12288, described as an 11.43 point improvement at NFE = 12288.

  • Model diversity is the strongest action type (Table 4, NFE = 12288): model actions (Dream-Coder, LLaDA) give 28.0 / 88.0 / 72.0; temperature (T = 0.1, 1.0) gives 27.0 / 82.0 / 71.0; temperature (T = 0.1, 0.5) gives 24.0 / 79.0 / 69.0; remask (entropy, origin) gives 20.0 / 82.0 / 68.0. The best single-model UMF variant in Table 4 achieves a 60.0% average Pass@1 across the three coding benchmarks.

  • Interleaving models inside one trajectory beats independent per-model runs (Table 5): Pair of 1-model UMFs scores 24.0 / 78.0 / 69.0; UMF (2 models) scores 28.0 / 88.0 / 72.0; UMF (3 models, adding DiffuCoder-cpGRPO) scores 32.0 / 87.0 / 76.0, raising the average coding score from 62.7 to 65.0.

  • UMF is compatible with block diffusion decoding: Appendix A.2 reports that UMF improves LiveCodeBench Pass@1 from 19.0% to 31.0%.

  • Tokenizer switching is not disruptive: on 100 LiveCodeBench problems at NFE = 3072, the average relative length change from re-tokenizing already-generated text was 1.09%, and with a maximum search depth of 7 the tokenizer is swapped at most 6 times across a 768-step generation.

  • A qualitative case study shows a LiveCodeBench problem solved only after scaling to NFE = 12288, where Dream-Coder outlines implementation steps, LLaDA fills in specific requirements and begins the core implementation, and Dream-Coder refines and completes it.

Methodology in Plain English

The researchers start from the observation that MDLMs generate text by iteratively replacing mask tokens with real tokens, which means the generation path can be represented as a tree rather than a single left-to-right stream. They build that tree explicitly. Each node is a partially masked sequence at a particular residual mask ratio, and each branch is an action: pick a specific pretrained model (Dream-Coder, LLaDA, or others), a temperature, and a remasking strategy. The mask-ratio schedule used is [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.2], sampling more often early to keep trajectories diverse, with a maximum search depth of 7.

The search loop is standard MCTS: Select a node using UCT (with exploration coefficient c_exp = 1), Expand by picking an unexplored action and unmasking down to the next scheduled ratio, then roll out deterministically to a fully unmasked sequence, score it with a reward signal, and Backup the reward to the node and its ancestors. Because the decoding is near-greedy (temperature ≈ 0 with a deterministic remasking rule), a state-action pair always produces the same result, so intermediate nodes and rewards are stored in a cache. If a later expansion reaches a cached pair, the answer is retrieved at zero NFE cost. Compute is budgeted in NFE (number of model forward passes), with one token unmasked per function evaluation and a fixed 768-token generation window.

When two models with different tokenizers are mixed, special tokens (MASK, EoS, Pad) are mapped directly and non-special text spans are decoded with the source tokenizer and re-encoded with the target tokenizer. Evaluation uses 100 samples each from LiveCodeBench, HumanEval+, and MBPP+ for code (reward = proportion of passed tests on public/standard test cases, final scoring on private and extended test sets), and 105 MATH problems (15 from each of 7 categories) with Qwen2.5-Math-PRM-7B as the reward model and math_verify for answer extraction.

Why This Matters

Impact on research. The paper challenges the default assumption that more randomness equals better test-time scaling. It provides an empirical and analytical case that for non-autoregressive masked diffusion models, the right axis of exploration is structural (which model, which deterministic configuration) rather than thermal, and that deterministic transitions unlock caching, which changes the economics of tree search at fixed NFE. It also introduces a concrete way to combine heterogeneous pretrained MDLMs inside a single trajectory, including a tokenizer-bridging procedure.

Real-world applications (as motivated by the paper):

  • Programming assistance, where the paper's coding benchmarks (LiveCodeBench, HumanEval+, MBPP+) are directly representative.
  • Formalized problem solving and mathematical reasoning, covered by the MATH evaluation.
  • Scientific computing workflows, listed in the impact statement among correctness-sensitive settings.
  • Deployment scenarios where a fixed inference budget must be respected, since UMF's caching lets practitioners trade NFE for accuracy with an explicit, reportable budget.

Industry relevance. The method targets accuracy improvement at inference time without additional training or fine-tuning, which matters to teams serving diffusion-based language models under latency and cost constraints. The identification of a ~50% cache hit rate at NFE ≥ 3072 is an operational lever: it means part of the search cost is recovered rather than spent. The impact statement also flags that test-time scaling raises energy consumption, latency, and cost, and may widen access disparities between users with different compute resources.

Future Directions

  1. Learned search guidance. The authors propose training a policy network or value function to guide the tree search, moving beyond heuristic-based UCT for greater sample efficiency.

  2. Dynamic action spaces. Adapting the set of candidate models or unmasking schedules to the difficulty of the individual instance, to better optimize the trade-off between computational cost and reasoning depth.

  3. Broader reward signals and domains. UMF's MATH results are qualified as depending on a valid reward signal existing; extending to other reasoning tasks with reliable verification is an open direction.

  4. Safety and evaluation practice. The impact statement recommends reporting inference budgets, evaluating on safety-oriented benchmarks alongside capability gains, and pairing deployment with sandboxing, static analysis, content filters, logging, and rate limiting.

Target Audience

This paper is most valuable to researchers and engineers working on masked diffusion language models, inference-time compute scaling, and MCTS or tree-search decoding; to practitioners who need to improve code-generation or math-reasoning accuracy under a fixed inference budget without retraining; and to readers interested in the theoretical framing of inference as adaptive reverse-kernel selection.

Authors’ abstract

Test-time scaling strategies have effectively leveraged inference-time compute to enhance the reasoning abilities of Autoregressive Large Language Models. In this work, we demonstrate that Masked Diffusion Language Models (MDLMs) are inherently amenable to advanced search strategies, owing to their iterative and non-autoregressive generation process. To leverage this, we propose UnMaskFork (UMF), a framework that formulates the unmasking trajectory as a search tree and employs Monte Carlo Tree Search to optimize the generation path. In contrast to standard scaling methods relying on stochastic sampling, UMF explores the search space through deterministic partial unmasking actions performed by multiple MDLMs. Our empirical evaluation demonstrates that UMF consistently outperforms existing test-time scaling baselines on complex coding benchmarks, while also exhibiting strong scalability on mathematical reasoning tasks.

Read the original paper