Deep generative models like diffusion and score-based models are revolutionizing scientific forecasting, but they suffer from a critical limitation: they often generate outputs that violate fundamental laws of physics. In fields like meteorology or fluid dynamics, a model that generates a weather map where mass or energy isn't conserved is effectively useless for long-term prediction, as small errors accumulate and destroy accuracy.
Existing fixes usually fall into two camps:
- Soft Penalties: Adding a "guidance" term that encourages the model to stay near the constraint. This is easy to implement but does not guarantee the constraint is actually met.
- Hard Projections: Forcefully "snapping" every step of the sampling process onto the constraint set. While this ensures the rules are followed, it often traps the sampler in a small corner of the possible solutions, leading to biased results and poor exploration of the data distribution.
To bridge this gap, researchers have introduced CASAL (Constrained Alternated Split Augmented Langevin), a novel primal-dual sampling algorithm. CASAL forces generative models to obey strict mathematical and physical constraints without getting stuck in the local minima that plague simpler projection-based methods.
The CASAL Approach: Variable Splitting
Instead of trying to sample directly from a constrained space—which is mathematically "thin" and difficult to navigate—CASAL leverages the variational formulation of Langevin dynamics and introduces variable splitting.
The method utilizes two linked variables:
- $x$ (The Primal Variable): This variable tries to follow the high-likelihood regions of the generative model.
- $z$ (The Constrained Variable): This variable is strictly forced to stay within the physical constraint set (e.g., on a sphere of constant energy).
During sampling, $x$ and $z$ perform a mathematical tug-of-war. A dual variable ($\mu$) acts as a memory, integrating the error between $x$ and $z$ over time to correct for sampling bias. Because $x$ and $z$ are allowed to be slightly different during the intermediate steps of sampling, the algorithm can "tunnel" through regions of the state space that violate physics to find new, valid physical states.
Crucially, CASAL is a zero-shot method. It acts as a "plug-in" during the inference and sampling stage, meaning you do not need to retrain an expensive diffusion model to use it.
Key Results and Performance
The researchers evaluated CASAL across several complex physical benchmarks, including stationary field generation, the inviscid Burgers equation, optimal control for quadrotors, and PDE emulation (Darcy flow, Navier-Stokes, and the 2D Poisson equation).
Superior Exploration and Mode Finding
Standard projection methods are heavily biased because they ignore the geometry of the distribution. In a bimodal fluid test, standard projection got stuck in the wrong mode 22% of the time. By using a dual variable to "push back" against the bias introduced by the constraint, CASAL found the correct physical mode with near-perfect accuracy (0.001% error).
Accuracy Boost in Data Assimilation
On the Burgers equation, CASAL was used for data assimilation—reconstructing the full state of a system from sparse, noisy observations. It significantly outperformed unconstrained diffusion and "soft" penalty methods, reducing reconstruction error while keeping mass and energy conservation errors near zero ($10^{-5}\%$).
PDE Emulation
In Darcy flow experiments, CASAL reduced reconstruction error to 10%, compared to 22-23% for projected and penalty-based baselines, all while maintaining strict constraint satisfaction. Furthermore, CASAL can enforce constraints in high-dimensional physical space even if the sampling happens in a compressed latent space, making it highly compatible with modern architectures like Stable Diffusion.
Limitations and Future Work
Despite its computational efficiency—running at speeds comparable to standard projected Langevin methods—CASAL does have limitations. The method requires a defined "projection operator" for the constraint set. While many physical laws have simple projections, highly complex or "black-box" constraints might be harder to implement. Additionally, the coupling parameter $\rho$ requires careful scheduling to balance exploration and constraint enforcement.
Future work may extend this framework to natively time-dependent variational formulations, potentially leading to even more efficient "physics-aware" diffusion models that require no post-processing projections at all.
Reference: Blanke, M., Qu, Y., Shamekh, S., & Gentine, P. (2025). Strictly Constrained Generative Modeling via Split Augmented Langevin Sampling. Published as a conference paper at ICLR 2026.
Summary updated