Source-linked AI summary
A Computational Comparison of Fourier Spectral Differentiation and Spatial Automatic Differentiation in Periodic Physics-Informed Neural Networks
Xilai Liang, Zhao Zhang
TL;DR
Spatial AD can impose substantial compute and memory costs when PDE residuals require multiple or high-order derivatives. This paper compares it with Fourier spectral differentiation in controlled periodic physical-space PINN experiments. Fourier differentiation is faster and uses less peak GPU memory across the tested settings, while final relative L2 errors remain of the same order.
Problem
Repeated AD for multiple or high-order spatial derivatives increases computational and memory costs during PINN training, motivating a controlled comparison with Fourier differentiation.
Source: §1 · pp. 2–3Method
The study compares spatial AD with Fourier spectral differentiation in paired standard and Causal PINNs, holding the other training components fixed.
Source: §1 · p. 3, §6 · p. 15Results
Across five equation–framework settings, Fourier differentiation yielded mean paired speedups of 2.90×–18.52× and reduced peak allocated GPU memory by 68.7%–94.1%, while final relative L2 errors remained of the same order with no consistent accuracy advantage.
Source: §6 · p. 16Takeaways & Limitations
For the one-dimensional periodic problems considered, Fourier differentiation reduced training computational cost without a consistent loss of solution accuracy.
Source: §6 · p. 16The comparison is limited to one-dimensional PDEs on uniform periodic grids and does not establish the same trade-off for non-periodic domains, irregular discretizations, or higher-dimensional problems.
Source: §5.3 · p. 15
Abstract
from arXiv · showhide
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\times$ to $18.52\times$ and reduces peak allocated graphics processing unit (GPU) memory by $68.7\%$--$94.1\%$. The final relative $L_2$ errors remain of the same order, with neither differentiation procedure showing a consistent accuracy advantage. For the one-dimensional 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
Repeated spatial automatic differentiation can raise training compute and memory costs, especially for PDEs requiring multiple or high-order derivatives. This study isolates the spatial differentiation procedure in paired periodic PINNs and reports lower training time and memory for Fourier differentiation, with errors of the same order.
1. Introduction
- Existing alternatives include finite-difference, coupled automatic–numerical, smoothing-kernel, first-order reformulation, and fused finite-difference approaches [2]–[6].These methods alter derivative evaluation or reformulate higher-order PDEs to reduce reliance on repeated spatial AD.Source: §1 · p. 2
- Prior spectral approaches include pseudo-spectral PINNs [7], neural spectral elements [8], SINN, Fourier feature-grid methods [10], and Fourier-filter differentiation in PhyCRNet.They use different neural representations or operator constructions to incorporate spectral or Fourier differentiation into physics-informed learning.Source: §1 · pp. 2–3
- Across five equation–framework settings, Fourier differentiation achieved mean paired speedups of 2.90×–18.52× and reduced peak allocated GPU memory by 68.7%–94.1%, with no consistent accuracy advantage.The comparison concerns one-dimensional periodic PINNs and requires a uniform structured spatial grid.Source: §1 · p. 3
2. Spatial Differentiation Procedures for Physical-Space PINNs
The paper compares spatial AD and Fourier spectral differentiation while keeping the neural representation and temporal differentiation procedure identical. It describes standard and causal residual formulations, then details the distinct spatial derivative procedures.
2. Spatial Differentiation Procedures for Physical-Space PINNs
- Both differentiation procedures use the same physical-space neural representation and temporal differentiation; only the spatial derivatives entering the PDE residual differ.The paper frames this as a comparison of spatial automatic differentiation and Fourier spectral differentiation.Source: §2 · p. 4
2.1. Standard and Causal PINN Formulations
- Standard PINNs weight temporal residual contributions uniformly, whereas Causal PINNs use Wang et al.’s temporal causal weighting; the causal parameter is fixed at ϵ = 0.1.The initial-condition contribution is evaluated on the same spatial grid as the residual.Source: §2.1 · pp. 4–5
2.2. Spatial Automatic Differentiation
- Spatial AD obtains the required PDE derivatives by repeated, nested Jacobian–vector product differentiation, while temporal differentiation follows the same JVP-based path in both cases.Only the spatial derivative orders appearing in each PDE residual are evaluated.Source: §2.2 · p. 5
2.3. Fourier Spectral Differentiation
- Fourier differentiation samples network outputs on an endpoint-excluded uniform periodic grid, transforms them to Fourier space, and applies spectral multipliers to obtain spatial derivatives.A single transform is reused across derivative orders; the results return to physical space for the PDE residual, with gradients propagated through the transforms.Source: §2.3 · pp. 5–6
3. Numerical Experiments
The experiments compare spatial AD and Fourier spectral differentiation across three periodic PDEs, using matched training conditions and specified reference solutions and evaluation measures.
3.1. Benchmark Problems
- The benchmarks are one-dimensional periodic Allen–Cahn, KdV, and KS equations, with spatial derivative sets uxx, (ux, uxxx), and (ux, uxx, uxxxx), respectively.Standard PINNs cover Allen–Cahn and KdV; Causal PINNs cover all three equations.Source: §3.1 · pp. 6–7
3.2. Experimental Setup
- Each spatial domain uses 256 uniform periodic grid points and the same eight-layer gated network, with matched temporal sampling schedules for paired runs.The network has width 128 and 122,625 trainable parameters; periodic Fourier features mean no separate spatial boundary-condition loss is used.Source: §3.2 · p. 7
- Paired AD and Fourier runs match initialization, sampling, network configuration, optimizer settings, reference data, and training length, changing only the spatial differentiation procedure.Each setting uses three seeds and 50,000 optimization steps; causal pairs also share causal weighting.Source: §3.2 · p. 7
3.3. Reference Solutions and Evaluation
- Allen–Cahn and KdV references use a refined Fourier pseudospectral solver, while KS uses the frozen trajectory accompanying Wang et al..Accuracy is measured by relative L2 error; for KS, the final error is evaluated over the complete 26 × 256 space–time array, not only the final time slice.Source: §3.3 · p. 8
- Training time covers the 50,000-step loop, and peak allocated GPU memory is measured immediately before that loop.The timed loop includes scheduled evaluation and logging but excludes initialization, warm-up, and post-training artifact generation; memory reduction is defined relative to AD.Source: §3.3 · pp. 8–9
4. Results
Across standard and Causal PINNs, Fourier spectral differentiation reduced training time and peak GPU memory, while final relative L2 errors remained of the same order without a consistent accuracy advantage. The paired comparisons covered three seeds per setting, with solution visualizations shown for seed 1234.
4. Results
- Each equation–framework setting used three paired random seeds, and aggregate values were reported as mean ± sample standard deviation.Seed 1234 supplied the solution-field visualizations; Table 1 summarizes error, speedup, and peak-memory reduction.Source: §4 · p. 9, Table 1 · p. 11
4.1. Standard PINN Results; 4.2. Causal PINN Results
- Across standard and Causal PINN experiments, neither spatial differentiation procedure showed a consistent final relative L2 error advantage.Errors remained of the same order for both procedures; paired rankings varied across random seeds.Source: §4.1 · p. 9, §4.2 · p. 11
4.1. Standard PINN Results
- Mean speedups were 3.19 ± 0.28× for standard Allen–Cahn and 7.85 ± 0.21× for standard KdV; Fourier also reduced peak GPU memory by 68.7% and 86.2%, respectively.Fourier reduced end-to-end training time for every paired seed.Source: §4.1 · p. 9, Figure 1 · p. 10
- For seed 1234, both procedures reproduced the displayed reference space–time structures for standard Allen–Cahn and KdV solutions.Figure 2 presents reference solutions, predictions, and pointwise absolute errors.Source: §4.1 · p. 9, Figure 2 · p. 10
4.2. Causal PINN Results
- Causal-PINN mean speedups were 2.90 ± 0.09×, 7.13 ± 0.16×, and 18.52 ± 2.65× for Allen–Cahn, KdV, and KS; peak-memory reductions were 68.7%, 86.2%, and 94.1%.Fourier reduced training time in all nine paired runs, and its peak memory remained near 0.285 GiB.Source: §4.2 · p. 11, Figure 3 · p. 12
- For seed 1234, both procedures reproduced the principal space–time structures of the displayed Causal-PINN Allen–Cahn, KdV, and KS solutions.Figure 4 presents the reference solutions, predictions, and pointwise absolute errors.Source: §4.2 · p. 11, Figure 4 · p. 13
5. Discussion
The discussion interprets the computational results through the derivative workload and end-to-end training costs, relates the controlled comparison to existing derivative-evaluation methods, and limits its conclusions to the tested settings.
5.1. Computational Interpretation
- Fourier reuses one transformed representation across derivative orders, but end-to-end gains also depend on how much training cost comes from derivative evaluation.Source: §5.1 · p. 14
- Across Causal PINN benchmarks, derivative count and maximum order rise alongside speedups and AD memory use, so the cross-equation trend is not a controlled scaling law.Source: §5.1 · p. 14
5.2. Relation to Existing Derivative-Evaluation Methods
- CAN-PINN and SK-PINN use numerical differentiation, SINN predicts spectral coefficients, and Fourier-filter PhyCRNet provides a precedent for spectral differentiation of network outputs [4].Source: §5.2 · pp. 14–15
- Fourier differentiation reduces end-to-end training time and peak allocated memory, while final relative L2 accuracy remains seed-dependent with no consistent advantage for either procedure.Source: §5.2 · p. 15
5.3. Scope and Limitations
- The comparison covers one-dimensional PDEs on uniform periodic grids; its speedups are hardware- and configuration-specific, and Causal PINNs use fixed ϵ = 0.1 without annealing.Source: §5.3 · p. 15
- Varying derivative workload within one fixed PDE and testing higher-dimensional periodic PDEs are proposed to examine scaling and whether runtime and memory gains persist.Source: §5.3 · p. 15
6. Conclusion
The study compares spatial automatic differentiation and Fourier spectral differentiation in physical-space PINNs, changing only the spatial differentiation procedure within paired setups. Fourier differentiation lowers training time and memory across the tested settings while solution errors remain comparable.
- The paired comparison holds other training components fixed and changes only spatial differentiation between automatic differentiation and Fourier spectral differentiation.Source: §6 · p. 15
- Across five equation–framework settings, Fourier spectral differentiation yields mean paired speedups of 2.90×–18.52× and reduces peak allocated GPU memory by 68.7%–94.1%, with no consistent accuracy advantage.Source: §6 · p. 16