SNAP-FM: Sparse Nonlinear Accelerated Projection for Physics-Constrained Generative Modeling

Alaina Kolli, Theodoros Xenakis, Utkarsh Utkarsh, Pengfei Cai, Rafael Gomez-Bombarelli, Alan Edelman, Christopher Vincent Rackauckas

TL;DR

This paper introduces SNAP-FM, a novel framework that significantly accelerates physics-constrained generative modeling by exploiting the inherent sparsity of physical constraints. By leveraging specialized sparse linear algebra techniques and GPU acceleration, SNAP-FM dramatically speeds up the computationally intensive projection step in generative sampling, making it more practical for scientific applications.

What Problem Does This Paper Address?

Generative models are powerful tools for simulating physical systems, but they often fail to respect fundamental physical laws like conservation of mass or energy. This "physics fidelity" gap is crucial for scientific applications. While "constrained sampling" methods can enforce these laws at inference time without retraining, they incur a significant computational cost. This cost arises from repeatedly solving complex optimization problems to project generated samples onto the "feasible manifold" (i.e., satisfying the physics). Standard machine learning frameworks, with their dense tensor operations, struggle to efficiently handle the structured sparsity that naturally arises from physical constraints, making these projection steps a bottleneck.

Methods

The core contribution of SNAP-FM is its approach to optimizing the constraint projection step. Instead of relying on general-purpose dense solvers, SNAP-FM leverages the specific structure of the optimization problems arising from physics constraints:

  • Exploiting Sparsity: Physical constraints, especially those derived from discretizing partial differential equations (PDEs), often lead to "block-sparse" Jacobian and KKT (Karush-Kuhn-Tucker) systems. This means that most entries in these matrices are zero, and the non-zero entries have a predictable, structured pattern.
  • ExaModels.jl: This framework is used to symbolically model the projection problem, automatically generating efficient, sparsity-aware computational graphs. This allows the structure of the problem to be explicitly captured.
  • MadNLP.jl: This is an interior-point optimization solver that works efficiently with sparse systems.
  • GPU Sparse Factorization: By combining ExaModels.jl and MadNLP.jl, the system can be solved using GPU-accelerated sparse linear algebra routines (specifically, NVIDIA's cuDSS library). This allows for much faster factorization and solving of the large, sparse KKT systems that arise during projection.

The overall approach is integrated into the Physics-Constrained Flow Matching (PCFM) framework, where these optimized projection steps are interleaved with the generative sampling process.

Datasets

The paper evaluates SNAP-FM on several PDE benchmark problems, including:

  • One-dimensional heat equation (with various combinations of initial value, mass conservation, and energy evolution constraints).
  • One-dimensional Burgers' equation (with boundary, mass conservation, and flux constraints).
  • One-dimensional reaction-diffusion equation.
  • Two-dimensional Navier-Stokes equation (vorticity form).

These problems are designed to cover a range of linear and nonlinear constraints, and both one- and two-dimensional settings. The training datasets for these PDEs were generated using standard numerical solvers (e.g., Godunov finite volume method, Crank-Nicolson spectral solver) based on the respective governing equations.

Key Insights and Ideas

  • Sparsity is Key: The paper strongly emphasizes that the computational bottleneck in physics-constrained generative modeling is the projection step, and that exploiting the inherent sparsity of physical constraints is the most effective way to overcome this.
  • Structure-Aware Optimization: Standard ML frameworks are optimized for dense operations. SNAP-FM demonstrates that by using specialized tools (ExaModels.jl, MadNLP.jl) that understand and exploit the sparse structure, significant performance gains are achievable.
  • GPU Acceleration for Sparse Systems: The combination of sparse modeling and GPU-resident sparse solvers is crucial for achieving practical performance on large-scale problems.
  • Zero-Shot Constraint Enforcement: The underlying PCFM framework allows for enforcing arbitrary nonlinear constraints at inference time without retraining, and SNAP-FM makes this process computationally feasible.

Key Results

  • Significant Speedup: SNAP-FM (using ExaModels + MadNLP on GPU) consistently outperformed all other tested optimization backends across all six benchmark problems. For example, in the heat equation with energy evolution, it was orders of magnitude faster than some baselines.
  • Maintained Constraint Satisfaction: The proposed method achieved comparable or better constraint satisfaction (infeasibility) compared to other methods, demonstrating that speedup did not come at the cost of accuracy.
  • Scalability: The runtime scales linearly with the number of samples (batch size), as expected due to the block-diagonal structure of the batched projection problem.
  • Robustness: SNAP-FM was the only method that could handle the most complex constraint sets within the given runtime budget, highlighting its advantage for challenging problems.

Limitations and Future Work

  • Numerical Tolerances: The paper notes that constraint satisfaction is achieved up to the numerical tolerances of the nonlinear optimizer. While the default tolerance of $10^{-4}$ was used, further investigation into tuning these tolerances for specific problems could be beneficial.
  • Future Work: The authors suggest exploring how to tune solver tolerances and their impact on feasibility and sampling cost. They also implicitly point towards the broader applicability of sparse GPU nonlinear optimization as a foundation for constrained generative sampling in scientific machine learning.

Summary updated

BibTeX
@inproceedings{kolli2026snap,
  author = {Alaina Kolli and Theodoros Xenakis and Utkarsh Utkarsh and Pengfei Cai and Rafael Gomez-Bombarelli and Alan Edelman and Christopher Vincent Rackauckas},
  title = {{SNAP-FM: Sparse Nonlinear Accelerated Projection for Physics-Constrained Generative Modeling}},
  booktitle = {AI4Physics @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=6HCUxH4vdm},
}
Figure