Softly Constrained Denoisers for Diffusion Models

Victor M. Yeom-Song, Severi Rissanen, Arno Solin, Samuel Kaski, Mingfei Sun · DOI

Diffusion models have emerged as a dominant paradigm in generative modeling, yet their application in scientific domains—such as fluid dynamics, wave propagation, and protein design—remains challenging. These fields require samples that adhere to strict physical laws, often expressed as Partial Differential Equations (PDEs). Standard diffusion models frequently ignore these underlying mathematical constraints, while traditional methods for enforcing them often lead to significant biases.

Researchers from Aalto University and the University of Manchester have introduced Softly Constrained Denoisers (SCD), a novel framework that embeds scientific constraints directly into the denoiser's architecture as a learnable "soft inductive bias."

The Challenge of Constraint Misspecification

In scientific modeling, the mathematical constraints we use are often "simplified" versions of reality. For example, a model might assume a perfectly circular boundary when the true data distribution contains subtle irregularities.

Existing approaches typically rely on Regularization (adding a penalty term to the loss function) or Guidance (adjusting samples during inference). However, the authors demonstrate that if a "hard" regularizer is used to force a model to follow a simplified law, the model becomes biased toward the idealized math rather than the true, "messy" data. This phenomenon, termed Constraint Misspecification, can actually degrade the model's accuracy compared to a vanilla diffusion model that ignores constraints entirely.

Methodology: The SCD Framework

SCD addresses this by moving the constraint logic out of the loss function and into the denoiser architecture ($D_\theta$). In a standard model, the denoiser predicts clean data from noise. In the SCD framework, the output is decomposed into two components:

  1. The Base Denoiser: A standard neural network (e.g., a U-Net) that learns from the data distribution.
  2. The Adjustment Term: A term that calculates the gradient of the constraint and scales it by a learnable scaling network ($\gamma_\theta$).

By making the strength of the constraint adjustment learnable, the model can dynamically decide when to trust the mathematical rule. If the rule contradicts the training data, the scaling network can effectively attenuate the constraint, allowing the model to prioritize data fidelity where the math is imperfect.

Experimental Validation

The authors evaluated SCD across several benchmarks, including a "toy" unit circle task designed to test robustness to misspecification, as well as complex PDE problems like Darcy Flow (fluid flow through porous media) and the Helmholtz Equation (wave propagation).

Figure 5: Illustrating the impact of constraint misspecification. (a) The problem setup shows a simplified circular constraint (dashed) vs. the true dented data distribution (pink). (b) Vanilla diffusion captures the dent but lacks precision. The bottom panels compare a regularized model (left), which is biased toward the simplified circle, against SCD (right), which successfully recovers the true dented distribution.

Key Insights

  • Robustness to Error: SCD proved significantly more robust than competing methods like PIDM or DPS. In the "Chop" circle task, SCD maintained low error even as the constraint became increasingly misspecified, while other methods saw their error rates explode by nearly 10x.
  • Superior PDE Solving: In Darcy Flow experiments, SCD achieved the lowest residual values (indicating high physical consistency) while maintaining superior Negative Log-Likelihood (NLL) compared to regularized models.
  • Efficiency: Because the constraint logic is integrated into the forward pass, SCD avoids the expensive iterative optimization required by many inference-time guidance methods, making it a computationally efficient "drop-in" upgrade.

Conclusion

Softly Constrained Denoisers offer a middle ground between purely data-driven models and rigid, physics-constrained systems. By treating physical laws as "hints" rather than absolute requirements, SCD preserves the generative power of diffusion models while leveraging scientific knowledge to improve sample quality. While it does not provide the 100% hard guarantees required for some safety-critical engineering tasks, it represents a major step forward in building robust, physics-aware AI for scientific discovery.

Summary updated

BibTeX
@inproceedings{yeomsong2025softly,
  author = {Victor M. Yeom-Song and Severi Rissanen and Arno Solin and Samuel Kaski and Mingfei Sun},
  title = {{Softly Constrained Denoisers for Diffusion Models}},
  booktitle = {AI4Science @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=aqmO7lWMzn},
}
Figure