Near-optimal Sketchy Natural Gradients for Physics-Informed Neural Networks

Maricela Best Mckay, Avleen Kaur, Chen Greif, Brian WettonICML 2025

Executive Summary

This paper introduces Sketchy Natural Energy Gradient Descent (SNGD), a randomized algorithm that makes high-performance natural gradient optimization practical for large-scale Physics-Informed Neural Networks (PINNs). By leveraging "sketching" techniques to approximate the computationally expensive Gram matrix, the authors achieve training speedups of over 100x and scale PINNs to over a million parameters. Remarkably, this sketched approximation frequently outperforms the accuracy of the original, non-sketched natural gradient methods.

The Challenge with PINNs

Physics-Informed Neural Networks (PINNs) are a powerful tool for solving partial differential equations (PDEs), but they are notoriously difficult to train. Standard first-order optimizers like ADAM often struggle with "spectral bias," where the network learns low-frequency components of a solution quickly but fails to capture high-frequency details.

Second-order methods and Natural Energy Gradient Descent (ENGD) can solve this by accounting for the underlying geometry of the function space. However, ENGD requires computing and inverting a massive "Gram matrix" (the Gramian). For a network with $N$ parameters, this matrix has $N^2$ entries. If you have a million parameters, the matrix alone would require terabytes of RAM, making natural gradients prohibitively expensive for anything but tiny toy models.

Sketchy Natural Energy Gradient Descent (SNGD)

To sidestep the full Gramian calculation, the authors propose SNGD, which relies on Randomized Numerical Linear Algebra (sketching):

  1. Sketching: Instead of forming the full $N \times N$ Gram matrix $G$, the algorithm multiplies it by a small random Gaussian matrix $M$ to create a "sketch" $A = GM$.
  2. Implicit Computation: This sketch is computed directly without ever forming the full matrix $G$ in memory, drastically reducing overhead.
  3. Low-Rank Approximation: The authors prove that for PINNs, the Gramian’s eigenvalues decay exponentially. This means the matrix is "numerically low-rank"—most of its important information is compressed into just a few dimensions.
  4. RSVD: They use Randomized Singular Value Decomposition (RSVD) on the sketch to find a near-optimal low-rank approximation of the natural gradient direction.
Exponential decay of eigenvalues in the Gramian matrix

Theoretical & Empirical Insights

  • The "Low-Rank" Secret: The most significant insight is the theoretical and empirical proof that the Gramian in PINNs has rapidly decaying eigenvalues. This isn't just a lucky break; it’s a structural property of how neural networks represent functions, justifying the use of low-rank approximations.
  • Randomness as a Feature: Surprisingly, the sketched (approximate) gradient often leads to better accuracy than the exact natural gradient. The authors suggest the randomness introduced by sketching acts as an implicit regularizer, helping the optimizer find "flatter" and more stable local minima.
  • Overcoming Spectral Bias: By using the Gramian to precondition the gradient, SNGD effectively "stretches" the loss landscape, allowing the network to learn high-frequency components much faster than standard gradient descent.

Performance & Scalability

The authors evaluated SNGD on four classic PDE benchmarks: the 1D Heat Equation, 2D Poisson Equation, a Non-linear Boundary-Value Problem, and the notoriously challenging 1D Transport Equation.

  • Massive Speedups: For a network with ~5,000 parameters, training time dropped from several hours (using standard ENGD) to under two minutes with SNGD.
  • Extreme Scalability: The authors successfully optimized a PINN with over 1.08 million parameters in just a few minutes. This task is impossible for standard natural gradient methods because the full Gram matrix would not fit in memory.
  • Superior Accuracy: In the Heat Equation tests, SNGD achieved errors one to two orders of magnitude smaller than standard natural gradients and roughly three orders of magnitude smaller than ADAM.
  • Solving the "Unsolvable": On the high-speed Transport Equation, SNGD reached state-of-the-art accuracy across all test runs, while standard natural gradients failed to converge in 60% of cases.
Loss comparisons and scalability to over 1 million parameters

Limitations & Future Work

While highly effective, SNGD has a few limitations. The algorithm is sensitive to the truncation threshold used during the sketching process; a threshold that is too high might lose critical information, while one too low might introduce numerical instability. Additionally, while matrix operations are faster, the method still relies on numerical integration (quadrature) to form the sketch, which can become a bottleneck for very complex PDE operators. Future work will need to explore how SNGD performs on extremely high-dimensional PDEs (e.g., in finance or quantum chemistry) or on non-linear systems with chaotic behavior.

Summary updated

BibTeX
@inproceedings{mckay2025near,
  author = {Maricela Best Mckay and Avleen Kaur and Chen Greif and Brian Wetton},
  title = {{Near-optimal Sketchy Natural Gradients for Physics-Informed Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=bKsZomnmqn},
}
Figure