mlsanityData to 7 Oct 2026

Constrained Code Generation with Discrete Diffusion

arXiv 2605.16829 ↗First posted 16 May 2026cs.CL cs.PLcited by 1

On the map: Diffusion models → Discrete and text diffusion

Abstract (arXiv)

Discrete diffusion models are a powerful, emerging paradigm for code generation. They construct programs through iterative refinement of partially corrupted token sequences and enable parallel token refinement. Importantly, this paradigm exposes a global program state at each denoising step, which provides a natural intervention point for enforcing program-level functionality and security constraints, guiding the generation before the final code is committed. Building on this observation, the paper introduces Constrained Diffusion for Code (CDC), a training-free neurosymbolic inference framework that integrates constraint satisfaction directly into the reverse denoising process. CDC augments the base discrete diffusion sampler with constraint-aware denoising operators that combine mathematical optimization with program analysis to identify constraint-relevant regions of the intermediate program state and locally adjust the denoising trajectory, steering generation toward feasible programs while remaining close to the base model. Across code generation benchmarks, CDC consistently improves constraint satisfaction in functional correctness, security, and even syntax, outperforming discrete diffusion and autoregressive baselines with less corrective computation and more localized edits.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Discrete and text diffusion, one of 14 directions in Diffusion models. Builds on 26 of its 31 references that are in the map. First posted on arXiv 16 May 2026.

Builds on

26 of 31 references.

Closest ancestors · 6

Same direction, newest first

  1. 2025Dream-Coder 7B: An Open Diffusion Language Model for Code1 Sep
  2. 2025Dream 7B: Diffusion Large Language Models21 Aug
  3. 2025DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation25 Jun
  4. 2025Constrained Discrete Diffusion12 Mar
  5. 2025Large Language Diffusion Models14 Feb
  6. 2024Simple and Effective Masked Diffusion Language Models11 Jun

Other references · 20

  1. 2020Denoising Diffusion Probabilistic Modelscited by 20,851
  2. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2021Program Synthesis with Large Language Modelscited by 3,509
  5. 2021Structured Denoising Diffusion Models in Discrete State-Spacescited by 1,665
  6. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,628
  7. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  8. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  9. 2023Teaching Large Language Models to Self-Debugcited by 963
  10. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  11. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
  12. 2023LEVER: Learning to Verify Language-to-Code Generation with Executioncited by 228
8 more
  1. 2024Simple Guidance Mechanisms for Discrete Diffusion Modelscited by 148
  2. 2023LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluationscited by 58
  3. 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 55
  4. 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
  5. 2025Type-Constrained Code Generation with Language Modelscited by 32
  6. 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammarscited by 13
  7. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 9
  8. 2025Neuro-Symbolic Generative Diffusion Models for Physically Grounded, Robust, and Safe Generationcited by 9

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026Distilled Continuous Diffusion Language Models Can Write Code in Few Steps---or One
  2. 2023CodeFusion: A Pre-trained Diffusion Model for Code Generation
  3. 2026DreamOn: Diffusion Language Models For Code Infilling Beyond Fixed-size Canvas
  4. 2026AnCoder: Anchored Code Generation via Discrete Diffusion Models
  5. 2025Saber: An Efficient Sampling with Adaptive Acceleration and Backtracking Enhanced Remasking for Diffusion Language Model
  6. 2025Diffusion is a code repair operator and generator
  7. 2026Beyond the Autoregressive Horizon: A Comprehensive Survey of Diffusion Models, World Modelling, and State Space Models for Code
  8. 2026CAI-DLLM: Convergence Aware Inference for Diffusion Language Models