Continuous Diffusion Models Can Obey Formal Syntax

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Kim, Jinwoo, Berg-Kirkpatrick, Taylor, D'Antoni, Loris
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916054665527296
author Kim, Jinwoo
Berg-Kirkpatrick, Taylor
D'Antoni, Loris
author_facet Kim, Jinwoo
Berg-Kirkpatrick, Taylor
D'Antoni, Loris
contents Diffusion language models offer a promising alternative to autoregressive models due to their global, non-causal generation process, but their continuous latent dynamics make discrete constraints -- e.g., the output should be a JSON file that matches a given schema -- difficult to impose. We introduce a training-free guidance method for steering continuous diffusion language models to satisfy formal syntactic constraints expressed using regular expressions. Our approach constructs an analytic score estimating the probability that a latent state decodes to a valid string accepted by a given regular expression, and uses its gradient to guide sampling, without training auxiliary classifiers. The denoising process targets the base model conditioned on syntactic validity. We implement our method in Diffinity on top of the PLAID diffusion model and evaluate it on 180 regular-expression constraints over JSON and natural-language benchmarks. Diffinity achieves 68-96\% constraint satisfaction while incurring only a small perplexity cost relative to unconstrained sampling, outperforming autoregressive constrained decoding in both constraint satisfaction and output quality. Diffinity is open-sourced at github.com/large-loris-models/Diffinity.
format Preprint
id arxiv_https___arxiv_org_abs_2602_12468
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Continuous Diffusion Models Can Obey Formal Syntax
Kim, Jinwoo
Berg-Kirkpatrick, Taylor
D'Antoni, Loris
Machine Learning
Formal Languages and Automata Theory
Diffusion language models offer a promising alternative to autoregressive models due to their global, non-causal generation process, but their continuous latent dynamics make discrete constraints -- e.g., the output should be a JSON file that matches a given schema -- difficult to impose. We introduce a training-free guidance method for steering continuous diffusion language models to satisfy formal syntactic constraints expressed using regular expressions. Our approach constructs an analytic score estimating the probability that a latent state decodes to a valid string accepted by a given regular expression, and uses its gradient to guide sampling, without training auxiliary classifiers. The denoising process targets the base model conditioned on syntactic validity. We implement our method in Diffinity on top of the PLAID diffusion model and evaluate it on 180 regular-expression constraints over JSON and natural-language benchmarks. Diffinity achieves 68-96\% constraint satisfaction while incurring only a small perplexity cost relative to unconstrained sampling, outperforming autoregressive constrained decoding in both constraint satisfaction and output quality. Diffinity is open-sourced at github.com/large-loris-models/Diffinity.
title Continuous Diffusion Models Can Obey Formal Syntax
topic Machine Learning
Formal Languages and Automata Theory
url https://arxiv.org/abs/2602.12468