Can We Formally Verify Neural PDE Surrogates? SMT Compilation of Small Fourier Neural Operators

Ali Baheri, Ignacio Laguna Peralta · 2026

Read Can We Formally Verify Neural PDE Surrogates? SMT Compilation of Small Fourier Neural Operators by Ali Baheri, Ignacio Laguna Peralta (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-08938.txt.

Introduction

Ali Baheri and Ignacio Laguna Peralta ask whether neural surrogates for partial differential equations can be formally verified, not just tested. Once weights and grid are fixed, a small Fourier neural operator's forward pass is piecewise linear, so it compiles exactly into a solver's arithmetic. They compare that exact encoding against a lighter frozen shortcut that replaces the spectral path with a constant.

On ten tiny surrogates, the exact route produces sound proofs and counterexamples about positivity and mass behavior, beating sampling based falsification at finding worse violations, though some queries time out. The frozen route scales further but certifies only an approximation. Verification research gains an honest map of the soundness versus scale trade.

Catalog record

CREATORAli Baheri, Ignacio Laguna Peralta
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE20 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.08938

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Can We Formally Verify Neural PDE Surrogates? SMT Compilation of Small Fourier Neural Operators Ali Baheri, Ignacio Laguna Peralta Abstract Fourier Neural Operators (FNOs) can greatly accelerate PDE simulation, but they are often used without formal guarantees that they preserve basic physical structure. We show that, once the trained weights and grid are fixed, the spectral convolution in an FNO is a linear map. As a result, the full forward pass is piecewise-linear and can be represented exactly in Z3’s linear real arithmetic. We study two encodings. The exact encoding compiles the spectral convolution into a dense matrix multiplication, which is sound for both proofs and counterexamples. The lighter frozen encoding replaces the spectral path with a constant, making it faster but approximate. On 10 small FNO surrogates for 1D advection-diffusion-reaction (85 to 117 parameters, grids 8 to 32), the exact encoding gives 2 sound positivity proofs on linear (ReLU-free) models, 5 sound positivity counterexamples, and 10 sound mass-violation counterexamples; the remaining 3 positivity queries on ReLU models time out. For mass non-increase, Z3 finds worse counterexamples than both gradient-based falsification and Monte Carlo on 7 of 10 models. The frozen encoding scales to grid size 64 with sub-second positivity checks, but it no longer provides certificates for the original FNO. Overall, the results make the soundness–scalability tradeoff explicit and point to what is needed for formal verification of production-scale neural operators. 1 Introduction Learned PDE surrogates, including Fourier Neural Operators ( 7 ) and DeepONets ( 9 ) , can reduce the cost of scientific simulation by orders of magnitude. The remaining obstacle is trust. A surrogate may silently break conservation, produce negative concentrations, or introduce other nonphysical behavior, and these errors can then propagate through downstream analyses. Most validation pipelines rely on Monte Carlo (MC) testing, which only checks the inputs that were sampled. Formal verification offers a stronger alternative: an SMT solver can either certify that a property holds for every input in a prescribed region or return a concrete counterexample. Neural network verification is a mature and active area ( 5 ; 13 ) , but most existing tools are designed for classifiers or control policies. They do not directly address spectral convolutions, function-space inputs, or properties such as conservation and positivity. This paper begins from a simple observation with useful consequences: on a fixed grid, and with trained weights held fixed, the spectral convolution in an FNO is a composition of linear maps–the DFT, a learned mode-wise scaling, and the inverse DFT. Therefore, an FNO with ReLU nonlinearities is piecewise-linear and can be compiled into Z3 ( 2 ) without approximating the forward pass. Our contributions are as follows. First, we give an exact compilation of fixed-grid FNOs into Z3’s linear real arithmetic by constructing explicit spectral matrices. Second, to our knowledge, we give the first sound formal proofs for a neural PDE operator: positivity certificates for linear FNOs at grid sizes up to 16. Third, we compare Z3 with gradient-based falsification and MC across 10 small models. Finally, we characterize the soundness–scalability boundary: exact encodings support proofs for small linear models and counterexamples for somewhat larger ReLU models, while approximate encodings scale further but lose formal soundness. Although we use Z3 throughout, the compiled piecewise-linear representation is solver-agnostic and could be paired with specialized SMT, nonlinear, or neural-network verification tools in future work. 2 Related Work Neural PDE surrogates. FNOs ( 7 ) learn integral kernels in Fourier space, while DeepONets ( 9 ) represent operators through branch-trunk decompositions. Physics-informed networks ( 10 ) add PDE residuals to the training objective, and neural operator theory ( 6 ) gives approximation results for broad classes of operators. Together, these methods have made learned PDE surrogates increasingly practical. However, good predictive accuracy alone does not ensure that a trained surrogate respects physical constraints such as positivity or conservation. Neural network verification. Formal verification of neural networks has largely focused on classifiers and control policies. Reluplex ( 5 ) introduced SMT-style reasoning for ReLU networks, and \alpha - \beta -CROWN ( 13 ) scales bound propagation to large vision models. Related work in control and autonomy has studied safety validation and falsification for learning-enabled systems ( 11 ; 14 ; 1 ) . These methods share our goal of finding or ruling out unsafe behavior, but they do not directly target spectral convolutions, function-space inputs, or PDE-specific properties. Trustworthy surrogates. Physics-constrained architectures ( 12 ) reduce violations by building constraints into the model or the loss. Interval bound propagation ( 4 ) can certify output ranges for standard feedforward networks, while LyZNet ( 8 ) verifies Lyapunov stability and BEACONS ( 3 ) provides algebraic error bounds. To the best of our knowledge, prior work has not compiled a trained Fourier neural operator into an exact SMT representation for verifying physics-motivated properties over a continuous input set. 3 Method Trained FNO Grid N\!\in\!\{8,16,32\} Hidden H\!=\!2 85 to 117 params Spectral Matrix W_{\mathrm{spec}}\in\mathbb{R}^{NH\times NH} precomputed per layer Z3 SMT Encoding Exact: O(N^{2}H^{2}L) Frozen: O(NH^{2}L) Result UNSAT \Rightarrow Proof SAT \Rightarrow Sound CE build matrix translate to Z3 query property STAGE 1 STAGE 2 STAGE 3 STAGE 4 1D ADR, periodic BCs Averaged operator: each u_{0} paired with one (D,v,\lambda) draw Key insight: spectral conv with fixed weights = linear map on h Verified: error <10^{-15} Exact: full W_{\mathrm{spec}} (sound, dense, N\!\leq\!32 ) Frozen: spectral const. (fast, approximate, N\!\leq\!64 ) Exact UNSAT = sound proof Exact SAT = sound CE Frozen: approximate only (validate CE on original) Figure 1 : The FNO-to-SMT bridge. We compile the spectral convolution into an explicit dense matrix and then query physics-motivated properties with an SMT solver. The exact encoding is sound but dense; the frozen encoding is faster but approximate. Consider a single FNO hidden layer on a grid of size N with hidden width H . Let h\in\mathbb{R}^{N\times H} denote the hidden state. A spectral convolution applies a discrete Fourier transform, multiplies selected Fourier modes by learned complex weights, zeros or truncates the remaining modes, and then applies the inverse transform. Once the weights are fixed, this operation can be written as \mathcal{K}_{\ell}(h)=\operatorname{IFFT}\!\left(R_{\ell}\odot\operatorname{FFT}(h)\right), (1) where R_{\ell} contains the learned mode weights. Every operation in this expression is linear in h . Therefore, there is a real matrix W^{\mathrm{spec}}_{\ell}\in\mathbb{R}^{NH\times NH} such that \bm{(}\mathcal{K}_{\ell}(h))=W^{\mathrm{spec}}_{\ell}\bm{(}h). (2) We build W^{\mathrm{spec}}_{\ell} by applying the spectral convolution to each standard basis vector and stacking the resulting outputs as columns. In implementation, we validate this construction by comparing the dense matrix product against the FFT-based code path on random inputs; the largest observed discrepancy is below 10^{-15} . Proposition 1 . A fixed-grid FNO with fixed learned parameters and ReLU nonlinearities is a piecewise-linear map from the discretized input function to the discretized output function. Proof. The lifting layer, pointwise bypass maps, spectral matrices, and projection layer are affine maps over the real-valued grid representation. ReLU is piecewise-linear and is applied coordinate-wise. A finite composition of affine maps and coordinate-wise piecewise-linear maps is piecewise-linear. ∎ 3.1 Exact Encoding The exact encoding merges the spectral matrix and pointwise bypass map into one affine expression per layer. After vectorization, a hidden layer can be written as z^{(\ell)}=\left(W^{\mathrm{spec}}_{\ell}+W^{\mathrm{byp}}_{\ell}\right)h^{(\ell-1)}+b_{\ell},\qquad h^{(\ell)}=\sigma(z^{(\ell)}), (3) where \sigma(t)=\max(t,0)

Read the complete text