Exploring the Potential of Diffusion Large Language Models in Code Generation
Not on the map. Why?
Abstract (arXiv)
LLMs have become the mainstream approaches to code generation. Existing LLMs mainly employ autoregressive generation, i.e. generating code token-by-token from left to right. However, the underlying autoregressive generation has two limitations in code generation. First, autoregressive LLMs only generate a token at each step, showing low efficiency in practice. Second, programming is a non-sequential process involving back-and-forth editing, while autoregressive LLMs only employ the left-to-right generation order. These two intrinsic limitations hinder the further development of LLMs in code generation. Recently, diffusion LLMs have emerged as a promising alternative. Diffusion LLMs address the above limitations with two advances, including multi-token prediction (i.e. generating multiple tokens at each step) and flexible generation order (i.e. flexibly determining which positions to generate tokens). However, there is no systematic study exploring diffusion LLMs in code generation. To bridge the knowledge gap, we present the first empirical study of diffusion LLMs for code generation. Our study involves 9 representative diffusion LLMs and conduct experiments on 4 widely used benchmarks. Based on the results, we summarize the following findings. (1) Existing diffusion LLMs are competitive with autoregressive LLMs with similar sizes. (2) Diffusion LLMs have a stronger length extrapolation ability than autoregressive LLMs and perform better in long code understanding. (3) We explore factors impacting the effectiveness and efficiency of diffusion LLMs, and provide practical guidance. (4) We discuss several promising further directions to improve diffusion LLMs on code generation. We open-source all source code, data, and results to facilitate the following research. The code is publicly available at https://github.com/zhangyitonggg/dllm4code.
Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). Builds on 43 of its 67 references that are in the map. First posted on arXiv 14 Sep 2025.
Builds on
43 of 67 references.
References · 43
- 2023GPT-4 Technical Reportcited by 18,396
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2025Qwen3 Technical Reportcited by 8,820
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2024Simple and Effective Masked Diffusion Language Modelscited by 848
31 more
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2025Fast-dLLM: Training-free Acceleration of Diffusion LLM by Enabling KV Cache and Parallel Decodingcited by 420
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
- 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 300
- 2025LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Modelscited by 285
- 2024Scaling Diffusion Language Models via Adaptation from Autoregressive Modelscited by 274
- 2025Mercury: Ultra-Fast Language Models Based on Diffusioncited by 235
- 2025DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generationcited by 187
- 2025Seed Diffusion: A Large-Scale Diffusion Language Model with High-Speed Inferencecited by 178
- 2025dLLM-Cache: Accelerating Diffusion Large Language Models with Adaptive Cachingcited by 169
- 2025LLaDA-V: Large Language Diffusion Models with Visual Instruction Tuningcited by 148
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 138
- 2023An Empirical Study of the Non-determinism of ChatGPT in Code Generationcited by 137
- 2025Diffusion LLMs Can Do Faster-Than-AR Inference via Discrete Diffusion Forcingcited by 116
- 2025Discrete Diffusion VLA: Bringing Discrete Diffusion to Action Decoding in Vision-Language-Action Policiescited by 90
- 2023A Large-Scale Survey on the Usability of AI Programming Assistants: Successes and Challengescited by 75
- 2025Seed-Coder: Let the Code Model Curate Data for Itselfcited by 49
- 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 46
- 2024Using AI-Based Coding Assistants in Practice: State of Affairs, Perceptions, and Ways Forwardcited by 45
- 2023SkCoder: A Sketch-based Approach for Automatic Code Generationcited by 40
- 2025LongLLaDA: Unlocking Long Context Capabilities in Diffusion LLMscited by 40
- 2024RepoQA: Evaluating Long Context Code Understandingcited by 35
- 2024EvoCodeBench: An Evolving Code Generation Benchmark with Domain-Specific Evaluationscited by 34
- 2023CodeFusion: A Pre-trained Diffusion Model for Code Generationcited by 31
- 2024Teaching Code LLMs to Use Autocompletion Tools in Repository-Level Code Generationcited by 30
- 2025Focused-DPO: Enhancing Code Generation Through Focused Preference Optimization on Error-Prone Pointscited by 14
- 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammarscited by 14
- 2025TreeDiff: AST-Guided Code Generation with Diffusion LLMscited by 11
- 2025CodeA11y: Making AI Coding Assistants Useful for Accessible Web Developmentcited by 8
- 2025Diffusion is a code repair operator and generatorcited by 3
Built on by
Citing papers per year: 2025: 4; 2026: 12.
16 papers.
Sort:
By area:
- 2026Continuous Latent Diffusion Language Modelcited by 14
- 2026Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Modelcited by 13
- 2025DiffuGuard: How Intrinsic Safety is Lost and Found in Diffusion Large Language Modelscited by 12
- 2025How Efficient Are Diffusion Language Models? A Critical Examination of Efficiency Evaluation Practicescited by 10
- 2025AI-Driven Self-Evolving Software: A Promising Path Toward Software Automationcited by 3
- 2026DICE: Diffusion Large Language Models Excel at Generating CUDA Kernelscited by 3
- 2026To See is Not to Master: Teaching LLMs to Use Private Libraries for Code Generationcited by 3
- 2025DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Patterncited by 2
- 2026Learning from Execution: Self-Evolving Memory for Private-Library Code Generationcited by 2
- 2026Distilled Continuous Diffusion Language Models Can Write Code in Few Steps---or Onecited by 2
- 2026AnCoder: Anchored Code Generation via Discrete Diffusion Modelscited by 1
- 2026AR-MAP: Are Autoregressive Large Language Models Implicit Teachers for Diffusion Large Language Models?cited by 0
4 more
- 2026LLMs + Security = Troublecited by 0
- 2026Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Codecited by 0
- 2026Beyond the Autoregressive Horizon: A Comprehensive Survey of Diffusion Models, World Modelling, and State Space Models for Codecited by 0
- 2026DiffPDE: Masked Diffusion Language Models as PDE Solvercited by 0
- 2026Distilled Continuous Diffusion Language Models Can Write Code in Few Steps---or One3 Sep 2026
- 2026DiffPDE: Masked Diffusion Language Models as PDE Solver31 Aug 2026
- 2026Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Code10 Jun 2026
- 2026Continuous Latent Diffusion Language Model7 May 2026
- 2026Learning from Execution: Self-Evolving Memory for Private-Library Code Generation27 Apr 2026
- 2026Beyond the Autoregressive Horizon: A Comprehensive Survey of Diffusion Models, World Modelling, and State Space Models for Code9 Apr 2026
- 2026To See is Not to Master: Teaching LLMs to Use Private Libraries for Code Generation16 Mar 2026
- 2026DICE: Diffusion Large Language Models Excel at Generating CUDA Kernels12 Feb 2026
- 2026LLMs + Security = Trouble9 Feb 2026
- 2026AnCoder: Anchored Code Generation via Discrete Diffusion Models5 Feb 2026
- 2026AR-MAP: Are Autoregressive Large Language Models Implicit Teachers for Diffusion Large Language Models?2 Feb 2026
- 2026Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Model22 Jan 2026
4 more
- 2025How Efficient Are Diffusion Language Models? A Critical Examination of Efficiency Evaluation Practices21 Oct 2025
- 2025AI-Driven Self-Evolving Software: A Promising Path Toward Software Automation1 Oct 2025
- 2025DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Pattern29 Sep 2025
- 2025DiffuGuard: How Intrinsic Safety is Lost and Found in Diffusion Large Language Models29 Sep 2025
- 2026Continuous Latent Diffusion Language Modelcited by 14
- 2025How Efficient Are Diffusion Language Models? A Critical Examination of Efficiency Evaluation Practicescited by 10
- 2026Distilled Continuous Diffusion Language Models Can Write Code in Few Steps---or Onecited by 2
- 2026AnCoder: Anchored Code Generation via Discrete Diffusion Modelscited by 1
- 2026DiffPDE: Masked Diffusion Language Models as PDE Solvercited by 0
- 2026Distilled Continuous Diffusion Language Models Can Write Code in Few Steps---or One3 Sep 2026
- 2026DiffPDE: Masked Diffusion Language Models as PDE Solver31 Aug 2026
- 2026Continuous Latent Diffusion Language Model7 May 2026
- 2026AnCoder: Anchored Code Generation via Discrete Diffusion Models5 Feb 2026
- 2025How Efficient Are Diffusion Language Models? A Critical Examination of Efficiency Evaluation Practices21 Oct 2025
- 2026Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Modelcited by 13
- 2025AI-Driven Self-Evolving Software: A Promising Path Toward Software Automationcited by 3
- 2026DICE: Diffusion Large Language Models Excel at Generating CUDA Kernelscited by 3
- 2026To See is Not to Master: Teaching LLMs to Use Private Libraries for Code Generationcited by 3
- 2025DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Patterncited by 2
- 2026AR-MAP: Are Autoregressive Large Language Models Implicit Teachers for Diffusion Large Language Models?cited by 0
- 2026LLMs + Security = Troublecited by 0
- 2026To See is Not to Master: Teaching LLMs to Use Private Libraries for Code Generation16 Mar 2026
- 2026DICE: Diffusion Large Language Models Excel at Generating CUDA Kernels12 Feb 2026
- 2026LLMs + Security = Trouble9 Feb 2026
- 2026AR-MAP: Are Autoregressive Large Language Models Implicit Teachers for Diffusion Large Language Models?2 Feb 2026
- 2026Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Model22 Jan 2026
- 2025AI-Driven Self-Evolving Software: A Promising Path Toward Software Automation1 Oct 2025
- 2025DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Pattern29 Sep 2025