mlsanityData to 7 Oct 2026

DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation

arXiv 2506.20639 ↗First posted 25 Jun 2025cs.CLcited by 184

On the map: Diffusion models → Discrete and text diffusion

Abstract (arXiv)

Diffusion large language models (dLLMs) are compelling alternatives to autoregressive (AR) models because their denoising models operate over the entire sequence. The global planning and iterative refinement features of dLLMs are particularly useful for code generation. However, current training and inference mechanisms for dLLMs in coding are still under-explored. To demystify the decoding behavior of dLLMs and unlock their potential for coding, we systematically investigate their denoising processes and reinforcement learning (RL) methods. We train a 7B dLLM, DiffuCoder, on 130B tokens of code. Using this model as a testbed, we analyze its decoding behavior, revealing how it differs from that of AR models: (1) dLLMs can decide how causal their generation should be without relying on semi-AR decoding, and (2) increasing the sampling temperature diversifies not only token choices but also their generation order. This diversity creates a rich search space for RL rollouts. For RL training, to reduce the variance of token log-likelihood estimates and maintain training efficiency, we propose coupled-GRPO, a novel sampling scheme that constructs complementary mask noise for completions used in training. In our experiments, coupled-GRPO significantly improves DiffuCoder's performance on code generation benchmarks (+4.4% on EvalPlus) and reduces reliance on AR bias during decoding. Our work provides deeper insight into the machinery of dLLM generation and offers an effective, diffusion-native RL training framework. https://github.com/apple/ml-diffucoder.

Key facts. Cited by 184 papers in the map (data through 7 Oct 2026). Placed in Discrete and text diffusion, one of 14 directions in Diffusion models. Builds on 68 of its 80 references that are in the map. First posted on arXiv 25 Jun 2025.

Builds on

68 of 80 references.

Closest ancestors · 20

Same direction, newest first

  1. 2025FlashDLM: Accelerating Diffusion Language Model Inference via Efficient KV Caching and Guided Diffusion27 May
  2. 2025Dimple: Discrete Diffusion Multimodal Large Language Model with Parallel Decoding22 May
  3. 2025dKV-Cache: The Cache for Diffusion Language Models21 May
  4. 2025Reinforcing the Diffusion Chain of Lateral Thought with Diffusion Language Models15 May
  5. 2025Target Concrete Score Matching: A Holistic Framework for Discrete Diffusion23 Apr
  6. 2025Block Diffusion: Interpolating Between Autoregressive and Diffusion Language Models12 Mar
  7. 2025Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions10 Feb
  8. 2024Scaling up Masked Diffusion Models on Text24 Oct
  9. 2024Scaling Diffusion Language Models via Adaptation from Autoregressive Models23 Oct
  10. 2024Beyond Autoregression: Discrete Diffusion for Complex Reasoning and Planning18 Oct
  11. 2024Simple and Effective Masked Diffusion Language Models11 Jun
  12. 2024Simplified and Generalized Masked Diffusion for Discrete Data6 Jun
8 more
  1. 2024Your Absorbing Discrete Diffusion Secretly Models the Conditional Distributions of Clean Data6 Jun
  2. 2024Diffusion of Thoughts: Chain-of-Thought Reasoning in Diffusion Language Models12 Feb
  3. 2023CodeFusion: A Pre-trained Diffusion Model for Code Generation26 Oct
  4. 2023DiffuSeq-v2: Bridging Discrete and Continuous Text Spaces for Accelerated Seq2Seq Diffusion Models9 Oct
  5. 2023PLANNER: Generating Diversified Paragraph via Latent Language Diffusion Model5 Jun
  6. 2023A Reparameterized Discrete Diffusion Model for Text Generation11 Feb
  7. 2022SSD-LM: Semi-autoregressive Simplex-based Diffusion Language Model for Text Generation and Modular Control31 Oct
  8. 2022DiffuSeq: Sequence to Sequence Text Generation with Diffusion Models17 Oct

Other references · 48

  1. 2020Denoising Diffusion Probabilistic Modelscited by 20,851
  2. 2023GPT-4 Technical Reportcited by 18,132
  3. 2017Proximal Policy Optimization Algorithmscited by 14,441
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  5. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  6. 2020Score-Based Generative Modeling through Stochastic Differential Equationscited by 8,964
  7. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
  8. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  9. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  10. 2021Program Synthesis with Large Language Modelscited by 3,509
  11. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  12. 2023Code Llama: Open Foundation Models for Codecited by 2,105
