PINNsFormer: A Transformer-Based Framework For Physics-Informed Neural Networks
Zhiyuan Zhao, Xueying Ding, B. Aditya Prakash
TL;DR
PINNs struggle to propagate initial conditions in time-aware PDEs due to neglect of temporal dependencies. The authors propose PINNsFormer, a Transformer-based framework that converts pointwise inputs into pseudo time sequences via a Pseudo Sequence Generator, and uses a Spatio-Temporal Mixer with an Encoder-Decoder and a novel Wavelet activation to capture temporal dynamics. Empirical results show PINNsFormer outperforms traditional PINNs and variants on convection, 1D-reaction, 1D-wave, and 2D Navier–Stokes PDEs, with smoother loss landscapes and better generalization, even when combined with NTK learning schemes. The approach balances accuracy and generalization with manageable overhead, and the Wavelet activation suggests broader applicability beyond PINNs.
Abstract
Physics-Informed Neural Networks (PINNs) have emerged as a promising deep learning framework for approximating numerical solutions to partial differential equations (PDEs). However, conventional PINNs, relying on multilayer perceptrons (MLP), neglect the crucial temporal dependencies inherent in practical physics systems and thus fail to propagate the initial condition constraints globally and accurately capture the true solutions under various scenarios. In this paper, we introduce a novel Transformer-based framework, termed PINNsFormer, designed to address this limitation. PINNsFormer can accurately approximate PDE solutions by utilizing multi-head attention mechanisms to capture temporal dependencies. PINNsFormer transforms point-wise inputs into pseudo sequences and replaces point-wise PINNs loss with a sequential loss. Additionally, it incorporates a novel activation function, Wavelet, which anticipates Fourier decomposition through deep neural networks. Empirical results demonstrate that PINNsFormer achieves superior generalization ability and accuracy across various scenarios, including PINNs failure modes and high-dimensional PDEs. Moreover, PINNsFormer offers flexibility in integrating existing learning schemes for PINNs, further enhancing its performance.
