Beyond Loss Guidance: Using PDE Residuals as Spectral Attention in Diffusion Neural Operators

Medha Sawhney, Abhilash Neog, Mridul Khurana, Anuj Karpatne · Submission to ICLR 2026 · Rejected

TL;DR

Existing diffusion-based PDE solvers rely on slow, unstable gradient-based test-time optimization to steer outputs toward physical consistency. PRISMA replaces external loss guidance by baking physics directly into the model’s architecture using a novel Spectral Residual Attention (SRA) block. This unlocks fully gradient-descent-free inference, making diffusion sampling 15× to 250× faster while significantly boosting robustness against noisy and sparse observations.

What Problem Does This Paper Address?

Diffusion models and neural operators have emerged as powerful tools for solving partial differential equations (PDEs), providing full posterior distributions and flexible uncertainty quantification for ill-posed inverse problems. However, existing physics-guided diffusion models (such as DiffusionPDE and FunDPS) enforce physical validity through test-time loss guidance: during sampling, they calculate a scalar PDE residual loss and compute gradients to nudge intermediate representations toward physical solutions.

This approach introduces three major bottlenecks:

  1. Extreme slowness: Running gradient-based optimization at each denoising step demands hundreds to thousands of steps (often 200–2,000 steps), taking tens to hundreds of seconds per sample.
  2. Optimization instability: Balancing data likelihood and PDE residual gradients requires fragile hyperparameter tuning.
  3. Vulnerability to noise: Reducing a 2D/3D residual field to a single scalar loss discards localized, frequency-dependent signals and causes catastrophic failure when observations are corrupted by sensor noise.

Methods

Instead of using PDE residuals as an external optimization penalty, PRISMA (PDE Residual Informed Spectral Modulation with Attention) integrates residuals directly into a conditional U-shaped Neural Operator (UNO) backbone:

  • Observation-Informed Residuals: At each reverse diffusion step, intermediate predictions are combined with known observations via binary masks ($M_a, M_u$) to compute an explicit residual field $r = \mathcal{R}(x_{\text{mix}})$.
  • Spectral Residual Attention (SRA) Block: Injected at every layer of the UNO backbone, SRA computes the 2D Fast Fourier Transform (FFT) of both the latent feature map and the residual field. It measures channel-wise phase alignment per frequency mode $k$ via complex inner products, generating a spectral attention mask that selectively boosts or suppresses specific frequency components.
  • Dynamically Gated Skip-Connection: A small MLP takes the noise embedding $\sigma$ and spatial average residual $r_{\text{avg}}$ to predict a scalar gate $g_{\text{res}} \in [0, 1]$. When noise is high, the model discounts the noisy residual; as denoising progresses, it ramps up physics modulation.
  • Unified Forward and Inverse Formulation: By conditioning on observation masks, a single trained network solves forward, inverse, clean, sparse, or noisy tasks without task-specific retraining or custom sampling loops.
                      ┌──────────────────────────────────────┐
                      │    Spectral Residual Attention (SRA)  │
 Latent Feature xˡ ──►│  FFT ──► Phase Alignment with r̃       │──► Modulated State ──► UNO Spectral Path
                      │  Adaptive Gate g_res (from σ, r_avg)  │
                      └──────────────────┬───────────────────┘
                                         ▲
 PDE Residual r  ────────────────────────┘

Datasets

The authors evaluate PRISMA against benchmarks derived from Huang et al. (2024), comprising 50,000 training and 1,000 test samples at $64\times 64$ and $128\times 128$ resolutions:

  • Darcy Flow: Steady-state fluid flow in porous media with piecewise-constant permeability (evaluated for both forward flow and binary coefficient inversion).
  • Poisson Equation: Diffusion with source terms defined by thresholded Gaussian Random Fields.
  • Helmholtz Equation: Static inhomogeneous wave propagation with heterogeneous continuous coefficients.
  • 1D Dynamic Burgers' Equation: Time-dependent spatiotemporal field reconstruction.
  • Navier-Stokes (Appendix): Sparse observation flow dynamics.

