Skip to content

Exploring the Potential of Diffusion Large Language Models in Code Generation

Sep 2025 · ACM Transactions on Software Engineering and Methodology · 18 citations · ⚡ 1 influential · 67 references
Computer Science

TL;DR

This study presents the first empirical study of diffusion LLMs for code generation and explores factors impacting the effectiveness and efficiency of diffusion LLMs, and provides practical guidance.

Abstract

Large Language Models (LLMs) have revolutionized the landscape of 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 typically generate only one token per 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. They provide two characteristics that are particularly relevant to code generation: 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 7 representative diffusion LLMs and conducts experiments on a wide range of benchmarks. Based on the results, we summarize the following findings. ❶ Current diffusion LLMs show promising but uneven code generation ability, with open-source diffusion LLMs becoming competitive in several settings and closed-source diffusion LLMs showing stronger results. For example, on MBPP+, the best-performing diffusion LLM achieves a pass@1 score of 79.1%, compared with 73.3% for the best evaluated autoregressive baseline. ❷ Diffusion LLMs exhibit stronger length extrapolation behavior in our long-code-understanding experiments. ❸ We explore factors impacting the effectiveness and efficiency of diffusion LLMs, and provide practical guidance. ❹ We discuss several promising future directions to improve diffusion LLMs on code generation. We open-source all source code, data, and results to facilitate future research.

Read PDF

Similar papers

#artificial intelligence Preprint Jul 2024

The Llama 3 Herd of Models

It is found that Llama 3 delivers comparable quality to leading language models such as GPT-4 on a plethora of tasks, and performs competitively with the state-of-the-art on image, video, and speech recognition tasks.

Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri et al. · 21,082 citations · ⚡3,832
#artificial intelligence Conference Open access Jun 2018

Gibson Env: Real-World Perception for Embodied Agents

This paper investigates developing real-world perception for active agents, proposes Gibson Environment for this purpose, and showcases a set of perceptual tasks learned therein.

F. Xia, Amir Zamir, Zhi-Yang He et al. · 1,069 citations · ⚡112
#artificial intelligence Open access May 2023

Evaluating the Performance of Large Language Models on GAOKAO Benchmark

GAOKAO-Bench is introduced, an intuitive benchmark that employs questions from the Chinese GAOKAO examination as test samples, including both subjective and objective questions that contribute a robust evaluation benchmark for future large language models and offers valuable insights into the advantages and limitations...

Xiaotian Zhang, Chun-yan Li, Yi Zong et al. · 216 citations · ⚡17

KTO: Model Alignment as Prospect Theoretic Optimization

This work proposes a HALO that directly maximizes the utility of generations instead of maximizing the log-likelihood of preferences, and suggests that the best loss depends on the inductive biases most appropriate for a given setting, an oft-overlooked consideration.

Kawin Ethayarajh, Winnie Xu, Niklas Muennighoff et al. · 195 citations · ⚡28
#computer vision Open access Jun 2016

Software Development in Startup Companies: The Greenfield Startup Model

The results are packaged in the Greenfield Startup Model (GSM), which explains the priority of startups to release the product as quickly as possible, and the need to shorten time-to-market, by speeding up the development through low-precision engineering activities.

Carmine Giardino, Nicolò Paternoster, M. Unterkalmsteiner et al. · 178 citations · ⚡14

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.