Abstract
Matrix multiplication (MM) is a fundamental operation in computational science. Finding algorithms that minimize the number of required multiplications is an NP-complete problem. This paper explores a novel approach by reframing the search for these algorithms as a classical planning problem. By modeling tensor decomposition as a state-space search, researchers utilized off-the-shelf AI planners to discover optimal algorithms and establish mathematical lower bounds.
Introduction
Matrix multiplication is the engine behind modern AI, weather simulations, and physics. Even a marginal improvement in efficiency—reducing the number of multiplications required—can save significant compute time and energy globally. While DeepMind’s AlphaTensor recently used Reinforcement Learning (RL) to find new algorithms, RL often lacks the ability to provide formal proofs of optimality. This research investigates whether symbolic AI, specifically classical planning, can both discover these algorithms and prove that no faster versions exist.
Methodology
The researchers translated the mathematical problem of tensor decomposition into the language of classical planning. The task is modeled as follows:
- The State: A 3D tensor representing the matrix multiplication task. The initial state contains the "instructions" for standard multiplication, while the goal state is a "zero tensor" where all entries are cleared.
- The Actions: Choosing three vectors ($u, v, w$) that form a "rank-1 tensor." Applying an action involves an XOR operation between this rank-1 tensor and the current state.
- The Goal: Reach the zero tensor in the fewest steps possible, where each step represents one multiplication in the resulting algorithm.
- The Arithmetic: To manage the search space, the math is restricted to modular arithmetic ($\mathbb{Z}_2$), where addition and subtraction are equivalent to a logical XOR.
The study tested several planning strategies, including Heuristic Search (A*, LAMA), SAT-based planning (encoding the problem into Boolean logic), and Symbolic Search using Binary Decision Diagrams.
Key Results and Discovery
The planners successfully rediscovered Strassen’s famous algorithm for $2 \times 2$ matrices, which requires 7 multiplications instead of the standard 8, and formally proved its optimality. For larger instances, the planners established non-trivial lower bounds, narrowing the gap between theoretical minimums and known algorithms.
Key findings include:
- Optimal Planners as Proof Tools: Unlike RL agents, optimal planners like A* can prove lower bounds. For instance, they proved that multiplying two $2 \times 2$ matrices requires at least 7 multiplications in $\mathbb{Z}_2$.
- Hill Climbing Efficiency: A simple Hill Climbing search with a "goal count" heuristic was the only method capable of finding a concrete algorithm for the $3 \times 3$ case, primarily due to its memory efficiency.
- Memory Bottlenecks: The primary constraint for larger problems was RAM rather than time. The "grounding" process—translating high-level logic into a searchable graph—creates a combinatorial explosion that challenges current hardware.
Discussion and Limitations
While the approach proved successful for $2 \times 2$ and some $3 \times 3$ instances, scaling to $4 \times 4$ and beyond remains a challenge due to the astronomical number of possible actions. Furthermore, the current model is limited to $\mathbb{Z}_2$ arithmetic. While many algorithms found here generalize to real numbers, some faster algorithms may only exist in other number systems like $\mathbb{Z}_3$ or $\mathbb{R}$.
Future work will focus on implementing symmetry-breaking techniques, such as partial order reduction, to prevent planners from exploring redundant permutations of the same algorithm. Additionally, "lifted" planners, which avoid pre-calculating all possible actions, represent a promising path toward overcoming current memory limitations.
Summary updated