Evaluations span clean full observations, sparse observations (only 3% known pixels), and noisy observations (10% to 100% of pixels corrupted with unit Gaussian noise $\mathcal{N}(0, 1)$).

Key Insights and Ideas

  • Physics as an architectural prior, not a loss penalty: Moving PDE residuals from an external objective into an architectural feature completely eliminates the need for test-time gradient steps.
  • Fourier-domain phase alignment matters: Spectral ablation shows that phase-aware cross-attention substantially outperforms naive spatial concatenation or magnitude-only spectral weighting. PDE errors carry distinct spatial frequencies; phase alignment pinpoints where and at what scale corrections are required.
  • Self-correcting closed-loop sampling: During generation, PRISMA acts as a 2nd-order predictor-corrector solver: it predicts a state, computes the residual of that state, and uses the residual within its own weights to correct the next step.

Key Results

  • Inference Speed: PRISMA converges in only 20 to 50 denoising steps, achieving an overall 15× to 250× speedup over competing diffusion methods. On Darcy Flow, PRISMA samples in 0.18s compared to FunDPS (11.8s) and DiffusionPDE (213.0s).
  • Robustness to Severe Noise: When inputs have 100% of pixels corrupted by Gaussian noise:
  • Darcy Forward ($L_2$ error): PRISMA achieves 12.28%, while FunDPS reaches 55.09% and DiffusionPDE 49.18%.
  • Helmholtz Inverse: PRISMA attains 67.93%, compared to FunDPS's 695.49% (divergence) and DiffusionPDE's 119.52%.
  • Zero-Shot Super-Resolution: A PRISMA model trained at $64\times 64$ smoothly scales up to $512\times 512$ grid inference without retraining.
  • Physical Consistency: Statistical residuals produced by PRISMA exhibit near-zero skewness and kurtosis across sampling steps, confirming errors are Gaussian-like noise rather than systematic physical violations.

Limitations and Future Work

  • Mesh & Geometry Constraints: PRISMA relies heavily on FFT-based operations within its spectral attention blocks, restricting the current implementation to structured regular grids rather than arbitrary geometries or irregular meshes.
  • High-Resolution Memory Overhead: While zero-shot super-resolution functions up to $512\times 512$, memory consumption scales drastically (from 4.1 GB reserved at $64\times 64$ to 107.1 GB at $512\times 512$).
  • Temporal Dynamics: The primary focus is static 2D PDEs; extending PRISMA beyond the 1D Burgers demonstration to complex 3D+time spatiotemporal systems remains future work.

Summary updated

Abstract

Diffusion-based solvers for partial differential equations (PDEs) are often bottle-necked by slow gradient-based test-time optimization routines that use PDE residuals for loss guidance. They additionally suffer from optimization instabilities and are unable to dynamically adapt their inference scheme in the presence of noisy PDE residuals. To address these limitations, we introduce PRISMA (PDE Residual Informed Spectral Modulation with Attention), a conditional diffusion neural operator that embeds PDE residuals directly into the model's architecture via attention mechanisms in the spectral domain, enabling gradient-descent free inference. In contrast to previous methods that use PDE loss solely as external optimization targets, PRISMA integrates PDE residuals as integral architectural features, making it inherently fast, robust, accurate, and free from sensitive hyperparameter tuning. We show that PRISMA is at-par or better in accuracy compared to previous methods across five benchmark PDEs especially with noisy observations, while using 10x to 100x fewer denoising steps, leading to 15x to 250x faster inference.
BibTeX
@misc{sawhney2025beyond,
  author = {Medha Sawhney and Abhilash Neog and Mridul Khurana and Anuj Karpatne},
  title = {{Beyond Loss Guidance: Using PDE Residuals as Spectral Attention in Diffusion Neural Operators}},
  year = {2025},
  eprint = {2512.01370},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.01370},
}
Figure