Neural Krylov Iteration for Accelerating Linear System Solving

Jian Luo, Jie Wang, Hong Wang, huanshuo dong, Zijie Geng, Hanzhu Chen, Yufei KuangNeurIPS 2024

Numerical linear algebra is the silent engine of modern science. Whether you are simulating airflow over a wing, modeling heat dissipation in a chip, or predicting the weather, you are likely solving a massive system of linear equations ($Ax = b$). While we have powerful tools like Krylov subspace methods (e.g., GMRES) to handle these, they often start "blind," leading to thousands of iterations and significant computational costs.

A new paper from researchers at the University of Science and Technology of China introduces NeurKItt (Neural Krylov Iteration), a hybrid approach that uses deep learning to give these classical solvers a massive head start.

TL;DR

NeurKItt uses a Fourier Neural Operator (FNO) to predict the "invariant subspace" of a linear system—essentially the mathematical "shape" of the problem—before the solver even begins. By using this predicted subspace to guide the iteration process, NeurKItt achieves up to a 5.5× speedup in computation time and a 16.1× reduction in the number of iterations compared to standard methods.

What Problem Does This Paper Address?

Traditional numerical solvers for large-scale sparse linear systems rely on Krylov subspace iteration. These algorithms start with a random initial vector and progressively build a subspace to approximate the solution.

The bottleneck is efficiency: if the matrix $A$ is poorly conditioned or the problem is high-dimensional, the solver takes a long time to "find" the right direction. While "recycling" methods exist—where information from a previous, similar problem is used to speed up the current one—they fail in scientific computing where grids, discretization, and parameters change constantly. There is no "previous" information to recycle. NeurKItt fills this gap by using a neural network to generate that prior knowledge on the fly.

Methods: Predicting the Subspace

NeurKItt Architecture

NeurKItt consists of two primary modules that work together to bypass the slow initial search phase of traditional solvers:

  1. Subspace Prediction Module: Instead of trying to predict the solution vector $x$ directly (which is often too sensitive to noise), the authors use a Fourier Neural Operator (FNO) to predict the invariant subspace associated with the smallest eigenvalues of the matrix.
  2. Novel Projection Loss: To train the network, they developed a loss function that measures the distance between the predicted subspace and the true invariant subspace.
  3. Thin QR Decomposition: The network's output is passed through a QR decomposition to ensure the predicted basis vectors are orthogonal and stable.
  4. Acceleration Module: This module takes the predicted subspace and uses it as a "deflation space." In simple terms, it tells the Krylov solver: "Don't bother looking in these directions; I've already mapped them out." This allows the solver to focus its energy on the remaining parts of the problem, converging much faster.

Datasets

The authors evaluated NeurKItt on three classic partial differential equation (PDE) problems that generate large, non-symmetric linear systems:

  • Helmholtz Equation: Used in wave propagation (acoustics/electromagnetics).
  • Darcy Flow: Modeling fluid flow through porous media.
  • Non-uniform Heat Conduction: Simulating heat distribution in complex materials.

The matrices involved ranged in size from roughly 32,000 to 160,000 rows/columns.

Key Insights and Ideas

  • Subspaces over Solutions: A key "aha" moment is the realization that predicting a subspace is more robust than predicting a solution vector. Direct solution predictions by neural networks often have high relative residuals when plugged back into $Ax=b$. However, even a "low-precision" subspace prediction can significantly stabilize and accelerate a classical solver.
  • The Power of Small Eigenvalues: The convergence of Krylov methods is often hindered by the smallest eigenvalues. By specifically targeting the subspace associated with these eigenvalues, NeurKItt removes the primary "drag" on the solver's speed.
  • Zero-Shot Generalization: Remarkably, a model trained on smaller matrices (e.g., 9,604 dimensions) can successfully accelerate much larger systems (e.g., 158,404 dimensions) for the same PDE type. This suggests the network learns the underlying physics, not just a matrix-to-matrix mapping.

Key Results

Performance Comparison
  • Speedup: Across various settings, NeurKItt achieved a computation time speedup of up to 5.5×.
  • Iteration Reduction: The number of iterations required to reach a specific tolerance (e.g., $10^{-12}$) dropped by as much as 16.1×.
  • Compatibility: NeurKItt isn't a replacement for existing techniques; it works alongside standard preconditioners like Jacobi, SOR, and Additive Schwarz Method (ASM), consistently improving their performance.
  • Inference Overhead: The time the neural network takes to make a prediction (inference) is in the millisecond range—negligible compared to the seconds or minutes saved during the solving process.

Limitations and Future Work

  • Matrix Specificity: Currently, the method is tailored to non-symmetric matrices derived from specific PDE structures. The authors note that for matrices with very different structures, the model might need further tailoring.
  • Preconditioning Interaction: While NeurKItt works with various preconditioners, the authors haven't yet optimized the subspace prediction specifically to account for the impact of different preconditioning techniques.
  • Training Cost: While inference is fast, training the FNO requires a dataset of solved systems. The authors argue this is a "pay once, use millions of times" scenario, but it remains a hurdle for one-off problems.

Summary updated

BibTeX
@inproceedings{luo2024neural,
  author = {Jian Luo and Jie Wang and Hong Wang and huanshuo dong and Zijie Geng and Hanzhu Chen and Yufei Kuang},
  title = {{Neural Krylov Iteration for Accelerating Linear System Solving}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=cqfE9eYMdP},
}
Figure