Achieving High Accuracy with PINNs via Energy Natural Gradients

Johannes Müller, Marius ZeinhoferarXiv 2023

Abstract

We propose energy natural gradient descent, a natural gradient method with respect to a Hessian-induced Riemannian metric as an optimization algorithm for physics-informed neural networks (PINNs) and the deep Ritz method. As a main motivation we show that the update direction in function space resulting from the energy natural gradient corresponds to the Newton direction modulo an orthogonal projection onto the model's tangent space. We demonstrate experimentally that energy natural gradient descent yields highly accurate solutions with errors several orders of magnitude smaller than what is obtained when training PINNs with standard optimizers like gradient descent or Adam, even when those are allowed significantly more computation time.

Introduction

Physics-Informed Neural Networks (PINNs) have emerged as a powerful mesh-free alternative for solving partial differential equations (PDEs), particularly in high-dimensional settings. Despite their versatility, PINNs suffer from a persistent training challenge: they often struggle to reach high precision. While traditional numerical methods like Finite Elements can achieve machine precision, PINN solutions frequently plateau at relative $L^2$ errors around $10^{-3}$. This limitation is often attributed to the "stiffness" of the optimization landscape in parameter space, where standard optimizers fail to respect the underlying geometry of the function space.

Energy Natural Gradient Descent (E-NGD)

Standard optimizers like Adam or BFGS update network weights based on the geometry of the parameter space. However, this geometry does not necessarily align with the functional landscape of the PDE solution. To bridge this gap, we introduce Energy Natural Gradient Descent (E-NGD).

E-NGD utilizes the Hessian of the PDE's energy functional as a Riemannian metric. By defining an "Energy Gram matrix" ($G_E$) based on the second derivative of the training objective, the parameter update is calculated as: $$\theta_{k+1} = \theta_k - \eta G_E^+ \nabla L(\theta)$$ where $G_E^+$ is the pseudo-inverse of the Gram matrix. Theoretically, for quadratic energies, this update in parameter space corresponds exactly to a projected Newton step in function space. This allows the optimizer to "understand" the underlying physics, navigating the landscape far more effectively than standard gradient-based methods.

Experimental Evaluation

The efficacy of E-NGD was tested across several benchmark PDEs, including 2D and 5D Poisson equations, the 1D heat equation, and nonlinear elliptic equations via the Deep Ritz method. These benchmarks provide analytical solutions for precise error quantification.

Figure 1: Convergence of relative $L^2$ error across iterations for various optimizers. E-NGD (dashed blue) achieves significantly lower error than standard methods like Adam or BFGS in far fewer iterations.

Results and Discussion

Our experiments demonstrate that E-NGD consistently achieves accuracy levels several orders of magnitude higher than baseline optimizers. In the 2D Poisson benchmark, E-NGD reached a median relative $L^2$ error of $2.4 \times 10^{-7}$, whereas Adam and BFGS plateaued at $10^{-3}$ and $10^{-4}$, respectively.

The Efficiency Paradox

While an individual E-NGD iteration is computationally more expensive than an Adam iteration due to the matrix inversion requirement, the total wall-clock time to reach convergence is drastically lower. E-NGD requires only hundreds of iterations to reach high precision, compared to the hundreds of thousands required by standard first-order methods.

Figure 6: Comparison of computational cost and total optimization time. Despite higher per-iteration costs, E-NGD is orders of magnitude faster in total time to reach convergence.

As shown in the table above, for the 2D Poisson problem, E-NGD achieved its high-accuracy solution in just 43 seconds. In contrast, Gradient Descent (GD) required a full hour to reach a significantly less accurate result. This massive speedup highlights the importance of choosing an optimizer that respects the problem's functional geometry.

Conclusion

E-NGD addresses the "stiffness" problem in PINN training by aligning optimization steps with the physical energy landscape of the PDE. While the $O(p^3)$ scaling of the Gram matrix inversion presents a challenge for very large networks, the massive gains in accuracy and total training speed make it a compelling choice for high-precision scientific computing. Future work will focus on scaling these methods through efficient linear algebra approximations like K-FAC and specialized initialization schemes.

Summary updated

BibTeX
@misc{muller2023achieving,
  author = {Johannes Müller and Marius Zeinhofer},
  title = {{Achieving High Accuracy with PINNs via Energy Natural Gradients}},
  year = {2023},
  eprint = {2302.13163},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.13163},
}
Figure