36 more
  1. 2021Structured Denoising Diffusion Models in Discrete State-Spacescited by 1,665
  2. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  3. 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,278
  4. 2024Qwen2.5-Coder Technical Reportcited by 1,151
  5. 2024The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scalecited by 1,104
  6. 2022MaskGIT: Masked Generative Image Transformercited by 1,082
  7. 2022Diffusion-LM Improves Controllable Text Generationcited by 1,006
  8. 2025Does Reinforcement Learning Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?cited by 948
  9. 2023Training Diffusion Models with Reinforcement Learningcited by 939
  10. 2023PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallelcited by 641
  11. 2021Argmax Flows and Multinomial Diffusion: Learning Categorical Distributionscited by 566
  12. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
  13. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  14. 2025The Entropy Mechanism of Reinforcement Learning for Reasoning Language Modelscited by 463
  15. 2025Fast-dLLM: Training-free Acceleration of Diffusion LLM by Enabling KV Cache and Parallel Decodingcited by 404
  16. 2022Analog Bits: Generating Discrete Data using Diffusion Models with Self-Conditioningcited by 362
  17. 2025LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Modelscited by 273
  18. 2024Diffusion Policy Policy Optimizationcited by 255
  19. 2025MMaDA: Multimodal Large Diffusion Language Modelscited by 241
  20. 2025Mercury: Ultra-Fast Language Models Based on Diffusioncited by 225
  21. 2024When Attention Sink Emerges in Language Models: An Empirical Viewcited by 200
  22. 2025Spurious Rewards: Rethinking Training Signals in RLVRcited by 199
  23. 2025ProRL: Prolonged Reinforcement Learning Expands Reasoning Boundaries in Large Language Modelscited by 187
  24. 2025d1: Scaling Reasoning in Diffusion Large Language Models via Reinforcement Learningcited by 178
  25. 2025dLLM-Cache: Accelerating Diffusion Large Language Models with Adaptive Cachingcited by 168
  26. 2025The Unreasonable Effectiveness of Entropy Minimization in LLM Reasoningcited by 160
  27. 2025Llama-Nemotron: Efficient Reasoning Modelscited by 151
  28. 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 127
  29. 2025ACECODER: Acing Coder RL via Automated Test-Case Synthesiscited by 89
  30. 2025LaViDa: A Large Diffusion Language Model for Multimodal Understandingcited by 81
  31. 2025AceReason-Nemotron 1.1: Advancing Math and Code Reasoning through SFT and RL Synergycited by 75
  32. 2023Lemur: Harmonizing Natural Language and Code for Language Agentscited by 71
  33. 2025Teaching Language Models to Critique via Reinforcement Learningcited by 38
  34. 2024Programming Every Example: Lifting Pre-training Data Quality Like Experts at Scalecited by 37
  35. 2025Fine-Tuning Discrete Diffusion Models with Policy Gradient Methodscited by 36
  36. 2025Unifying Autoregressive and Diffusion-Based Sequence Generationcited by 17

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 78; 2026: 106.

184 papers.

Sort:

By area:

  1. 2025A Survey of Reinforcement Learning for Large Reasoning Modelscited by 175
  2. 2025SDAR: A Synergistic Diffusion-AutoRegression Paradigm for Scalable Sequence Generationcited by 118
  3. 2025Dream-Coder 7B: An Open Diffusion Language Model for Codecited by 81
  4. 2025A Survey on Diffusion Language Modelscited by 75
  5. 2025dParallel: Learnable Parallel Decoding for dLLMscited by 59
  6. 2025LLaDA-MoE: A Sparse MoE Diffusion Language Modelcited by 54
  7. 2025Any-Order Flexible Length Masked Diffusioncited by 48
  8. 2025Your LLM Knows the Future: Uncovering Its Multi-Token Prediction Potentialcited by 46
  9. 2025Diffusion Language Models are Super Data Learnerscited by 45
  10. 2025ParallelBench: Understanding the Trade-offs of Parallel Decoding in Diffusion LLMscited by 42
  11. 2025Fine-Tuning Masked Diffusion for Provable Self-Correctioncited by 39
  12. 2025DPad: Efficient Diffusion Language Models with Suffix Dropoutcited by 38
