Achieving High Accuracy with PINNs via Energy Natural Gradient Descent

Johannes Müller, Marius ZeinhoferICML 2023

Physics-Informed Neural Networks (PINNs) and the Deep Ritz method have emerged as powerful, mesh-free approximators for solving partial differential equations (PDEs). However, they frequently encounter a well-documented "stiffness" issue: standard first-order optimizers like Adam, and even quasi-Newton methods like BFGS, often plateau at a relative $L^2$ error of around $10^{-3}$.

In scientific computing, where high precision is often mandatory, this $10^{-3}$ limit is a significant bottleneck. This plateau isn't due to the neural network's inability to represent the solution, but rather a failure of the optimization landscape. Standard gradients in parameter space (the weights of the network) do not translate well to meaningful updates in function space (the actual shape of the solution).

To break this accuracy barrier, researchers have introduced Energy Natural Gradient Descent (E-NGD), a novel optimization method that allows PINNs to achieve unprecedented levels of precision.

Enter Energy Natural Gradient Descent (E-NGD)

While standard Natural Gradient Descent often uses the Fisher Information Matrix (common in statistics) or Sobolev metrics, E-NGD uses a Riemannian metric induced by the Hessian of the energy functional of the PDE itself.

Key technical components of this approach include:

  • Energy Gram Matrix ($G_E$): Instead of a standard identity matrix or Fisher matrix, the parameter update is preconditioned by a matrix derived from the second derivative (Hessian) of the PDE loss.
  • Function Space Perspective: An E-NGD update in parameter space mathematically corresponds to a Newton update in function space, projected onto the network's tangent space. For quadratic energies, this update moves directly toward the true solution.
  • Practical Implementation: The algorithm includes a line search to determine the optimal step size, ensuring that the "Newton-like" step strictly decreases the loss. It is also compatible with both deterministic (grid-based) and stochastic (randomly sampled) collocation points.

Experimental Results & Efficiency

The researchers tested E-NGD across several benchmark mathematical problems with known analytical solutions, including the 2D and 5D Poisson equations, the 1D Heat equation, and a 1D Nonlinear Elliptic equation.

The most profound insight from these tests is that by choosing the right metric (the Energy Hessian), a first-order update on the weights becomes a highly efficient second-order update on the function.

Relative L2 error vs. Iterations comparing E-NGD to standard optimizers.

As seen in the training curves, while Adam and BFGS struggle to pass $10^{-3}$ or $10^{-4}$ relative error, E-NGD consistently plummets to $10^{-7}$ or $10^{-8}$.

Table comparing median, minimum, and maximum relative L2 errors across optimizers.

In the 2D Poisson test, E-NGD achieved a median relative $L^2$ error of $2.4 \times 10^{-7}$, compared to $1.1 \times 10^{-3}$ for Adam and $4.4 \times 10^{-4}$ for BFGS. Furthermore, E-NGD maintained high accuracy ($10^{-6}$ range) in 5D using batched random sampling, proving it scales to higher dimensions. Even for nonlinear problems where the Hessian changes at every step, E-NGD reached errors of $10^{-8}$.

Efficiency vs. Cost: Although each iteration of E-NGD is more computationally expensive than Adam—due to the $O(p^3)$ cost of inverting the Gram matrix, where $p$ is the number of parameters—it requires so few iterations that the total wall-clock time is often significantly lower. For instance, in the 2D Poisson case, E-NGD reached peak accuracy in just 43 seconds, while Adam took over an hour to reach a much worse result.

Limitations and Future Directions

While E-NGD represents a massive leap in PINN accuracy, it comes with computational trade-offs:

  • Parameter Scaling: The primary bottleneck is the $O(p^3)$ complexity relative to the number of network parameters. This currently limits the method to relatively small networks (e.g., widths of 32-64 neurons).
  • Large-Scale Implementation: For "foundation-model" sized PINNs, more efficient ways to approximate or invert the Energy Gram matrix—perhaps via iterative solvers or sketching—will be necessary.
  • Initialization Sensitivity: While generally robust, E-NGD can occasionally fail to train depending on the network's initialization, suggesting that specialized initialization schemes for natural gradients could be a fruitful area for future research.

Summary updated

BibTeX
@inproceedings{muller2023achieving,
  author = {Johannes Müller and Marius Zeinhofer},
  title = {{Achieving High Accuracy with PINNs via Energy Natural Gradient Descent}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=bB5vhS5PVi},
}
Figure