Constrained Generative Modeling

Overview

Constrained generative modeling studies how to generate useful samples while respecting requirements such as grammatical rules, molecular validity, physical laws, or safe trajectories. Common approaches include grammar and automaton-based decoding, diffusion and flow-matching methods with projections or primal-dual guidance, and models that build constraints into their representations or training objectives. Applications range from structured text and synthetic data to molecules, motion planning, scientific fields, and engineering design, with evaluation often balancing constraint satisfaction against sample quality, diversity, and computational cost. A central challenge is that enforcing feasibility does not necessarily preserve the model’s intended distribution or uncertainty, so methods must limit bias while remaining efficient and reliable under complex constraints.

Latest papers

212 papers26 papers in the last four weeks, down 50% on the four weeks before. 0.2% of all new papers.

May 16, 2025

Diffusion-based Evolutionary Optimization for 3D Multi-Objective Molecular Generation

De novo 3D molecular design with multiple properties and fragment-retention constraints is formulated as a constrained multi-objective optimization problem. Existing 3D diffusion models provide strong capabilities for generating novel molecules, but adapting them to new conditions and multi-objective optimization tasks remains difficult. We present Diffusion-based Evolutionary Molecular Optimization (DEMO), a framework that draws solely on the unconditional molecular prior of a frozen pretrained diffusion model to generate chemically valid 3D candidates, while evolutionary search handles conditional generation and constrained multi-objective optimization, without retraining or fine-tuning. DEMO performs crossover and mutation on intermediate diffusion states through an Evolutionary-Guided Diffusion (EGD) operator, combines 2D topology and 3D geometry in Structure-Aware Environmental Selection (SAES) to preserve structural diversity, and uses three cooperating populations to coordinate structural exploration, fragment-constraint satisfaction, and property optimization. Experimental results demonstrate that EGD outperforms task-specific conditional generators in property targeting; SAES preserves structural diversity while retaining competitive hypervolume in multi-objective optimization; and DEMO improves objective convergence and generates diverse feasible molecules under fragment constraints. These results show how evolutionary search can reuse existing diffusion models for diverse molecular design requirements.
May 31, 2024

Grammar-Aligned Decoding

Large Language Models (LLMs) struggle with reliably generating highly structured outputs, such as program code, mathematical formulas, or well-formed markup. Constrained decoding approaches mitigate this problem by greedily restricting what tokens an LLM can output at each step to guarantee that the output matches a given constraint. Specifically, in grammar-constrained decoding (GCD), the LLM's output must follow a given grammar. In this paper, we demonstrate that GCD techniques (and in general constrained decoding techniques) can distort the LLM's distribution, leading to outputs that are grammatical but appear with likelihoods that are not proportional to the ones given by the LLM, and so ultimately are low-quality. We call the problem of aligning sampling with a grammar constraint, grammar-aligned decoding (GAD), and propose adaptive sampling with approximate expected futures (ASAp), a decoding algorithm that guarantees the output to be grammatical while provably producing outputs that match the conditional probability of the LLM's distribution conditioned on the given grammar constraint. Our algorithm uses prior sample outputs to soundly overapproximate the future grammaticality of different output prefixes. Our evaluation on code generation and structured NLP tasks shows how ASAp often produces outputs with higher likelihood (according to the LLM's distribution) than existing GCD techniques, while still enforcing the desired grammatical constraints.