d1: Scaling Reasoning in Diffusion Large Language Models via Reinforcement Learning

Siyan Zhao, Devaansh Gupta, Qinqing Zheng, Aditya Grover

Abstract

While autoregressive (AR) Large Language Models have demonstrated significant reasoning capabilities through post-training reinforcement learning (RL), non-autoregressive Diffusion Large Language Models (dLLMs) have lagged in this area. This paper introduces d1, a framework designed to scale reasoning in dLLMs. By utilizing a two-stage pipeline consisting of Supervised Finetuning (SFT) and a novel RL algorithm termed diffu-GRPO, we demonstrate that dLLMs can achieve emergent self-correction behaviors and substantial performance gains across mathematical, logical, and coding benchmarks. Our approach leverages a one-step log-probability estimator and random prompt masking to overcome the computational hurdles of applying RL to diffusion processes.

1. Introduction

The current landscape of reasoning models, exemplified by systems like OpenAI’s o1 and DeepSeek-R1, is dominated by autoregressive architectures that predict tokens sequentially. Recently, masked diffusion LLMs (dLLMs) such as LLaDA have emerged as a compelling alternative, generating text through iterative refinement of the entire sequence. Despite their potential, dLLMs have lacked a robust framework for reinforcement learning, which has been the primary driver for reasoning breakthroughs in AR models. The d1 framework addresses this gap, providing the first systematic approach to scaling reasoning in dLLMs via RL.

2. The Challenge of RL in Diffusion Models

In standard AR models, calculating the log-probability of a sequence is straightforward due to sequential factorization. In contrast, dLLMs generate text non-sequentially. Calculating the exact log-probability of a generated sequence in a diffusion model typically requires simulating the entire reverse diffusion process, which is computationally prohibitive for RL algorithms like Proximal Policy Optimization (PPO) or Group Relative Policy Optimization (GRPO). This "computational ruin" has historically prevented dLLMs from benefiting from large-scale preference or rule-based training.

3. The d1 Framework

The d1 framework employs a two-stage post-training process to instill and then scale reasoning capabilities.

3.1 Supervised Finetuning (SFT)

The model is first initialized with a small but high-quality dataset of reasoning traces. Using the s1k dataset—comprising 1,000 expert-level reasoning chains—the model learns the basic structure of step-by-step problem solving. This stage provides the necessary "warm start" for the subsequent RL phase.

3.2 diffu-GRPO: Reinforcement Learning for dLLMs

The core innovation of d1 is diffu-GRPO, an adaptation of the GRPO algorithm specifically for diffusion architectures. It incorporates three key technical advancements:

  • Critic-Free Advantage Estimation: Following the GRPO paradigm, the algorithm uses group statistics to estimate advantages, removing the need for a separate, memory-intensive critic model.
  • One-Step Log-Probability Estimation: To bypass the iterative cost of diffusion, the authors utilize a mean-field approximation. This allows for the estimation of sequence log-probabilities in a single forward pass, making the gradient updates feasible.
  • Random Prompt Masking: During RL training, the model randomly masks tokens within the input prompt. This serves as a powerful regularization tool and data augmentation technique. Unlike AR models, which often overfit if the same prompt is used for multiple gradient updates, dLLMs with random masking can perform significantly more updates per batch (up to 24), drastically increasing training efficiency.

4. Experimental Results

The d1 framework was evaluated using LLaDA-8B-Instruct as the base model across several challenging domains.

4.1 Mathematical and Logical Reasoning

On the GSM8K benchmark, d1-LLaDA improved accuracy from 78.2% to 82.1%. The gains were even more pronounced in complex planning tasks. In 4x4 Sudoku, performance nearly doubled from 11.7% to 22.1%. In the combinatorial arithmetic game Countdown, the model saw a massive leap from 20.7% to 42.2%, demonstrating a superior ability to explore and refine solution spaces.

4.2 Coding and Efficiency

In coding tasks (HumanEval and MBPP), the addition of diffu-GRPO provided a nearly 10% boost in accuracy over the SFT-only baseline at shorter sequence lengths. Furthermore, the random masking technique proved essential for wall-clock efficiency, allowing the model to reach peak performance levels much faster than fixed-masking baselines.

5. Discussion: The "Aha Moment"

A notable finding is the emergence of the "aha moment" in dLLMs. When trained with diffu-GRPO and allowed longer sequence lengths (e.g., 512 tokens), the model begins to exhibit self-correction. It will frequently start a solution, recognize an error through its bidirectional context, and backtrack to refine its logic. This behavior suggests that the iterative nature of diffusion is naturally suited for the "thinking" process required for complex reasoning, provided it is properly incentivized through RL.

6. Limitations and Future Work

Despite its success, d1 faces certain constraints. Current dLLMs often operate with fixed sequence lengths, which can limit the depth of the "Chain of Thought" compared to the variable-length outputs of AR models. Additionally, while training is now efficient, inference speed remains a challenge due to the iterative decoding process. Future research will focus on scaling d1 to larger base models and developing faster inference strategies to fully realize the potential of diffusion-based reasoning.

7. Conclusion

The d1 framework and diffu-GRPO represent a significant milestone in non-autoregressive modeling. By enabling efficient RL for dLLMs, this work proves that reasoning is not exclusive to sequential prediction. The ability of d1-LLaDA to self-correct and outperform its predecessors in math and logic opens a new path for developing robust, bidirectional reasoning agents.

Summary updated

BibTeX
@inproceedings{zhao2025d,
  author = {Siyan Zhao and Devaansh Gupta and Qinqing Zheng and Aditya Grover},
  title = {{d1: Scaling Reasoning in Diffusion Large Language Models via Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=7ZVRlBFuEv},
}
Figure