Reproduce “Constrained Code Generation with Discrete Diffusion” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Lize Shao, Michael Cardei, Zichen Xie, Ferdinando Fioretto, Wenxi Wang
A training-free neurosymbolic framework, Constrained Diffusion for Code (CDC), integrates explicit program-level constraints directly into the reverse denoising process of discrete diffusion models for code generation. This approach significantly increased functional correctness by over 30 percentage points and nearly tripled security-aware generation rates on benchmarks like CWEval.
Key insights
- Discrete diffusion models, by exposing a global program representation at each denoising step, offer a natural and effective intervention point for integrating global program-level constraints.
- A neurosymbolic approach, combining neural model generation with symbolic feedback (learned surrogates or static analyzers), can robustly enforce hard functional and security constraints.
- Constraint satisfaction can be achieved efficiently through localized and targeted adjustments to the denoising trajectory, avoiding costly broad regeneration and preserving high-fidelity regions.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.