arXiv:2609.02110cs.LGSep 2026

Manuscript Offprint

arXiv:2609.02110

A Computational Comparison of Fourier Spectral Differentiation and Spatial Automatic Differentiation in Periodic Physics-Informed Neural Networks

Xilai Liang, Zhao Zhang

Abstract

Physics-informed neural networks (PINNs) commonly evaluate the spatial derivatives appearing in partial differential equation residuals using automatic differentiation (AD), whose computational and memory costs can become substantial when multiple or high-order derivatives are required. We perform a controlled comparison of spatial AD and Fourier spectral differentiation in periodic physical-space PINNs. Within each paired experiment, the neural representation, temporal differentiation, optimizer, sampling procedure, and training schedule are held fixed, so that the two cases differ only in the spatial differentiation procedure. For the Fourier variant, network outputs are evaluated on a uniform periodic grid and transformed to Fourier space, where spatial derivatives are obtained through spectral multiplication and the same Fourier coefficients are reused across derivative orders. We compare the two procedures in standard PINNs for the Allen–Cahn and Korteweg–de Vries equations and in Causal PINNs for the Allen–Cahn, Korteweg–de Vries, and Kuramoto–Sivashinsky equations. Across these five equation–framework settings, Fourier differentiation yields mean paired end-to-end training speedups ranging from 2.90×2.90\times to 18.52×18.52\times and reduces peak allocated graphics processing unit (GPU) memory by 68.7%–94.1%. The final relative L2L_2 errors remain of the same order, with neither differentiation procedure showing a consistent accuracy advantage. For the one-dimensional

*Corresponding authors

Email addresses: liang24532@gtiit.edu.cn (Xilai Liang), zhaozhang@sdu.edu.cn (Zhao Zhang) periodic benchmarks considered here, Fourier spectral differentiation therefore provides substantially lower training time and memory usage than spatial AD while retaining comparable solution error, at the cost of requiring a uniform structured spatial grid.

1. Introduction

Physics-informed neural networks (PINNs) approximate solutions to partial differential equations (PDEs) by representing the unknown field with a neural network and incorporating the governing equations, initial conditions, and boundary conditions into the training objective [1]. In coordinate-based PINNs, the derivatives required by the PDE residual are commonly evaluated by automatic differentiation (AD) with respect to the network inputs [1]. This provides pointwise derivatives without introducing an external spatial discretization, but derivative evaluation is required at every residual computation. When a PDE contains multiple spatial derivative terms or high-order derivatives, repeated AD introduces additional differentiation operations and larger derivative graphs, increasing both computational and memory costs during training.

Several approaches reduce or avoid this dependence on spatial AD through numerical differentiation or reformulation of the governing equations. Sharma and Shankar [2] used radial basis function finite-difference discretizations to evaluate spatial derivatives while retaining AD for temporal derivatives in time-dependent problems. The coupled automatic-numerical differentiation physics-informed neural network (CAN-PINN) combines AD and numerical differentiation to couple neighboring support points [3], whereas the smoothing-kernel physics-informed neural network (SK-PINN) evaluates derivatives through smoothing-kernel discretization [4]. A different strategy is to reduce repeated high-order differentiation by rewriting higher-order PDEs as first-order systems, as in first-order physics-informed neural networks [5]. More recently, FlashPDE has treated derivative evaluation as a differentiable grid-based operator layer and implemented fused finite-difference operators independently of the surrounding neural architecture [6].

Spectral discretizations provide another route for evaluating the derivatives used in physics-informed objectives. Pseudo-spectral PINN formulations have employed spectral discretization for physics-informed model discovery [7], while neural spectral element methods evaluate neural fields on fixed spectral nodes and replace derivative calls with spectral differentiation matrices [8]. The Spectral Informed Neural Network (SINN) represents the solution through Fourier coefficients and converts spatial differentiation into multiplication in the spectral domain [9]. Other recent approaches, such as trainable Fourier feature-grid formulations, also use Fourier-transform-based derivative evaluation within modified neural representations [10]. Xiao et al. [11] replaced the finite-difference filter in a physics-informed convolutional recurrent network (PhyCRNet) with a Fourier filter, transforming network outputs to Fourier space for spatial differentiation and returning the resulting quantities through the inverse transform for construction of the physics-informed loss. These studies establish that numerical and spectral differentiation can be incorporated into physics-informed learning through several neural representations and operator constructions.

This study addresses a controlled computational question: when the surrounding physical-space PINN formulation is held fixed, how much of the lower derivative cost of Fourier spectral differentiation translates into end-to-end training-time and memory savings relative to spatial AD, and how does the change affect solution accuracy? A cheaper derivative operator does not necessarily yield a proportional end-to-end speedup when network evaluation or other components dominate the training loop; Fourier filter-based PhyCRNet reports such behavior when its time-series module accounts for most of the computational cost [11]. We examine this question in both standard PINNs and Causal PINNs, where the latter use the temporal causal weighting formulation of Wang et al. [12]. Standard PINNs are evaluated on the Allen–Cahn and Korteweg–de Vries (KdV) equations, and Causal PINNs are evaluated on Allen–Cahn, KdV, and Kuramoto–Sivashinsky (KS). Each equation–framework setting uses three paired random seeds, with all components of each paired training setup held fixed except the spatial differentiation procedure. We compare final relative L2L_2 error, end-to-end training time, and peak allocated memory. Across the five equation–framework settings, Fourier spectral differentiation yields mean paired speedups ranging from 2.90×2.90\times to 18.52×18.52\times and reduces peak allocated memory by 68.7%−94.1%68.7\%-94.1\%. The final relative L2L_2 errors remain of the same order, with neither differentiation procedure showing a consistent accuracy advantage. These results characterize the computational trade-off between spatial AD and Fourier spectral differentiation for the one-dimensional periodic PINNs considered here, where the Fourier procedure requires a uniform structured spatial grid.