NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Constrained Synthesis with Projected Diffusion Models

Jacob K Christopher, Stephen Baek, Ferdinando Fioretto

Generative diffusion models have taken the world by storm, creating stunning images and realistic videos. But for scientists and engineers, "looking realistic" isn't enough. If you’re designing a new material or planning a robot's path, the output must follow the laws of physics and geometry—it needs to be valid, not just pretty.

A new paper from researchers at the University of Virginia, titled "Constrained Synthesis with Projected Diffusion Models," introduces a framework called Projected Diffusion Models (PDM) that forces diffusion models to respect strict, "hard" constraints during the generation process.

The Problem: Hallucination vs. Hard Constraints

Standard diffusion models are essentially masters of hallucination. They learn a data distribution and then sample from it using a stochastic (random) process. While this is great for creative arts, it’s a nightmare for safety-critical or scientific applications where physical laws cannot be broken.

Current methods to control these models usually fall into two camps:

  1. Conditioning: You "nudge" the model toward a goal (e.g., "make this material porous"). This is a "soft" constraint; the model might try to comply, but it often fails to meet exact mathematical specifications.
  2. Post-processing: You generate an image and then "fix" it at the very end. This often ruins the quality of the image because the "fix" pushes the data far away from the realistic distribution the model originally learned.

The missing link is certified compliance. How do we ensure a generated robot path never hits a wall, or a generated human figure never floats above the floor, without sacrificing the realism of the output?

The PDM Solution: Iterative Projection

The authors introduce Projected Diffusion Models (PDM) by treating the reverse diffusion process (the part where noise turns into data) as a constrained optimization problem.

In a standard score-based model, the algorithm follows the gradient of the data distribution (the "score") to find likely data points. PDM adds a projection operator ($P_C$) to every single step of this process:

  • The Step: The model takes a small step toward a realistic image.
  • The Projection: PDM immediately maps that intermediate result to the nearest point that satisfies the constraints (the "feasible set").

By doing this iteratively, the model "slides" along the boundary of what is allowed while still being pulled toward what is realistic. The authors provide a theoretical proof showing that this method doesn't just find any valid solution; it finds the most likely solution that is also valid.

Constraint violation over sampling time steps for PDM versus a standard conditional model.

Applications and Key Insights

The researchers tested PDM across four diverse and challenging domains:

  1. Material Science: Generating microstructures with specific "porosity" levels using a dataset of microscopic images.
  2. 3D Human Motion: Generating animations where the character must never "sink" into or "float" above the floor.
  3. Path Planning: Generating collision-free trajectories for robots in environments with obstacles.
  4. Physics-informed Motion: Creating video frames of objects moving under gravity, testing the model's ability to generalize to different gravitational pulls not seen during training.

Surprising Discoveries

  • Training on "Bad" Data: One of the most surprising findings is that PDM doesn't need the training data to be feasible. You can train on a dataset where every example violates the rules, and PDM will still generate valid outputs by enforcing the constraints during the sampling phase.
  • Iterative vs. One-Shot: Projecting at every step is vastly superior to projecting at the end. If you wait until the end, the "correction" is a massive jump that destroys image quality. By correcting incrementally, the model stays "on the rails" throughout the entire journey.
  • Handling Non-Convexity: While the theory relies on convex sets (simple shapes), the authors show empirically that PDM works remarkably well on "non-convex" constraints—like navigating around complex obstacles in a maze.

Key Results

PDM dramatically outperformed existing baselines in both constraint satisfaction and output fidelity:

  • Zero Violations: In the 3D human motion task, PDM achieved 0.00% penetration and floating violations. In contrast, previous state-of-the-art models still had significant physical errors.
  • 100% Success in Planning: In path planning scenarios, PDM reached a 100% success rate in finding feasible paths with a single sample, whereas conditional baselines hovered around 53–77%.
  • Superior Fidelity: PDM maintained much better FID scores (a measure of image quality) than post-processing methods.
Comparison of generated material microstructures and FID scores across different methods.

Limitations and Future Work

The primary drawback of PDM is computational overhead. Because the model has to run a projection (which is itself an optimization problem) at every sampling step, it is significantly slower than standard diffusion. For example, PDM took ~682 seconds for a human motion sample, compared to just ~14 seconds for a standard conditional model.

Future work will likely focus on efficiency. The authors suggest "warm-starting" the solvers (using the solution from the previous step to speed up the current one) or only applying projections at specific intervals to balance speed and strictness. There is also an open challenge in representing extremely high-dimensional, complex constraints for large-scale multi-task models. Nonetheless, PDM represents a major step forward in making generative AI reliable enough for rigorous scientific and engineering applications.

Summary updated

BibTeX
@inproceedings{christopher2024constrained,
  author = {Jacob K Christopher and Stephen Baek and Ferdinando Fioretto},
  title = {{Constrained Synthesis with Projected Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=FsdB3I9Y24},
}
Figure