Back to directory

DiffuCoder

Research code accompanying a paper on masked diffusion language models for code generation, including inference examples and a Coupled-GRPO post-training method.

DiffuCoder

ml-diffucoder is the code release accompanying the paper DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation. It investigates how diffusion language models generate code differently from autoregressive models, introducing an autoregressiveness score to quantify how closely a diffusion model's generation order follows a left-to-right causal pattern, and finds that code tasks induce less of that pattern than math tasks, and that sampling temperature changes the generation order itself, not just which tokens are chosen.

The repository trains DiffuCoder using the adaptation approach from DiffuLLaMA, and introduces Coupled-GRPO, a post-training method that improves the model's performance by computing losses more efficiently across masked token positions. Trained models are published on Hugging Face, and MLX support for Apple Silicon was in progress at the time of writing.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.