Interpretability and Generalization Bounds for Learning Spatial Physics

Shuai Jiang (Marshall), Alejandro Francisco Queiruga, Theo Gutman-Solo, Shuai Jiang

Abstract

Scientific Machine Learning (SciML) models often achieve high accuracy on training data but fail to generalize to out-of-distribution (OOD) scenarios. This paper rigorously proves that the generalization of ML models in physics is strictly limited by the function space of the training data. By analyzing the 1D Poisson equation, we demonstrate that models learn a projection of the true physical operator onto the training subspace. We introduce a mechanistic interpretability framework to extract Green’s functions from model weights and provide theoretical error bounds that align with empirical observations.

Introduction: The "Eye Test" Trap

In SciML, a visually convincing simulation is often mistaken for a successful model. However, the "eye test" is a dangerous metric. Even if a model achieves near-zero error on its training set, it may have failed to learn the underlying physics, leaving it brittle when faced with slightly different data. This paper addresses a critical gap: why do models that look perfect on a test set fail spectacularly on out-of-distribution (OOD) data? Unlike traditional numerical analysis, current SciML lacks rigorous a priori error estimates, making them difficult to trust in high-stakes engineering scenarios.

Methodology: Probing the Subspace

The researchers use the 1D Poisson equation as a laboratory to combine classical numerical analysis with modern ML theory. The core approach involves:

  1. Theoretical Bounds: Deriving theorems to quantify how training data choice (e.g., polynomials vs. sines) and discretization grid ($\Delta x$) dictate final error.
  2. Subspace Analysis: Proving that a linear model trained via gradient descent converges to a specific projection of the true solution operator ($A$) onto the subspace spanned by the training data ($U$).
  3. Green’s Function Extraction: Proposing a novel interpretability lens where a trained model is "probed" with one-hot vectors to see if internal weights reconstruct the correct physical kernel (Green's function).
Figure 1: Overview of the methodology, comparing analytically derived solution operators with models learned from different datasets.

Datasets and Experimental Setup

To test generalization boundaries, the authors constructed 25 distinct synthetic datasets based on the 1D Poisson equation:

  • Piecewise Linear (FEM): Data generated using standard finite element basis functions.
  • Polynomials: Datasets ranging from degree 1 to 8.
  • Trigonometric: Sine and Cosine series with varying numbers of terms (1 to 8).

The framework was also extended to the 2D Poisson and 1D Biharmonic equations to ensure results hold for more complex linear PDEs.

Key Insights: The Subspace Blind Spot

A model only learns the physics it "sees." If trained only on smooth, low-degree polynomials, it becomes "blind" to high-frequency features. It hasn't learned the law of physics; it has learned a shortcut for that specific subspace.

Notably, Physics-Informed Neural Networks (PINNs) suffer from the same subspace limitations as pure black-box models. Adding the PDE into the loss function does not automatically guarantee generalization if the training data is narrow. For linear models, the weight matrix is the discrete Green’s function. When trained on "rich" enough data (like the FEM dataset), model weights converge to a tridiagonal-like structure representing the differential operator.

Key Results: OOD Error Explosions

Empirical results perfectly matched theoretical predictions. For linear models, weights converged exactly to $W^* = AUU^T$, proving the model is mathematically incapable of generalizing outside its training subspace.

Figure 4: Heatmap showing Mean Squared Error (MSE) when training on one function family and testing on others. Note the 8-order-of-magnitude jumps in error for OOD data.

As shown in the heatmaps, moving from a training subspace (e.g., Sine functions) to a test subspace (e.g., Polynomials) can cause the MSE to jump by 8 orders of magnitude ($10^8 \times$), even when training error is near zero. This "OOD explosion" highlights the danger of assuming generalization across different function families.

Limitations and Future Work

While the current theoretical proofs are centered on linear differential equations, extending these rigorous bounds to non-linear systems like Navier-Stokes remains a major challenge. Additionally, the paper assumes the function space of training data is known. Future work should focus on methods to discover the underlying subspace of "in-the-wild" data. The authors propose their cross-set generalization methodology as a new standard benchmark for Physics-ML models to ensure they have truly learned the underlying science.

Summary updated

BibTeX
@inproceedings{marshall2026interpretability,
  author = {Shuai Jiang (Marshall) and Alejandro Francisco Queiruga and Theo Gutman-Solo and Shuai Jiang},
  title = {{Interpretability and Generalization Bounds for Learning Spatial Physics}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=u0ZWIJ7x1F},
}
Figure