Abstract
Physics-informed neural networks (PINNs) have enabled significant improvements in modelling physical processes described by partial differential equations (PDEs) and are in principle capable of modeling a large variety of differential equations. PINNs are based on simple architectures, and learn the behavior of complex physical systems by optimizing the network parameters to minimize the residual of the underlying PDE. Current network architectures share some of the limitations of classical numerical discretization schemes when applied to non-linear differential equations in continuum mechanics. A paradigmatic example is the solution of hyperbolic conservation laws that develop highly localized nonlinear shock waves. Learning solutions of PDEs with dominant hyperbolic character is a challenge for current PINN approaches, which rely, like most grid-based numerical schemes, on adding artificial dissipation. Here, we address the fundamental question of which network architectures are best suited to learn the complex behavior of non-linear PDEs. We focus on network architecture rather than on residual regularization. Our new methodology, called physics-informed attention-based neural networks (PIANNs), is a combination of recurrent neural networks and attention mechanisms. The attention mechanism adapts the behavior of the deep neural network to the non-linear features of the solution, and break the current limitations of PINNs. We find that PIANNs effectively capture the shock front in a hyperbolic model problem, and are capable of providing high-quality solutions inside the convex hull of the training set.
Introduction: The Challenge of Hyperbolic Conservation Laws
Hyperbolic partial differential equations (PDEs) are fundamental to continuum mechanics, governing phenomena ranging from gas dynamics to traffic flow. A defining characteristic of these equations is their tendency to develop shocks—localized, non-linear discontinuities where the solution changes abruptly.
Traditional numerical methods, such as finite difference schemes, often struggle to resolve these shocks accurately. They typically produce spurious oscillations or require the addition of "artificial dissipation" to maintain stability, which can blur the sharp features of the solution. Standard Physics-Informed Neural Networks (PINNs), which generally utilize simple multilayer perceptron (MLP) architectures, face similar difficulties. Without prior knowledge of shock locations or heavy regularization, standard PINNs often fail to capture the sharp nature of these discontinuities. This research introduces a novel architecture designed to inherently adapt to these non-linear features.
Methodology: Physics-Informed Attention-Based Neural Networks (PIANNs)
The proposed PIANN architecture departs from the standard MLP approach by integrating sequence-processing capabilities and adaptive focus mechanisms.
Key Architectural Features:
- Encoder-Decoder GRUs: The model employs Gated Recurrent Units (GRUs) to treat spatial locations as a sequence. This allows the network to capture non-local relationships across the computational grid.
- Attention Mechanism: This core innovation allows the network to learn relationships between different spatial points. The attention layer enables the model to "focus" its representational capacity on the shock front, effectively identifying and sharpening the discontinuity.
- Hard Constraints: Unlike standard PINNs that treat initial and boundary conditions as penalty terms in the loss function, PIANNs enforce these conditions as hard constraints directly within the network architecture, improving stability and convergence.
- Physics-Informed Loss: The network is trained by minimizing the residual of the PDE using automatic differentiation. This ensures the model learns the underlying physics without requiring labeled simulation data.
Application: The Buckley–Leverett Problem
The study evaluates PIANNs using the Buckley–Leverett problem, a classic benchmark for two-phase flow in porous media (e.g., water displacing oil). The training set involved a grid of 101 spatial points and 51 time steps across a range of fluid mobility ratios ($M \in [2, 100]$).
As shown in the results, PIANNs demonstrate high precision, capturing the shock front with an average absolute error of less than $10^{-3}$. The model achieved fast convergence, with residual values dropping below $10^{-4}$ within a few training epochs. Notably, the architecture remains stable across different resolutions, avoiding the strict step-size requirements (CFL conditions) often found in traditional computational fluid dynamics (CFD).
Key Insights and Discussion
A major finding of this work is that architecture is more critical than regularization. While most PINN research focuses on tweaking loss functions or adding dissipation, PIANNs demonstrate that a physics-specific architecture (recurrence + attention) is naturally suited for the self-sharpening nature of hyperbolic waves.
The attention weights ($\alpha_{i,j}$) serve as an internal diagnostic; when visualized, they "light up" at the shock location, proving the mechanism successfully identifies the discontinuity. This allows the model to provide smooth, accurate shocks using central difference schemes, suggesting the architecture provides a form of "smart" regularization.
Conclusion and Future Work
PIANNs represent a significant step forward in solving non-linear PDEs with sharp discontinuities. By combining GRUs and attention mechanisms, the model breaks the limitations of standard PINNs and traditional numerical schemes.
Future work will address the quadratic scaling ($O(N^2)$) of the attention mechanism, which currently limits its application in massive 3D simulations. Exploring sparse or linear-complexity attention mechanisms could enable PIANNs to handle higher-dimensional problems and complex real-world phenomena like carbon sequestration.
Summary updated