When modeling physical systems governed by partial differential equations (PDEs), researchers traditionally face a strict trade-off. Classical numerical methods, such as finite difference or finite element techniques, offer rigorous convergence guarantees and clear mathematical interpretability, but they are computationally expensive and cannot easily adapt to data. Conversely, standard deep learning models, such as Convolutional Neural Networks (CNNs), are exceptionally fast and flexible, but they operate as unconstrained black boxes. Left to themselves, standard networks frequently violate fundamental physical laws, amplify high-frequency noise, and fail catastrophically when rolling out predictions over long time horizons.
To bridge this gap, a powerful paradigm has emerged: learnable finite-difference stencils. Instead of forcing a neural network to learn arbitrary spatial correlations from scratch, this approach structures convolutional kernels or local message-passing functions to act explicitly as mathematical differential operators. By constraining these operators to satisfy the underlying calculus of derivatives while allowing their discretization coefficients to be optimized from data, this framework achieves data-driven discretization that is both physically grounded and highly adaptive.
The Intuition: Convolutions as Stencils
To understand why this approach works, we can look at the mathematical equivalence between a discrete convolution and a classical finite-difference stencil. To approximate a spatial derivative $\partial u / \partial x$ on a uniform grid, a standard numerical scheme subtracts the value of a neighboring grid point from another and scales the result by the grid spacing. This operation is structurally identical to applying a discrete convolutional kernel (such as $[-0.5, 0, 0.5]$) across a matrix of spatial features.
As shown by Jian-Xun Wang et al. and Hao Ma Hao et al., fixed convolutional kernels can be embedded directly into neural network architectures or loss functions to evaluate physical residuals and spatial gradients efficiently using hardware-accelerated convolution operations.
However, the core innovation of this field is making these stencils learnable. Rather than relying on rigid, hand-crafted coefficients derived from a fixed Taylor series expansion, works such as Suprosanna Shit et al. and Bin Dong et al. parameterize stencils as learnable convolutional layers. This allows the network to discover optimal, data-driven discretization schemes tailored to the specific, non-linear dynamics of the underlying physical system, drastically reducing error and improving stability during long-term simulations.
Enforcing Rigor via Moment Constraints and Sum Rules
If a convolutional kernel is completely free to learn any arbitrary set of weights, it quickly loses its physical meaning and reverts to a standard black-box filter. To prevent this, researchers impose structural mathematical constraints on the kernels to ensure they correspond strictly to valid partial derivatives of a specific order.
The primary mechanism for enforcing this behavior is the use of moment matrices and sum rules. In numerical analysis, a discrete stencil accurately approximates a given derivative if its weights satisfy precise algebraic conditions. For example, a first-order derivative operator must have a weight sum of exactly zero; otherwise, applying it to a constant physical field would incorrectly yield a non-zero gradient.
Standard CNN Kernel Constrained Stencil Kernel
[ +0.2, -0.5, +0.8 ] ---> [ -0.5, 0.0, +0.5 ] (Sum = 0)
(Arbitrary features) (Guaranteed First Derivative)
In the foundational PDE-Net framework introduced by Yiping Lu et al. and expanded in PDE-Net 2.0 by Zichao Long et al., convolutional filters are explicitly constrained via moment matrices. By forcing the filter moments to match the properties of specific partial derivatives, the network's weights are guaranteed to represent true physical coefficients (such as advection speeds or diffusion rates), making the learned model fully interpretable and symbolic.
This constraint mechanism has proven highly versatile across different domains:
- Symmetry and Noise Suppression: On sparse or coarse spatial grids where numerical noise easily destabilizes simulations, Qi Wang et al. (and in their parallel work Qi Wang et al.) demonstrated that constraining convolutional filters to be symmetric and bound by strict sum rules suppresses low-frequency noise and preserves local physical sensitivity.
- Optimization in Moment Space: To make training more robust, Chi Chiu So et al. developed an invertible mapping between convolutional filters and moment tensors. This allows networks to optimize directly inside the moment space, keeping the target derivative order fixed while the model learns the optimal discretization coefficients.
- Spatiotemporal Generative Modeling: Yakir Yehuda applied mathematical moment constraints to 1D convolutional filters to maintain mathematical rigor in generative models for physical signals.
- Unsupervised Video Prediction: In PhyDNet, Nicolas THOME et al. used moment constraints on convolutional kernels to cleanly disentangle underlying physical dynamics from latent appearance factors like texture and lighting.
- Structural Stabilization: Even in pure image processing, Stamatios Lefkimmiatis showed that enforcing zero-mean and fixed-scale constraints on CNN filters guarantees they function as valid differential operators, stabilizing deep architectures.
Generalizing Beyond Uniform Grids
While standard convolutions assume a perfectly uniform grid, real-world physical systems often involve irregular geometries, complex boundary conditions, or varying spatial resolutions. The core philosophy of learnable stencils has been generalized to handle these unstructured domains.
To achieve resolution independence on grids, Miguel Liu-Schiaffini et al. centered standard convolutional kernels and scaled them explicitly by the reciprocal of the grid spacing. This simple scaling ensures that the learned stencils remain mathematically consistent and physically accurate even if the underlying mesh density changes during inference.
Uniform Grid Convolution Unstructured Mesh / Graph
[ -0.5, 0.0, +0.5 ] Node i <-- (Message Passing) -- Node j
(Fixed spatial spacing) (Scaled by relative distance/geometry)
For completely unstructured data, such as point clouds or irregular finite element meshes, researchers replace standard grid convolutions with localized geometric operations:
- Message Passing as Stencils: Johannes Brandstetter et al. demonstrated that graph message-passing operations can be structured to function as non-linear numerical stencils. By feeding relative positions and solution differences directly into the message updates, the network learns to approximate derivative operators across arbitrary spatial graphs.
- Generalized Moving Least Squares (GMLS): Nathaniel Trask et al. introduced GMLS-Nets, a framework that uses local approximation theory to construct physically interpretable derivative operators on unstructured meshes, ensuring that the learned features map directly to identifiable operators like gradients or Laplacians.
- Meshfree Conservation Layers: Ning Liu et al. developed specialized linear differentiation layers that adaptively switch between Fourier-based methods for uniform regions and high-order meshfree approximations for irregular boundaries, allowing conservation laws to be hard-coded into neural operators.
Why the Inductive Prior Works
The success of learnable finite-difference stencils comes down to the power of a restricted hypothesis space. Standard neural networks waste significant capacity trying to learn the basic rules of spatial calculus from data. By embedding constraints—whether through moment matrices, sum rules, or localized geometric scaling—directly into the network's architecture, the model is granted an unyielding physical inductive prior.
Because the network can only express operations that behave like valid differential equations, it focuses entirely on optimizing the discretization of those equations for the data at hand. The result is a class of solvers that combines the best of both worlds: the data-driven adaptability of deep learning alongside the stability, interpretability, and conservation properties of classical numerical analysis.
Key Foundational Work
Learning data-driven discretizations for partial differential equations (2019) — contributed 4 concept elements to this direction.
PDE-Net: Learning PDEs from Data (2018) — contributed 3 concept elements to this direction.
fPINNs: Fractional Physics-Informed Neural Networks (2019) — contributed 2 concept elements to this direction.