Diffusion models for code generation
Top 51.6% on sourcepulse
This repository provides DiffuCoder, a diffusion-based large language model for code generation, addressing limitations in existing diffusion LLMs' generation patterns and post-training strategies. It targets researchers and developers in AI code generation, offering potentially faster generation than autoregressive models and improved performance through novel techniques.
How It Works
DiffuCoder builds upon Masked Denoising Models (MDMs) and diffusion LLMs (dLLMs), investigating how their generation patterns differ from autoregressive models. It introduces a new metric, the "autoregressiveness score," to quantify causal patterns during generation. A key innovation is Coupled-GRPO, a post-training method that addresses inefficiencies in per-timestep loss computation by using a coupled-sampling scheme. This scheme ensures all tokens receive a learning signal and improves probability estimates by evaluating tokens in partially-masked contexts, offering better accuracy with modest computational overhead.
Quick Start & Requirements
huggingface/open-r1
, merge provided files, and set up the environment using conda
and pip
(e.g., pip install vllm==0.8.4
, flash-attn==2.8.0.post1
, setuptools
, .[code]
).wandb
account.TIGER-Lab/AceCode-89K
dataset for GRPO training.wandb
for logging. Inference requires a CUDA-enabled GPU.Highlighted Details
TOKEN_PER_STEP
for performance/speed trade-offs.Maintenance & Community
huggingface/open-r1
and LLaMA-Factory
.Licensing & Compatibility
open-r1
project is Apache 2.0 licensed. Compatibility for commercial use or closed-source linking requires clarification.Limitations & Caveats
MLX support for Apple Silicon is listed as "in progress" as of June 2025, indicating potential limitations for users on that platform. The specific license for this repository is not clearly stated, which could impact commercial adoption.
3 weeks ago
Inactive