Position: Optimization in SciML Should Employ the Function Space Geometry

Johannes Müller, Marius Zeinhofer

The Bottleneck in SciML Optimization

Scientific Machine Learning (SciML) is currently hindered by a "discretize-then-optimize" mindset borrowed directly from standard deep learning. In traditional deep learning tasks like image recognition, we optimize a finite set of weights to minimize a loss function. In SciML, however, the goal is often to find a function that satisfies a physical law, such as a Partial Differential Equation (PDE).

Standard first-order optimizers like Adam or Stochastic Gradient Descent (SGD) frequently plateau when training Physics-Informed Neural Networks (PINNs). These optimization landscapes are notoriously "badly conditioned," making them rugged and difficult to navigate. While the community has attempted various workarounds, such as adaptive loss weighting, this paper argues that the fundamental issue is being ignored: the geometry of the function space where the physics actually resides.

A "First Optimize, Then Discretize" Paradigm

The authors advocate for a paradigm shift to a "first optimize, then discretize" approach. By treating neural networks as elements of infinite-dimensional function spaces, we can derive powerful second-order optimizers that outperform standard methods by several orders of magnitude.

The proposed framework involves three key steps:

  1. Formulate in Function Space: Start with the problem in an infinite-dimensional Hilbert space, representing all possible candidate functions.
  2. Choose a Continuous Algorithm: Select a classic optimization algorithm (like Gradient Descent or Newton’s Method) designed to work directly on functions.
  3. Discretize via the Neural Network: Project that ideal function-space update onto the "tangent space" of the neural network's parameters.

This "Function-Space Inspired Optimization" framework replaces standard parameter-space updates with updates that account for the Gramian matrix—a matrix representing the inner products of the network's derivatives. This effectively transforms standard gradient descent into a form of Natural Gradient Descent, where the "naturalness" is defined by the physical function space (e.g., $L^2$ or $H^1$ norms) rather than just the network weights.

Key Insights

  • The "Aha" Moment: Many state-of-the-art SciML tricks are actually just discretized versions of classic function-space algorithms. For instance, Competitive PINNs (CPINNs) are essentially a discretized Lagrange-Newton method.
  • Geometry Matters: Standard optimizers treat all parameters equally. Function-space optimizers recognize that a small change in one weight might drastically alter the function's shape, while a large change in another might have minimal impact. The Gramian matrix corrects for this discrepancy.
  • Unified Framework: The paper provides a translation table mapping function-space algorithms to their parameter-space counterparts, offering a roadmap for designing new optimizers.

Empirical Results

While the paper focuses on theoretical frameworks, it utilizes classic PDE benchmarks to demonstrate the effectiveness of this viewpoint.

Precision Gains

In a 2D Poisson problem, standard first-order optimizers (Adam and Gradient Descent) plateaued at an error of roughly $10^{-3}$ to $10^{-4}$. In contrast, the function-space inspired optimizer, Energy Natural Gradient Descent (E-NGD), reached an accuracy of $10^{-9}$—an improvement of five orders of magnitude.

Convergence comparison showing E-NGD and Newton methods achieving significantly lower L2 error than Adam and Gradient Descent.

Error Compensation

Qualitative heat maps demonstrate that function-space updates are vastly superior at "filling in" the errors of the current solution. Compared to standard gradient descent, which produces noisy and inefficient updates, methods like E-NGD and Newton directly target the residual error.

Heat maps comparing the true error with the update directions of E-NGD, Newton, and standard GD.

Limitations and Future Directions

Despite their power, these second-order methods face challenges:

  • Computational Cost: The primary drawback is the "curse of dimensionality." Solving the large systems of linear equations required for the Gramian matrix is computationally expensive for very large networks.
  • Scalability: To make these methods viable for industrial-scale problems, future work must focus on "matrix-free" implementations (using iterative solvers like CG or GMRES) or approximations like K-FAC (Kronecker-Factorized Approximate Curvature).
  • Software Integration: There is a pressing need for better, faster implementations of these function-space geometries within standard SciML libraries to facilitate broader adoption.

Summary updated

BibTeX
@inproceedings{muller2024position,
  author = {Johannes Müller and Marius Zeinhofer},
  title = {{Position: Optimization in SciML Should Employ the Function Space Geometry}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=MOrvoYrlOg},
}
Figure