38 more
  1. 2025Time Is a Feature: Exploiting Temporal Dynamics in Diffusion Language Modelscited by 33
  2. 2025The Devil behind the mask: An emergent safety vulnerability of Diffusion LLMscited by 32
  3. 2025Continuously Augmented Discrete Diffusion model for Categorical Generative Modelingcited by 32
  4. 2025AdaBlock-dLLM: Semantic-Aware Diffusion LLM Inference via Adaptive Block Sizecited by 30
  5. 2025Improving Reasoning for Diffusion Language Models via Group Diffusion Policy Optimizationcited by 30
  6. 2025Principled RL for Diffusion LLMs Emerges from a Sequence-Level Perspectivecited by 30
  7. 2025Efficient-DLM: From Autoregressive to Diffusion Language Models, and Beyond in Speedcited by 30
  8. 2025Learning Unmasking Policies for Diffusion Language Modelscited by 29
  9. 2025Coevolutionary Continuous Discrete Diffusion: Make Your Diffusion Language Model a Latent Reasonercited by 28
  10. 2025A Survey on Parallel Text Generation: From Parallel Decoding to Diffusion Language Modelscited by 27
  11. 2025d2: Improving Reasoning in Diffusion Language Models via Trajectory Likelihood Estimationcited by 27
  12. 2026ELF: Embedded Language Flowscited by 27
  13. 2025SpecDiff-2: Scaling Diffusion Drafter Alignment For Faster Speculative Decodingcited by 26
  14. 2025Set Block Decoding is a Language Model Inference Acceleratorcited by 22
  15. 2025Diffusion LLM with Native Variable Generation Lengths: Let [EOS] Lead the Waycited by 22
  16. 2025From Next-Token to Next-Block: A Principled Adaptation Path for Diffusion LLMscited by 22
  17. 2025Structuring The Future: Diffusion LLM Speculative Decoding via Calibrated Draft Graphscited by 21
  18. 2025Training Optimal Large Diffusion Language Modelscited by 21
  19. 2025CDLM: Consistency Diffusion Language Models For Faster Samplingcited by 20
  20. 2026Nemotron-Labs-Diffusion: A Tri-Mode Language Model Unifying Autoregressive, Diffusion, and Self-Speculation Decodingcited by 19
  21. 2025Dream-VL & Dream-VLA: Open Vision-Language and Vision-Language-Action Models with Diffusion Language Model Backbonecited by 18
  22. 2025DiFFPO: Training Diffusion LLMs to Reason Fast and Furious via Reinforcement Learningcited by 17
  23. 2025LoPA: Scaling dLLM Inference via Lookahead Parallel Decodingcited by 17
  24. 2025Inpainting-Guided Policy Optimization for Diffusion Large Language Modelscited by 16
  25. 2025Exploring the Potential of Diffusion Large Language Models in Code Generationcited by 16
  26. 2025FS-DFM: Fast and Accurate Long Text Generation with Few-Step Diffusion Language Modelscited by 16
  27. 2026DreamOn: Diffusion Language Models For Code Infilling Beyond Fixed-size Canvascited by 16
  28. 2025Enhancing Reasoning for Diffusion LLMs via Distribution Matching Policy Optimizationcited by 15
  29. 2025Soft-Masked Diffusion Language Modelscited by 15
  30. 2025Lookahead Unmasking Elicits Accurate Decoding in Diffusion Language Modelscited by 15
  31. 2025d-TreeRPO: Towards More Reliable Policy Optimization for Diffusion Language Modelscited by 14
  32. 2026DMax: Aggressive Parallel Decoding for dLLMscited by 14
  33. 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammarscited by 13
  34. 2025TR2-D2: Tree Search Guided Trajectory-Aware Fine-Tuning for Discrete Diffusioncited by 13
  35. 2025Saber: An Efficient Sampling with Adaptive Acceleration and Backtracking Enhanced Remasking for Diffusion Language Modelcited by 13
  36. 2025Parallel Sampling from Masked Diffusion Models via Conditional Independence Testingcited by 13
  37. 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
  38. 2026Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Modelcited by 12

50 most cited of 184 All 184 (JSON)

Similar, not cited

Close in wording, no citation either way

  1. 2026Accelerating Masked Diffusion Large Language Models: A Survey of Efficient Inference Techniques
  2. 2026Diffusion Language Models: An Experimental Analysis
  3. 2026Understanding Evaluation Illusion in Diffusion Large Language Models
  4. 2025Discrete Diffusion in Large Language and Multimodal Models: A Survey
  5. 2026Optimizing Denoising Trajectories in dLLMs: A Lightweight Evolutionary Heuristic Approach
  6. 2026CAI-DLLM: Convergence Aware Inference for Diffusion Language Models
  7. 2026Roll Out and Roll Back: Diffusion LLMs are Their Own Efficiency Teachers
  8. 2026Dynamic-dLLM: Dynamic Cache-Budget and Adaptive Parallel Decoding for Training-Free Acceleration of Diffusion LLM