DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation
Shansan Gong, Ruixiang Zhang, Huangjie Zheng, Jiatao Gu, Navdeep Jaitly, Lingpeng Kong, Yizhe Zhang
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 69 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Models 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Models 引用了 Denoising Diffusion Probabilistic Models
- Revolutionizing Reinforcement Learning Framework for Diffusion Large Language Models 引用了 LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Models
- Revolutionizing Reinforcement Learning Framework for Diffusion Large Language Models 引用了 Denoising Diffusion Probabilistic Models
- Any-Order Flexible Length Masked Diffusion 引用了 Denoising Diffusion Probabilistic Models
- Diffusion-LM Improves Controllable Text Generation 引用了 Denoising Diffusion Probabilistic Models
- ParallelBench: Understanding the Trade-offs of Parallel Decoding in Diffusion LLMs 引用了 LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Models
- ParallelBench: Understanding the Trade-offs of Parallel Decoding in Diffusion LLMs 引用了 Diffusion-LM Improves Controllable Text Generation
- dParallel: Learnable Parallel Decoding for dLLMs 引用了 LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Models
- dParallel: Learnable Parallel Decoding for dLLMs 引用了 Revolutionizing Reinforcement Learning Framework for Diffusion Large Language Models
- dParallel: Learnable Parallel Decoding for dLLMs 引用了 Denoising Diffusion Probabilistic Models
引用它的顶会 Paper69
- LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion ModelsFengqi Zhu, Rongzhen Wang, Shen Nie, Xiaolu Zhang 等ACL 2026 · 229 次引用
- Revolutionizing Reinforcement Learning Framework for Diffusion Large Language ModelsYinjie Wang, Ling Yang, Bowen Li, Ye Tian 等ICLR 2026 · 79 次引用
- dParallel: Learnable Parallel Decoding for dLLMsZigeng Chen, Gongfan Fang, Xinyin Ma, Ruonan Yu 等ICLR 2026 · 64 次引用
- Any-Order Flexible Length Masked DiffusionJaeyeon Kim, Cheuk Lee Kit, Carles Domingo-Enrich, Yilun Du 等ICLR 2026 · 51 次引用
- ParallelBench: Understanding the Trade-offs of Parallel Decoding in Diffusion LLMsWonjun Kang, Kevin Galim, Seunghyuk Oh, Minjae Lee 等ICLR 2026 · 49 次引用
它引用的 Paper41
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 次引用
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning 等NeurIPS 2023 · 10,924 次引用
- Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code GenerationJiawei Liu, Chunqiu Steven Xia, Yuyao Wang, Lingming ZhangNeurIPS 2023 · 2,317 次引用
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
- Diffusion-LM Improves Controllable Text GenerationXiang Lisa Li, John Thickstun, Ishaan Gulrajani, Percy Liang 等NeurIPS 2022 · 1,546 次引用
相关 Paper
- TA-GRPO-d: Trajectory-Aware GRPO for Optimizing Denoising Trajectories in Diffusion LLMsGyunyeop Kim, Sangwoo KangACL 2026
- Principled RL for Diffusion LLMs Emerges from a Sequence-Level PerspectiveJingyang Ou, Jiaqi Han, Minkai Xu, Shaoxuan Xu 等ICLR 2026 · 33 次引用
- Learning Unmasking Policies for Diffusion Language ModelsMetod Jazbec, Theo X. Olausson, Louis Béthune, Pierre Ablin 等ICML 2026 · 24 次引用
- d1: Scaling Reasoning in Diffusion Large Language Models via Reinforcement LearningSiyan Zhao, Devaansh Gupta, Qinqing Zheng, Aditya GroverNeurIPS 2025 · 191 次引用
- The Flexibility Trap: Rethinking the Value of Arbitrary Order in Diffusion Language ModelsZanlin Ni, Shenzhi Wang, Yang Yue, Tianyu Yu 等ICML 2026 · 4 次引用
