Faster Algorithms for Structured Matrix Multiplication via Flip Graph Search

Kirill Khoruzhii, Patrick Gelß, Sebastian PokuttaarXiv 2025 · DOI

Abstract

Matrix multiplication is a cornerstone of modern computational science, yet finding optimal algorithms for structured matrices remains a significant challenge. This paper introduces a systematic framework for discovering faster recursive algorithms by treating the problem as a geometric search over tensor decompositions. By navigating a "flip graph" of valid algorithms and lifting solutions from finite fields to rational numbers, we improve the efficiency constants for 13 out of 15 common matrix structures. Our results demonstrate that structured search can outperform reinforcement learning approaches like AlphaTensor, providing new state-of-the-art ranks for several core BLAS primitives.

Introduction

While general-purpose matrix multiplication has been extensively studied since Strassen's 1969 breakthrough, many real-world applications involve matrices with specific properties, such as symmetry or triangularity. Standard libraries like BLAS provide specialized routines for these cases, but the discovery of optimal recursive algorithms—those that minimize the number of multiplications (rank)—is an NP-hard tensor decomposition problem. This work addresses the lack of a comprehensive framework for identifying these specialized algorithms, focusing on reducing the multiplicative constants that dominate performance in practice.

Methodology

The core of our approach is the conceptualization of matrix multiplication as a tensor decomposition problem. We represent the multiplication of two matrices as a 3D tensor $T_{ijk}$, where the goal is to find a decomposition with the minimum number of terms.

We define a "flip graph" where each vertex represents a valid matrix multiplication algorithm. Transitions between these algorithms are performed using "flips"—local transformations that preserve correctness while altering the algorithm's structure. To avoid local minima, we employ "plus-transitions," which allow for larger jumps in the search space.

The flip graph search space where nodes represent algorithms and edges represent transformations like flips and plus-transitions.

Finite Field Search and Hensel Lifting

To expand the search space beyond binary coefficients, we perform searches over the finite field $\mathbb{F}_3$. This allows us to discover algorithms that utilize rational coefficients (like $1/2$), which are invisible in $\mathbb{F}_2$. Once a low-rank algorithm is found in a finite field, we apply Hensel lifting to promote the solution to the field of rational numbers $\mathbb{Q}$, making it compatible with standard floating-point hardware.

Key Insights: Exploiting Structure

A critical contribution of this work is the systematic classification of recursive calls. When multiplying structured matrices, the resulting sub-problems often retain some structure or transform into other known structured formats.

Decomposition of a structured matrix product into general products and recursive calls, represented as a sum of tensors.

By correctly accounting for these recursive relationships, we can more accurately calculate the total complexity of the algorithm. This "recursive classification" allows us to optimize the multiplicative constant even when the asymptotic exponent $\omega$ remains unchanged.

Results

Our search successfully identified improved asymptotic constants for 13 of the 15 structured matrix formats studied. Key highlights include:

  • Beating AlphaTensor: For $3 \times 3$ skew-symmetric-general multiplication, we found a rank-14 scheme, improving upon the rank-15 result found by AlphaTensor.
  • BLAS Improvements: We achieved significant gains for core Level 3 BLAS primitives. For instance, the constant for symmetric rank-k updates (SYRK) and triangular matrix multiplication (TRMM) was reduced from 0.615 to 0.595.
  • Rational Schemes: We discovered a $2 \times 2$ symmetric-symmetric multiplication algorithm using only 5 multiplications, a new state-of-the-art for this configuration.

Conclusion

This research demonstrates that a systematic, mathematically-guided search over the space of tensor decompositions is a powerful tool for algorithmic discovery. By leveraging the geometric properties of the flip graph and the flexibility of rational coefficients, we have established new benchmarks for structured matrix multiplication. Future work will focus on the numerical stability of these recursive schemes and scaling the search to larger matrix dimensions using guided search techniques.

Summary updated

BibTeX
@misc{khoruzhii2025faster,
  author = {Kirill Khoruzhii and Patrick Gelß and Sebastian Pokutta},
  title = {{Faster Algorithms for Structured Matrix Multiplication via Flip Graph Search}},
  year = {2025},
  eprint = {2511.10786},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.10786},
}
Figure