SymMaP: Improving Computational Efficiency in Linear Solvers through Symbolic Preconditioning

Hong Wang, Jie Wang, Minghao Ma, Haoran Shao, Haoyang Liu

At the heart of almost every scientific simulation—from weather forecasting to engine design—lies the computationally heavy task of solving massive linear systems ($Ax = b$). To solve these equations efficiently, engineers rely on preconditioners, which are mathematical "shortcuts" that transform the system into an easier-to-solve form.

However, preconditioners come with a "Goldilocks" problem: their performance heavily depends on specific continuous parameters (like the relaxation factor $\omega$ in the Successive Over-Relaxation method) that must be tuned perfectly. Traditional methods rely on fixed constants derived from domain expertise, which are rarely optimal for every specific problem instance. While Machine Learning (ML) methods can predict better parameters, they are often too slow to run efficiently on CPUs and act as "black boxes" that lack interpretability.

To bridge this gap, researchers have introduced SymMaP (Symbolic Matrix Preconditioning), a novel framework that uses deep reinforcement learning to discover concise, interpretable mathematical formulas for tuning linear solvers.

The SymMaP Framework

SymMaP replaces heavy, black-box neural networks with lightweight symbolic expressions. The framework operates through a four-step pipeline:

  1. Training Data Generation: The system uses an adaptive grid search to find the "perfect" optimal parameters for thousands of different linear system instances.
  2. Symbolic Discovery: Instead of training a standard neural network to output a single numerical value, SymMaP uses a Recurrent Neural Network (RNN) to generate mathematical formulas (e.g., $1.0 + 1.0 / (x_2 + 1.2)$).
  3. Risk-Seeking Policy: A specialized reinforcement learning strategy is employed to focus on finding the single best-performing formula, rather than settling for an "average" good one.
  4. Deployment: Because the output is a simple mathematical formula, it can be compiled into a tiny C library and plugged directly into industry-standard solvers like PETSc with near-zero computational overhead.
The SymMaP framework pipeline, illustrating data generation, symbolic discovery via RNN, and deployment.

Key Insights: Why Formulas Beat Neural Nets

In the world of high-performance computing, every microsecond counts. A symbolic formula is essentially "free" to evaluate on a CPU. By contrast, a neural network inference is a heavy computational burden that can easily negate the speedup gained from better parameter tuning. In fact, the inference time for a SymMaP formula is only 20% of the time required by a standard Multi-Layer Perceptron (MLP), making it ideal for real-time deployment.

Furthermore, the discovered formulas offer a significant "Aha!" moment in interpretability. They aren't just random noise; they frequently mirror established mathematical theory. For example, in SOR preconditioning, SymMaP discovered that the relaxation factor should decrease as the "coupling coefficient" of the PDE increases—a finding that aligns perfectly with empirical observations in numerical analysis. Because these expressions are mathematically grounded, they also generalize to different matrix sizes and grid geometries much better than rigid neural network architectures.

Performance and Results

The researchers evaluated SymMaP on linear systems derived from several high-stakes physics and engineering domains, including Darcy Flow (fluid through porous media), Elliptic PDEs (heat and diffusion), Biharmonic Equations (elasticity), and Poisson/Thermal Equations.

Comparison of computation time ratios across different tolerances, showing SymMaP's efficiency gains over default and fixed parameters.

Across these datasets, SymMaP demonstrated remarkable improvements:

  • Significant Speedups: SymMaP reduced computation times by up to 40% compared to the default settings in PETSc, and by 10% compared to the best possible fixed constants.
  • Better Stability: For Algebraic Multigrid (AMG) solvers, SymMaP lowered the "condition number" (a measure of how difficult a matrix is to solve) by up to 40%.
  • Multi-Parameter Mastery: The system successfully tuned multiple parameters simultaneously (e.g., tuning both the AMG threshold and the smoother relaxation factor), outperforming human-designed heuristics.

Limitations and Future Work

While SymMaP excels at optimizing continuous parameters, it currently does not handle discrete parameters, such as the "level of fill-in" in Incomplete LU (ILU) factorizations.

Future work will likely focus on optimizing for specific matrix structures (like symmetric or triangular matrices), deepening the theoretical analysis of why certain discovered formulas work using pseudospectral analysis, and expanding the framework's "Token Library" to include more complex operators while maintaining fast training speeds.

Summary updated

BibTeX
@inproceedings{wang2025symmap,
  author = {Hong Wang and Jie Wang and Minghao Ma and Haoran Shao and Haoyang Liu},
  title = {{SymMaP: Improving Computational Efficiency in Linear Solvers through Symbolic Preconditioning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=Oupeovfx0L},
}
Figure