WorksComputer Science
So Many Ways to Multiply Matrices: A Large Dataset of Rank-23 Schemes
Abstract
A publicly available dataset of 62029 rank-23 schemes for matrix multiplication is presented. Every scheme in it has its own rank pattern, an invariant formed by the ranks of the factor matrices of a scheme, so all schemes are pairwise inequivalent. The schemes were obtained by a numerical method combining gradient descent with alternating least squares and by flip graph search, and have ternary, integer or rational coefficients. Rank 23 is the best known for this format and is optimal for schemes with integer coefficients, but the number of essentially different schemes of this rank was poorly understood: the existing collections of Heule et al. and Mårtensson et al. contain many schemes that share only a small number of rank patterns (17376 schemes with 387 patterns and 15316 schemes with 568 patterns respectively). The dataset shows that the number of different rank patterns is much larger than previously known.
Introduction
Strassen’s algorithm [1] multiplies two matrices using seven multiplications instead of eight, and applied recursively it yields the exponent . Seven multiplications are optimal for this format [2, 3]. The next square format, , is already considerably harder. Laderman’s scheme [4] uses 23 multiplications, which corresponds to the exponent and therefore does not beat Strassen’s. Nevertheless, remains the smallest square format for which the rank over fields of characteristic zero is unknown: it is only known to lie between 21 [5] and 23. The rank over was recently shown to be exactly 23 [6], which, by reduction modulo two, implies that 23 is also optimal for schemes with integer coefficients.
Laderman’s scheme is far from unique. Johnson and McLoughlin described parametrized families of rank-23 schemes [7], and Heule et al. [8] used SAT-based local search to obtain 17 376 pairwise inequivalent schemes with ternary coefficients. Mårtensson et al. [9, 10] later published a collection of 15 316 ternary schemes obtained with a neural network pipeline. In recent years, computer search has become a standard tool for small formats, based on reinforcement learning [11], constraint programming [12], flip graphs [13, 14, 15, 16, 17, 18, 19] and LLM-driven evolutionary search [20]. Catalogs of the best known schemes are maintained, for example, by Sedoglavic [21], Perminov [22] and Lacelle [23].
A large pool of rank-23 schemes is valuable because schemes of the same rank differ in properties that matter in practice and are not determined by the rank. The most prominent one is the number of additions required to evaluate a scheme. Laderman’s original construction uses 98 additions, and it can be reduced to 62 [24]. Further improvements, to 60, 59, 58, 56 and 55 additions, as well as to 52 and 51 additions in an alternative basis, were obtained not for Laderman’s scheme but for other rank-23 schemes [25, 26, 27, 28, 29, 30, 31, 32]. The choice of the underlying scheme therefore matters, and a more diverse collection of schemes leaves more room for further improvements. Moreover, a diverse collection of decompositions provides opportunities for a more detailed investigation of the structure and properties of the matrix multiplication tensor.
This raises a natural question: how many essentially different rank-23 schemes exist? Two schemes are considered equivalent if one can be transformed into the other by the symmetries of the matrix multiplication tensor (§ 3). Heule et al. introduced invariants of this equivalence, the most basic of which is the rank pattern: schemes with different rank patterns are necessarily inequivalent. Applied to the collection of [8, 33], these invariants reveal an interesting picture: its 17 376 pairwise inequivalent schemes realize only 387 distinct rank patterns. The 15 316 schemes of [9] realize only 568 patterns. In other words, in both collections many schemes share a rank pattern. This paper explores the opposite direction and shows that the number of different rank patterns is very large as well.
Contributions.
A dataset of 62 029 rank-23 schemes for matrix multiplication is presented. The schemes were found by gradient descent with alternating least squares (GradALS), which produced more than half of them, and by flip graph search (over ternary coefficients and over and with Hensel lifting). Each scheme has its own rank pattern, hence all schemes are pairwise inequivalent. The coefficients are ternary for 21 585 schemes (34.80%), integer for 22 130 (35.68%) and rational for 18 314 (29.52%).
The schemes of Heule et al. and Mårtensson et al. were not used as input to the search, yet all 771 rank patterns of these two collections are present in the dataset. All other schemes of the dataset are inequivalent to every scheme of both collections. Together with the pairwise inequivalent schemes of Heule et al., the dataset gives at least 78 634 pairwise inequivalent rank-23 schemes (§ 5.5).
The distribution of the number of nonzero coefficients across the dataset is analyzed. A scheme with 138 nonzero coefficients was found by GradALS method, whereas none of the previously known schemes from the publicly available collections had fewer than 139. It uses the coefficients . A scheme with the same number of nonzero coefficients and the same rank pattern was later published in a blog post [34]. Since a ternary scheme with this rank pattern takes its place in the dataset, the scheme is given separately in Appendix A.
All schemes are available in JSON, plain text (.txt) and Maple (.m) formats together with a script that verifies their correctness. The repositories with the dataset and the tools are described in § 8.
The paper is organized as follows. Section 2 fixes the notation, and Section 3 describes the symmetries and invariants used to distinguish schemes. Section 4 explains how the schemes were found, Section 5 describes the dataset, and Section 6 discusses the results and limitations. Sections 7 and 8 contain the conclusion and the description of the available data and code, and Appendix A contains the sparsest scheme.
Preliminaries
Matrix multiplication schemes
Let be a field and let be two matrices with entries and . A scheme of rank for the multiplication of matrices, denoted , is a way to compute the entries of using multiplications of linear forms:
where .
Notation 2.1. The coefficients are collected in three matrices , whose entries are indexed in the row-major order of the pairs :
The symbols , and without subscripts denote the -th rows of , and , which are also regarded as matrices with entries , and . The rank of such a matrix is denoted by to distinguish it from the rank of the scheme.
Let denote the vectorization of a matrix in the row-major order. Then the scheme computes
where is the elementwise (Hadamard) product. In other words, the scheme is fully described by the triple .
Remark 2.1. The matrix is stored in the transposed form: is the coefficient with which enters the entry of the product rather than . This corresponds to the representation of matrix multiplication via the trace form , and it is the encoding used by most catalogs of schemes as well as by the files of the dataset described in § 5. As shown below, it also makes all three matrices play symmetric roles.
Example 2.1. Strassen’s original scheme [1] is a scheme over :
Brent equations
A triple defines a scheme if and only if its coefficients satisfy the Brent equations [35]:
for all indices , where is the Kronecker delta, equal to 1 if and to 0 otherwise.
Tensor representation
Definition 2.1 (Matrix multiplication tensor). The matrix multiplication tensor is the three-dimensional tensor with entries
Definition 2.2 (CP decomposition). A decomposition of a tensor into a sum of rank-one tensors is an expression
where denotes the outer product. The smallest for which such a decomposition exists is the tensor rank of .
Comparing the right-hand side of (2) with the definition of shows that schemes of rank for matrices are exactly the decompositions of into rank-one tensors, and that the rank of the scheme is the length of the decomposition.
Example 2.2. Strassen’s scheme from the previous example corresponds to the decomposition
Because of the transposed encoding of , the third factor of each term is written in the basis : for instance, in Strassen’s scheme enters and , and the third factor of the second term is .
Coefficient classes and sparsity
The coefficients of the schemes considered in this paper are rational numbers. Depending on the set of values they take, the schemes are divided into three classes: ternary schemes with coefficients in , integer schemes with coefficients in , and rational schemes with coefficients in . The class of a scheme is the smallest one that contains all its coefficients, so the classes are ordered as . Ternary schemes are the most convenient: they work over any field and require no multiplications by constants.
The sparsity of a scheme is measured by the total number of its nonzero coefficients . The fewer nonzero coefficients a scheme has, the simpler are the linear forms it computes, and the fewer (naive) additions are needed to evaluate it directly.
Symmetries and invariants
Matrix multiplication has a number of symmetries, which allow one to obtain new schemes from a known one. Each of the following transformations maps a scheme of rank to a scheme of the same rank:
(a) Reordering of terms: the triples are permuted arbitrarily.
(b) Rescaling: for nonzero with . The constants may be chosen separately for every term, since the product of the three factors does not change.
(c) Sandwiching: for all , where are invertible matrices. It is based on the identity : a scheme can be applied to the transformed matrices, and the result can then be transformed back.
(d) Cyclic shift: .
(e) Transposition: for all . It reflects the identity .
Transformations (d) and (e) are a consequence of the transposed encoding of , which makes the three matrices , and play symmetric roles: the matrix multiplication tensor corresponds to the trilinear form , which does not change under the cyclic shift, , and under the transposition, .
Transformations (c)–(e) are symmetries of the tensor itself: sandwiching is the action of the group studied by de Groote [36], while (d) and (e) permute the three tensor factors (in the case of (e), together with transposing the matrices , and ) and generate a group isomorphic to the symmetric group [37]. Together they generate the full symmetry group of [36, 38]. Transformations (a) and (b), in contrast, are trivial symmetries of the representation of a tensor as a sum of rank-one terms.
Definition 3.1 (Equivalence of schemes). Two schemes are equivalent if one can be obtained from the other by a finite sequence of transformations (a)–(e). The set of schemes equivalent to a given one is called its orbit.
Neither the coefficient class nor the number of nonzero coefficients is preserved by these transformations: sandwiching with a suitable matrix can turn a ternary scheme into an integer or rational one, and vice versa. Sandwiching is therefore a way to explore the orbit of a scheme and to look for sparser or “nicer” representatives in it, which is how it is used in the search described in § 4.
For , all schemes of rank form a single orbit, which is the orbit of Strassen’s scheme [36]. For , the situation is completely different: there is a great number of orbits of rank- schemes, and telling them apart is the topic of the rest of this section.
Rank pattern
A convenient way to distinguish orbits is to look at the ranks of the matrices , and , as proposed by Heule et al. [8]. For a scheme with the terms , consider the triples
and apply the same permutation of coordinates to all of them. There are six such permutations (including the identity), and each of them gives a list of triples, which is then sorted in the lexicographic order.
Definition 3.2 (Rank pattern). The rank pattern of a scheme is the lexicographically smallest of the six sorted lists described above.
Example 3.1. Laderman’s scheme has the following sequence of ranks :
After sorting in lexicographic order and choosing the smallest of the six permutations, this gives the rank pattern
Equivalent schemes have the same rank pattern. Indeed, matrix rank does not change under reordering of terms, rescaling and sandwiching, so these transformations preserve the multiset of triples . The cyclic shift and the transposition permute the coordinates of every triple in the same way (a matrix and its transpose have equal ranks), and the two of them generate all six permutations, which are taken into account by the choice of the smallest list. Consequently, schemes with different rank patterns are necessarily inequivalent.
The converse is not true: inequivalent schemes may share a rank pattern. In particular, the 17 376 pairwise inequivalent schemes of [8] realize only 387 different rank patterns. Equality of rank patterns is thus a necessary condition for equivalence, but not a sufficient one. An algorithm that decides whether two schemes are equivalent was proposed in [39], but it is not used in this work: the statement about different rank patterns is the only tool used here to claim that two schemes are inequivalent. The dataset described in § 5 contains exactly one scheme for every rank pattern, which makes all its schemes pairwise inequivalent. In other words, the dataset contains one representative per rank pattern, and not one representative per orbit.
Polynomial invariants and the type of a scheme
The rank pattern can be conveniently encoded by a polynomial. For a scheme with the triples defined above, let
which is the invariant used in Sedoglavic’s catalog [21]. Reordering, rescaling and sandwiching do not change it, while the cyclic shift and the transposition permute the variables .
Heule et al. [8] additionally introduced two polynomial invariants, which carry less information than the rank pattern but are much easier to tabulate and compare:
where the permutations are meant to permute the variables and . Both polynomials do not change under any of the transformations (a)–(e).
Example 3.2. For Laderman’s scheme, the type, the polynomials and take the following forms:
and
The polynomial type itself depends on the order of the three factors, so every scheme is brought to a sorted form: the matrices , , are permuted by (d) and (e) so that the sorted list of triples is exactly the rank pattern, and the terms are sorted in the increasing lexicographic order of these triples. The order of terms with equal triples, and the choice among permutations giving the same list, is not fixed, so the sorted form is not unique. Unlike the normal form of [39], it does not single out a representative of an orbit and only makes the rank pattern readable directly from the files. All schemes of the dataset are stored in this form. The polynomial type of a scheme in sorted form encodes its rank pattern one-to-one, so the number of distinct types in the dataset equals the number of distinct rank patterns, while the numbers of distinct values of and are smaller, since these invariants are coarser. All three quantities are used in § 5 to compare the dataset with the collections of Heule et al. and Mårtensson et al.
Search method
The schemes of the dataset were obtained by two groups of methods: the numerical method GradALS (§ 4.4), which produced more than half of the dataset, including the vast majority of rational schemes, and the flip graph search, performed over ternary coefficients and over finite fields with Hensel lifting (§ 4.1–§ 4.3). The schemes found by either group are compared with the same pool of known schemes (§ 4.2).
Flip graphs
A part of the schemes was obtained with the flip graph approach [13]. In a flip graph, every vertex is a scheme (a decomposition of the tensor into rank-one terms), and edges correspond to transformations that preserve correctness. Since the graph is far too large to be explored exhaustively, it is searched by random walks. Three kinds of transformations are used, each of them being applied to a pair of terms and .
Definition 4.1 (Flip). If , then
The same transformation is defined for and for by permuting the roles of the three factors. A flip preserves both the correctness and the rank of a scheme.
Definition 4.2 (Reduction). If and , then
The same holds for equalities in any other pair of factors. A reduction decreases the rank by one. The rank also decreases when a flip produces a term with a zero factor, and such a term is simply removed.
Definition 4.3 (Plus). If , and , then
This transformation increases the rank by one and preserves correctness.
Flips alone never change the rank, and a scheme without equal factors in different terms has no flips available. The plus transformation [14] helps to leave such dead ends: it increases the rank by one and creates new coincidences between the factors, after which reductions can bring the rank back. Since flips and reductions both produce schemes that remain correct, every visited scheme of rank 23 is a valid scheme for matrices.
Search procedure
The pool of schemes coincides with the dataset: it stores exactly one scheme for every rank pattern found so far by any of the methods. The flip graph search is performed by a number of independent runners, each of which repeats the following steps (Algorithm 1) starting from the initial pool of rank-23 schemes obtained in earlier flip graph searches [18, 19]:
A scheme is chosen from the pool at random.
A random walk in the flip graph is started from it. Most of the steps are flips, and reductions are applied whenever they are available. From time to time, a plus transformation is applied with some probability, which allows the walk to leave the neighbourhood of the current scheme.
Periodically, a random sandwiching (§ 3) is applied to the current scheme. It does not change the rank pattern, but it changes the coefficients and often helps to obtain sparser schemes, that is, schemes with fewer nonzero coefficients.
Each visited scheme of rank 23 is compared with the pool as described below.
A scheme with a new rank pattern is added to the pool. If a scheme with an already known pattern is encountered, it replaces the stored one in either of two cases: its coefficients come from a better class, in the order (§ 2), or the class is the same and the scheme has fewer nonzero coefficients. The class takes priority over sparsity, so a ternary scheme always replaces an integer or rational one, even if the latter is sparser. As a result, the final
Algorithm 1: Flip graph search used to build the dataset
Input: pool of known rank-23 schemes, one per rank pattern
Output: updated pool
while the search is not stopped do random scheme from ; repeat apply a flip to , or a plus with a small probability; apply all available reductions to ; if the sandwiching step is due then apply a random sandwiching to ; if then rank pattern of ; if is not in then add to ; else if is better than the scheme with pattern in then replace that scheme by ; until walk length is reached;
dataset contains, for every rank pattern, the scheme with the best coefficient class and the smallest number of nonzero coefficients among those found during the search.
This rule has two consequences that should be kept in mind. First, the minimal possible number of nonzero coefficients was not the goal: the rule is used to avoid keeping the first scheme found for a pattern, which may be unnecessarily dense, but sparser schemes with the same rank pattern may well exist. Second, integer and rational schemes of the dataset are those for which no ternary scheme with the same pattern has been found yet, and such a scheme may still exist.
Coefficient sets: ternary search and Hensel lifting
The flip graph search was performed mainly in the ternary flip graph [18], in which all coefficients of the schemes belong to . Transformations producing coefficients outside this set are not performed, so every visited scheme is ternary.
In addition, the flip graph search was performed over the fields and . Over , all coefficients are 0 or 1 and signs disappear, whereas over the values 1 and remain distinct. A scheme found over , where , is lifted to characteristic zero by Hensel lifting: starting from a solution of the Brent equations modulo , the solution is refined step by step to a solution modulo a higher power of . At most three lifting steps are performed for and a single step for . After the last step, every coefficient is reconstructed from its residue as a rational number (rational reconstruction), and the resulting triple is accepted if it satisfies the Brent equations exactly. Schemes that do not admit such a reconstruction within the allowed number of steps are discarded, so only lifts with small numerators and denominators are kept.
The class of a lifted scheme depends on the reconstructed values. If all coefficients lie in , the scheme is ternary. If they are integers and some of them lie outside (for example, 2), the scheme is integer. Otherwise, the reconstruction produces fractions, whose denominators are not divisible by , and the scheme is rational.
Gradient descent with alternating least squares (GradALS)
More than half of the schemes of the dataset were obtained by a numerical method, referred to as GradALS, which combines gradient descent with alternating least squares (ALS). The method approximates the tensor by a sum of 23 rank-one terms. The approximation error is minimized by gradient descent, and ALS steps, which alternately solve linear least squares problems for the matrices , and while the other two are fixed, are used to speed up convergence. Several regularizers push the coefficients towards the set . The numerical solutions obtained are converted to exact schemes and verified. Any subset of this set of values may occur in a solution, so GradALS produces ternary schemes, integer schemes (with the coefficient ) and rational schemes with denominator 2, and the class of each scheme is determined by the values actually obtained. The vast majority of rational schemes of the dataset were obtained in this way, rather than by the flip graph search over with lifting. A detailed description of the method will be published separately, and its implementation is available in the repository described in § 8.
The dataset
Contents
The dataset consists of 62 029 schemes of rank 23 for the multiplication of matrices. Every scheme is given by the matrices , , in the encoding of § 2. All schemes are stored in the sorted form of § 3.2: the matrices are permuted to match the rank pattern, and their rows are sorted in the increasing lexicographic order of the triples of ranks.
For every rank pattern, the dataset contains exactly one scheme, which is selected by the rule of § 4.2: it has the best coefficient class and, within this class, the smallest number of nonzero coefficients among the schemes of this pattern found during the search. As a consequence, all schemes of the dataset are pairwise inequivalent. At the same time, the dataset is not complete: it neither contains all orbits of rank-23 schemes nor, in all likelihood, all possible rank patterns, and several inequivalent schemes may exist for each of its patterns.
By the coefficient classes of § 2, 21 585 schemes (34.80%) are ternary, 22 130 (35.68%) are integer, and 18 314 (29.52%) are rational. Integer and rational schemes are those for which no ternary scheme with the same rank pattern has been found.
Statistics of the invariants
Table 1 shows how many distinct values of the invariants of § 3 are realized by the schemes of the dataset. Since every scheme has its own rank pattern, the number of distinct types coincides with the number of schemes. The polynomials and are coarser invariants, so they take considerably fewer values. The numbers in the columns of individual classes are counted separately within each class, and they do not add up to the total except for the row of types, since the same value of or may occur in schemes of different classes.
| Invariant | All | Ternary | Integer | Rational |
| 62 029 | 21 585 | 22 130 | 18 314 | |
| 7 930 | 3 421 | 5 072 | 4 774 | |
| 530 | 339 | 441 | 466 |
Table 1. Number of distinct values of the invariants in the dataset, in total and separately for each coefficient class.
The coarse invariants show a different picture from the counts of schemes. The three coefficient classes are of comparable size (34.80%, 35.68% and 29.52% of the dataset), yet ternary schemes realize the fewest distinct values of and : 3 421 and 339, against 5 072 and 441 for integer schemes and 4 774 and 466 for rational schemes. This indicates that the non-ternary part of the dataset is not concentrated in a few rank patterns, but is spread over a wide range of them.
Sparsity
The sparsity of a scheme is measured by the total number of nonzero coefficients in , and . Figure 1 shows the distribution of this number over the dataset.
Figure 1. Distribution of the number of nonzero coefficients over all schemes of the dataset (top) and separately over the ternary (), integer () and rational () schemes (bottom). The ticks on the horizontal axes mark the minimum, the mode and the maximum of each distribution; the vertical scales of the panels differ.
The distribution is unimodal and right-skewed: most schemes lie in a narrow window around the peak, the sparse end, starting from 139, is thinly populated, and the dense side extends into a long tail up to 278. Schemes close to the minimum are therefore rare.
The coefficient classes differ mainly in spread rather than in location. The ternary schemes span the whole range, and they are the only ones in its sparsest part: every scheme with fewer than 149 nonzero coefficients is ternary. The integer and rational schemes are concentrated in narrower windows around nearly the same peak: the modes are 175, 174 and 178 for ternary, integer and rational schemes, respectively.
These distributions describe the dataset, and not all rank-23 schemes. By the selection rule of § 4.2, a scheme of a more general class is kept only for a rank pattern without a ternary scheme, and a ternary scheme is preferred regardless of the number of nonzero coefficients, so a sparser scheme with the same rank pattern may exist outside the dataset. The scheme with 138 nonzero coefficients described in § 5.6 is an example: it is rational, and the ternary scheme that represents its pattern in the dataset has more nonzero coefficients.
Rank triples
The rank pattern of a scheme is the multiset of the triples of its 23 terms, so a scheme can be seen as a way of distributing its terms among the 27 possible triples. Figure 2 shows how the schemes of the dataset do this: for every triple, it gives the distribution of the number of terms of that type.
Figure 2. Distribution of the number of terms with a given rank triple in a scheme, for each of the 27 triples. The horizontal axis shows the number of such terms in a scheme, and the vertical axis (logarithmic) shows the number of schemes of the dataset. The percentage in the title of a panel is the share of schemes that contain the triple at least once; schemes without it are not shown. The colors correspond to the rank of the first factor.
Several features of this picture explain why rank patterns are so numerous. Terms with factors of low rank dominate, and the triples (1, 1, 1), (1, 1, 2) and (2, 2, 2) are present in practically every scheme, so they form a common core of rank-23 schemes. The variety lies in how many terms of each type a scheme has: for (1, 1, 1) this number varies over a very wide range, and for most other frequent triples it takes several values. A rank pattern is thus a combination of several counts that vary almost independently, and this combinatorial freedom accounts for most of the patterns. At the other end, triples with at least two factors of rank 3 are exceptional: they occur in a small fraction of schemes, and at most twice in a scheme.
The panels are not symmetric with respect to permutations of a triple, for example (1, 1, 2) is far more common than (2, 1, 1). This is a consequence of the sorted form (§ 3.2): the order of the factors of every scheme is chosen so that its list of triples is lexicographically smallest, which favors triples with small leading entries. The figure therefore describes the rank patterns as they are defined, and not the ranks of individual factors.
Comparison with existing collections
Table 2 compares the dataset with two existing collections of rank-23 schemes: that of Heule et al. [8], which is the closest to it in nature, and that of Mårtensson et al. [9]. The first collection contains 17 376 pairwise inequivalent schemes with ternary coefficients, which realize only 387 distinct rank patterns and 303 distinct values of . The second one contains 15 316 schemes with ternary coefficients, which realize 568 rank patterns and 215 values of . Their pairwise inequivalence was not established. The two collections have 184 rank patterns in common. The dataset, in contrast, contains 62 029 schemes with pairwise distinct rank patterns and 7 930 distinct values of .
Table 2: Comparison with existing collections of rank-23 schemes. The last two columns show the ternary part of the dataset and the whole dataset.
| Heule et al. | Mårtensson et al. | This dataset (ternary) | This dataset (full) | |
| Schemes | 17 376 | 15 316 | 21 585 | 62 029 |
| Pairwise inequivalent | yes | unknown | yes | yes |
| Distinct rank patterns | 387 | 568 | 21 585 | 62 029 |
| Distinct values of | 303 | 215 | 3 421 | 7 930 |
| Distinct values of | 91 | 83 | 339 | 530 |
| Nonzero coefficients (range) | 139-186 | 139-200 | 139-278 | 139-278 |
Table 2. Comparison with existing collections of rank-23 schemes. The last two columns show the ternary part of the dataset and the whole dataset.
Since both collections consist of ternary schemes, the table also shows the ternary part of the dataset separately: it alone realizes 21 585 rank patterns, more than the number of schemes in either collection.
The schemes of both collections were not used during the search, but all 771 rank patterns of these collections are present in the dataset. The remaining schemes of the dataset are inequivalent to every scheme of [8, 9]. Together with the collection of Heule et al., whose schemes are pairwise inequivalent, they give at least 78 634 pairwise inequivalent rank-23 schemes. The schemes of [9] are not added to this bound, since their pairwise inequivalence was not established. For the 771 patterns shared with the collections, nothing is claimed: the scheme of the dataset may or may not be equivalent to a scheme of some collection with the same pattern, since equivalence was not tested directly.
The dataset and the existing collections are therefore complementary. The collection of Heule et al. demonstrates that a single rank pattern may contain many inequivalent schemes, whereas the dataset demonstrates that the number of different rank patterns is far greater than previously observed.
The sparsest scheme
The sparsest scheme found has 138 nonzero coefficients and was obtained in June 2026 by GradALS (§ 4.4). To the best of the author’s knowledge, no scheme with fewer than 139 nonzero coefficients was known before that date, neither in the collections of [8, 9] nor in the results of earlier searches by other authors. The scheme was not published as a separate work and was only sent by email to several researchers. In September 2026, a post on the KnotTheory.ai blog [34] described a scheme with 138 nonzero coefficients found by a support-capped local search over followed by a lift to the rationals. That scheme uses the wider set of coefficients and contains 30 non-integer coefficients, whereas the scheme described here contains only 12. The rank patterns of the two schemes coincide, but their exact equivalence was not verified.
The scheme described here uses the coefficients , so it belongs to the rational class. It is not part of the dataset: its rank pattern coincides with that of a ternary scheme with 146 nonzero coefficients, which by the selection rule of § 4.2 takes its place. The scheme is therefore given separately, in Appendix § 10.
Formats and verification
The schemes are provided in three formats: JSON, plain text (.txt) and Maple (.m). The files are named 3x3x3_m23_<hash>_<class>.<ext>, where <hash> is the hash of the scheme and <class> is the coefficient class: ZT (ternary), Z (integer) or Q (rational). The JSON file stores the dimension and the rank of the scheme (dimension, rank), the number of nonzero coefficients (nnz), the matrices , , as lists of rows (u, v, w), with rational coefficients written as strings ("-1/2"), and the invariants type, and . The text file contains the header line 3 3 3 23 followed by three lines with the flattened matrices , and . In the text files of rational schemes, every coefficient is written as a pair of numbers, the numerator and the denominator, so -1 2 stands for and 1 1 for 1. The Maple file stores the three matrices , , of every term as nested lists, with rational coefficients written as -1/2. In all formats, the coefficients of are stored in the transposed encoding of § 2.
The correctness of every scheme is checked by verifying the Brent equations (2) in exact arithmetic over integers and rationals. The verification script is included in the repository of the dataset. The same checks, the loading of schemes from all three formats, the computation of the invariants and other utilities are implemented by the Scheme class in the main research repository [22].
Discussion
Practical value of rank-23 schemes
Rank 23 is considerably larger than what would be needed to compete with Strassen’s algorithm. Applied recursively to blocks, a scheme of rank for matrices gives the exponent , which is smaller than Strassen’s only if , that is, for . Rank 23 gives , so none of the schemes of the dataset can improve on Strassen’s algorithm in a recursive setting, and in practice they are unlikely to replace it in applications where speed is crucial. The value of the dataset lies elsewhere: it shows how many structurally different schemes exist at the smallest known rank, and it provides a large and diverse starting pool for searches that optimize other properties of schemes.
The most important of these properties is the number of additions, whose record values are listed in the Introduction. The number of nonzero coefficients is only a rough proxy for it, since it ignores the reuse of intermediate sums across linear forms, but it is cheap to compute and serves as a natural first filter. Applying the optimization of additions to the whole dataset, rather than to a handful of schemes, is a natural direction for future work.
Lower bounds and the status of rank 23
Recent lower bounds change the status of rank 23. The rank of matrix multiplication over is exactly 23 [6], and by reduction modulo two this means that 23 is optimal for schemes with integer coefficients. The ternary and integer schemes of the dataset are therefore optimal in rank, and the dataset can be viewed as a collection of different optimal schemes. This does not apply to rational schemes with even denominators, such as those with denominator 2 in the dataset, which cannot be reduced modulo two. Over fields of characteristic zero, the rank is only known to lie between 21 [5] and 23, so a scheme of rank 22 or lower over or is not ruled out.
Limitations
The dataset has several limitations, which follow from how it was built and how its schemes are distinguished.
Completeness and equivalence. The dataset contains one scheme per rank pattern found by the search. It is neither a complete list of rank patterns nor of orbits. Inequivalence of its schemes is guaranteed by the rank patterns, but equivalence was not tested directly, for example with the algorithm of [39], so the dataset gives only a lower bound on the number of orbits and makes no claims about schemes of earlier collections that share a rank pattern with a scheme of the dataset.
Selection rule. The coefficient class takes priority over sparsity (§ 4.2). Hence ternary schemes may exist for patterns represented by integer or rational ones, and sparser schemes with the same pattern may exist; the scheme of § 5.6 is an example.
Future directions
Several natural continuations follow from the above. The dataset can be used as a source of schemes for optimizing additions, for studying the sparsity and structure of rank-23 schemes, and for other properties that depend on the scheme rather than on the rank, such as numerical stability. The same approach, finding schemes with pairwise distinct invariants, can be applied to other small formats. Finally, the search itself can be continued: the dataset keeps growing, and each new rank pattern extends the lower bound on the number of inequivalent schemes. A finer test of equivalence than the rank pattern, such as the algorithm of [39], applied to the schemes that share a rank pattern, would turn the lower bound on the number of orbits into a more precise count and would make it possible to compare the dataset with the existing collections scheme by scheme.
Conclusion
A dataset of 62 029 rank-23 schemes for the multiplication of matrices has been presented. Every scheme has its own rank pattern, so all schemes are pairwise inequivalent. All 771 rank patterns of the collections of Heule et al. [8] and Mårtensson et al. [9] are present in the dataset, and all other schemes are inequivalent to every scheme of these collections. Together with the collection of Heule et al., the dataset gives at least 78 634 pairwise inequivalent rank-23 schemes. A single rank pattern may thus contain many inequivalent schemes, and, as shown here, the number of different rank patterns is much greater than was previously known.
A scheme with 138 nonzero coefficients was also found, which is fewer than in any scheme of the publicly available collections known before June 2026. It is given in Appendix § 10. A scheme with the same rank pattern and number of nonzero coefficients was later published in a blog post [34].
Since rank 23 is optimal over and for schemes with integer coefficients, the dataset can be regarded as a large collection of different optimal schemes, which may serve as a starting pool for optimizing other properties, first of all the number of additions.
Availability
All data and code related to this work are publicly available in the following repositories.
Dataset:
https://github.com/dronperminov/rank23_3x3_dataset. The schemes are provided in JSON, plain text and Maple formats, together with a script that verifies the correctness of every scheme.
Main research repository on fast matrix multiplication schemes [22]:
https://github.com/dronperminov/FastMatrixMultiplication. It contains the Scheme class, which loads schemes from all the formats of the dataset, verifies the Brent equations in exact arithmetic and computes the invariants of § 3, as well as a catalog of schemes and other utilities.
Flip graph tool [18, 19]:
https://github.com/dronperminov/ternary_flip_graph. It implements the flip graph search of § 4, including the search over ternary coefficients and over finite fields with Hensel lifting.
GradALS method:
https://github.com/dronperminov/numerical-fast-matmul. It implements a numerical search that combines gradient descent with alternating least squares and uses several regularizers to obtain exact schemes with small coefficients (§ 4.4).
Acknowledgements
The author is grateful to Kirill Khoruzhii, Isaac Wood, Erik Mårtensson, Paul Stankovski Wagner, Joshua Stapleton and Alexandre Sedoglavic for useful conversations and discussions.
Rank-23 scheme with 138 nonzero coefficients
The scheme of § 5.6 is given below in the encoding of § 2. The matrix is printed transposed, as , so that its -th column is the vector . The terms are listed in the order produced by the search, not in the sorted form of § 3.2. It has , and . The Brent equations (2) were verified in exact rational arithmetic.
Invariants. The invariants of § 3 for this scheme are
;
;
.
In terms of the rank pattern of § 3.1, the scheme consists of 15 terms in which all three matrices , , have rank 1, four terms in which all three have rank 2, and four terms in which exactly one of the three matrices has rank 2.
References
- [1]Volker Strassen. Gaussian elimination is not optimal. Numerische mathematik, 13(4):354–356, 1969.DOI
- [2]Shmuel Winograd. On multiplication of 2 × 2 matrices. Linear Algebra and its Applications, 4:381–388, 1971. URL https://api.semanticscholar.org/CorpusID:123566199.DOI
- [3]John E Hopcroft and Leslie R Kerr. On minimizing the number of multiplications necessary for matrix multiplication. SIAM Journal on Applied Mathematics, 20(1):30–36, 1971.DOI
- [4]Julian D Laderman. A noncommutative algorithm for multiplying 3 × 3 matrices using 23 multiplications. Bulletin of the American Mathematical Society, 1976.DOI
- [5]Andrey Ivanov. A lower bound of 21 for 3 × 3 matrix multiplication over every field, October 2026. URL https://github.com/AIV5/mmrank21.DOI
- [6]Tejasvi Singh Tomar. The rank of 3 × 3 matrix multiplication over F₂ is 23. arXiv preprint arXiv:2610.11823, 2026.arxiv.org/abs/2610.11823
- [7]Rodney W Johnson and Aileen M McLoughlin. Noncommutative bilinear algorithms for 3×3 matrix multiplication. SIAM Journal on Computing, 15(2):595–603, 1986.DOI
- [8]Marijn JH Heule, Manuel Kauers, and Martina Seidl. New ways to multiply 3 × 3-matrices. Journal of Symbolic Computation, 104:899–916, 2021.DOI
- [9]Erik Mårtensson, Paul Stankovski Wagner, and Joshua Stapleton. Hell’s bells: A neural network pipeline for ternary fast matrix multiplication algorithms. Cryptology ePrint Archive, 2026. URL https://eprint.iacr.org/2026/1688.
- [10]Paul Stankovski Wagner. fmm_add_reduction, May 2025. URL https://github.com/werekorren/fmm_add_reduction.
- [11]Alhussein Fawzi, Matej Balog, Aja Huang, Thomas Hubert, Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Francisco J R. Ruiz, Julian Schrittwieser, Grzegorz Swirszcz, et al. Discovering faster matrix multiplication algorithms with reinforcement learning. Nature, 610(7930):47–53, 2022.DOI
- [12]Arnaud Deza, Chang Liu, Pashootan Vaezipour, and Elias B Khalil. Fast matrix multiplication without tears: A constraint programming approach. arXiv preprint arXiv:2306.01097, 2023.arxiv.org/abs/2306.01097
- [13]Manuel Kauers and Jakob Moosbauer. Flip graphs for matrix multiplication. In Proceedings of the 2023 International Symposium on Symbolic and Algebraic Computation, pages 381–388, 2023.arxiv.org/abs/2212.01175
- [14]Yamato Arai, Yuma Ichikawa, and Koji Fukushima. Adaptive flip graph algorithm for matrix multiplication. In Proceedings of the 2024 International Symposium on Symbolic and Algebraic Computation, pages 292–298, 2024.arxiv.org/abs/2312.16960
- [15]Jakob Moosbauer and Michael Poole. Flip graphs with symmetry and new matrix multiplication schemes. In Proceedings of the 2025 International Symposium on Symbolic and Algebraic Computation, pages 233–239, 2025.arxiv.org/abs/2502.04514
- [16]Manuel Kauers and Isaac Wood. Exploring the meta flip graph for matrix multiplication. arXiv preprint arXiv:2510.19787, 2025.arxiv.org/abs/2510.19787
- [17]Kirill Khoruzhii, Patrick Gelß, and Sebastian Pokutta. Faster algorithms for structured matrix multiplication via flip graph search. In Proceedings of the 2026 International Symposium on Symbolic and Algebraic Computation, pages 227–236, 2026.arxiv.org/abs/2511.10786
- [18]Andrew Perminov. Fast matrix multiplication via ternary meta flip graphs. arXiv preprint arXiv:2511.20317, 2025.arxiv.org/abs/2511.20317
- [19]Andrew Perminov. Fast matrix multiplication in small formats: Discovering new schemes with an open-source flip graph framework. arXiv preprint arXiv:2603.02398, 2026.arxiv.org/abs/2603.02398
- [20]Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wagner, Sergey Shirobokov, Borislav Kozlovskii, Francisco JR Ruiz, Abbas Mehrabian, et al. Alphaevolve: A coding agent for scientific and algorithmic discovery. arXiv preprint arXiv:2506.13131, 2025.arxiv.org/abs/2506.13131
- [21]Alexandre Sedoglavic. Yet another catalogue of fast matrix multiplication algorithms, 2019. URL: http://fmm.univ-lille.fr, accessed: november, 2026.
- [22]Perminov, Andrew. Fast matrix multiplication research repository. https://github.com/dronperminov/FastMatrixMultiplication, 2026. Accessed November 5, 2026.
- [23]Benoit Chatain Lacelle. A catalog of fast matrix multiplication algorithms with frontier-closure search. arXiv preprint arXiv:2606.13408, 2026.
- [24]Erik Mårtensson and Paul Stankovski Wagner. The number of the beast: Reducing additions in fast matrix multiplication algorithms for dimensions up to 666. In 2025 Proceedings of the Conference on Applied and Computational Discrete Algorithms (ACDA), pages 47–60. SIAM, 2025.DOI
- [25]Joshua Stapleton. A 60-addition, rank-23 scheme for exact 3 × 3 matrix multiplication. arXiv preprint arXiv:2508.03857, 2025.arxiv.org/abs/2508.03857
- [26]Erik Mårtensson, Paul Stankovski Wagner, and Joshua Stapleton. A rank 23 algorithm for multiplying 3 × 3 matrices with an arithmetic complexity of 59. arXiv preprint arXiv:2601.05272, 2025.
- [27]Andrew Perminov. A 58-addition, rank-23 scheme for general 3x3 matrix multiplication. arXiv preprint arXiv:2512.21980, 2025.arxiv.org/abs/2512.21980
- [28]Yinqi Sun. An exact 56-addition, rank-23 scheme for general 3 × 3 matrix multiplication. arXiv preprint arXiv:2604.27645, 2026.arxiv.org/abs/2604.27645
- [29]Samurdhi Karunaratne and Anushka Idamekorala. 55 additions suffice for 3 × 3 matrix multiplication at rank 23. arXiv preprint arXiv:2607.28676, 2026.arxiv.org/abs/2607.28676
- [30]Greg Sidebottom. A 55-addition rank-23 scheme for 3 × 3 matrix multiplication via exact two-sided minimization. arXiv preprint arXiv:2610.27451, 2026.arxiv.org/abs/2610.27451
- [31]Hugo Nielsen. A 52-addition, rank-23 scheme for exact 3 x 3 matrix multiplication. arXiv preprint arXiv:2609.06588, 2026.arxiv.org/abs/2609.06588
- [32]Joshua Stapleton and Andrew Perminov. A 51-addition alternative-basis kernel for rank-23 3 × 3 matrix multiplication. arXiv preprint arXiv:2609.32388, 2026.arxiv.org/abs/2609.32388
- [33]Marijn J. Heule, Manuel Kauers, and Martina Seidl. Matrix multiplication repository. http://www.algebra.uni-linz.ac.at/research/matrix-multiplication/, 2019.
- [34]Chandragupt Sharma. Chasing zeros: a rank-23 scheme for 3 × 3 matrix multiplication with support 138. KnotTheory.ai Research Notes (blog post), September 2026. URL https://knottheory.ai/blogs/matrix-multiplication-3x3-support-138. Published September 30, 2026. Accessed November 5, 2026.
- [35]Richard P Brent. Algorithms for matrix multiplication. Technical report, Stanford University, Stanford, CA, USA, 1970.DOI
- [36]HF de Groot. On varieties of optimal algorithms for the computation of bilinear mappings. Theoretical Computer Science, 7(2):127–148, 1978.
- [37]John Hopcroft and Jean Musinski. Duality applied to the complexity of matrix multiplications and other bilinear forms. In Proceedings of the fifth annual ACM symposium on Theory of computing, pages 73–87, 1973.DOI
- [38]Vladimir P Burichenko. On symmetries of the strassen algorithm. arXiv preprint arXiv:1408.6273, 2014.arxiv.org/abs/1408.6273
- [39]Manuel Kauers and Jakob Moosbauer. A normal form for matrix multiplication schemes. In International Conference on Algebraic Informatics, pages 149–160. Springer, 2022.arxiv.org/abs/2206.00550

