NI Sampling++: Optimizing Token Order for Fast Discrete Diffusion Sampling with Reinforcement Learning

Enshu Liu, Theodore Zhengde Zhao, Xuefei Ning, Zinan Lin, Yu WangCOLM 2026

Discrete Diffusion Language Models (dLLMs) are the "parallel" cousins of the standard autoregressive (AR) models like GPT-4. While AR models must generate text one token at a time, left-to-right, dLLMs can theoretically fill in the blanks anywhere in a sequence simultaneously. However, the million-dollar question is: which tokens should you fill in first to get the best result in the fewest steps?

TL;DR

NI Sampling++ uses Reinforcement Learning (RL) to discover the optimal order for generating tokens in discrete diffusion models. By moving beyond simple heuristics and supervised "proxy" targets, it achieves up to a 9.7× speedup over standard sampling and nearly 2× the speed of previous state-of-the-art methods, all while maintaining or even improving generation accuracy.

What Problem Does This Paper Address?

Standard Large Language Models (LLMs) are slow because they are autoregressive—they generate token $N+1$ only after finishing token $N$. Masked Diffusion Models (MDMs) offer a way out: they start with a sequence of [MASK] tokens and iteratively refine them into text.

The challenge is the sampling order. If you try to unmask too many tokens at once (parallel decoding), the model loses "coherence" because tokens are generated without knowing what their neighbors are doing. Early methods used simple heuristics (like unmasking the most confident tokens), but these are often suboptimal. A recent method, NI Sampling, trained a "neural indicator" to predict a specific human-designed order. However, that human-designed order isn't necessarily the fastest or most accurate one possible. There is a massive, super-exponential space of potential decoding orders that supervised learning simply cannot explore.

Methods

The authors propose NI Sampling++, which treats token selection as a Markov Decision Process (MDP) and uses Reinforcement Learning to explore the space of decoding strategies.

  1. MDP Reformulation: At each step, a lightweight "neural indicator" (a tiny transformer) looks at the current masked sequence and assigns an "unmasking probability" to every masked position. Instead of a hard threshold, they use stochastic Bernoulli trials during training to encourage exploration.
  2. GRPO Optimization: They employ Group Relative Policy Optimization (GRPO). For every prompt, the model generates a group of different decoding trajectories. It then compares them: trajectories that are both correct and fast get a higher relative reward.
  3. Efficiency-Aware Reward: The reward function balances two things:
  4. Correctness: A +1/-1 reward based on whether the final answer (e.g., a math solution or code block) is correct.
  5. Speed: A penalty for every extra step taken, though they use a "step threshold" to prevent the model from becoming too aggressive and sacrificing quality for raw speed.
  6. Training Stability: To make RL work on such a complex task, they initialize the model with weights from the supervised NI Sampling and use a "mid-start rollout" strategy, where the model starts generating from a halfway-finished sequence rather than a blank slate every time.
Figure 1: Overview of NI Sampling++ training pipeline. (a) The reinforcement learning loop. For each input query, NI Sampling++ generates multiple trajectories guided by the neural indicator. These trajectories are then evaluated via a reward function to facilitate GRPO-based policy optimization. (b) The unmasking policy within a single NI Sampling++ step. The neural indicator assigns a score to each masked token, representing its unmasking probability. For each position, the decision to unmask is determined stochastically and independently.

Datasets

The researchers evaluated their method on four major reasoning and coding benchmarks:

  • GSM8K & MATH: Standard benchmarks for multi-step mathematical reasoning.
  • HumanEval & MBPP: Popular benchmarks for Python code generation.
  • Models: They tested across the LLaDA family (8B-Instruct, 1.5, and 2.0-mini), showing the method generalizes across different model scales.

Key Insights and Ideas

  • Beyond Human Intuition: The "aha moment" here is that the optimal decoding order isn't always left-to-right or even "easiest to hardest." By using RL, the model discovers non-obvious orders that humans wouldn't think to program as a heuristic.
  • Embracing "Disorder": Analysis showed that NI Sampling++ generates many "late-positioned" tokens much earlier than standard methods. It learns that some future tokens are highly predictable even with minimal context, and filling them in early provides a stable anchor for the rest of the sequence.
  • Architecture Matters: Replacing a simple MLP indicator with a two-layer Transformer significantly improved performance. Even though it's slightly larger, its inference cost remains negligible (around 3-5ms) compared to the massive 8B parameter base model.

Key Results

The results show a dominant shift in the Pareto frontier of the step-accuracy trade-off:

  • Massive Speedups: On the MBPP-512 benchmark, it achieved a 9.7× acceleration compared to full-step sampling.
  • Outperforming Baselines: It is up to 1.96× faster than the original NI Sampling while maintaining the same accuracy level.
  • Quality Gains: In some cases, like HumanEval-512, the RL-optimized sampling actually outperformed the full-step baseline in accuracy (37.20 vs 35.37) while being 8.4× faster. This suggests that the "right" order can actually help the model reason better.
Trade-off curves showing NI Sampling++ (red) consistently requiring fewer steps for higher accuracy compared to baselines.

Limitations and Future Work

  • Verifiable Rewards: Currently, the method relies on "verifiable rewards" (is the math answer right? does the code pass tests?). Applying this to open-ended creative writing, where "correctness" is subjective, would require a different reward mechanism, perhaps using an LLM-as-a-judge.
  • Training Cost: While inference is fast, RL training requires generating many trajectories (rollouts), which is computationally intensive compared to supervised learning.
  • Fixed Generation Length: The current experiments often assume a fixed generation length for the indicator; future work could look into more dynamic length handling.

Summary updated

BibTeX
@inproceedings{liu2026ni,
  author = {Enshu Liu and Theodore Zhengde Zhao and Xuefei Ning and Zinan Lin and Yu Wang},
  title = {{NI Sampling++: Optimizing Token Order for Fast Discrete Diffusion Sampling with Reinforcement Learning}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=i8zK3IfxyC},
}
Figure