Paper 2026/1688

Hell’s Bells: A Neural Network Pipeline for Ternary Fast Matrix Multiplication Algorithms

Erik Mårtensson, Linköping University, Lund University
Paul Stankovski Wagner, Lund University
Joshua Stapleton, Imperial College London
Abstract

We present a neural network-based pipeline for efficiently generating fast matrix multiplication (FMM) algorithms of small but arbitrary dimensions $(n,m,k)$. Our neural network is general and tunable to output FMM schemes with specific properties, and in this paper we specifically target aspects that are useful and important in practical implementation, such as ternarity (coefficients in $\{-1, 0, 1\}$), sparseness and a low number of additions after optimization (addition reduction carried out separately). We generate and optimize thousands of FMM algorithms and show that our generation method is beneficial in terms of performance across the entire FMM pipeline (both the FMM generation itself and optimization of additions). We discuss performance metrics and utilize heatmaps to visualize and understand this performance. We achieve record-low arithmetic (additive) complexity for various combinations of dimensions. For $(n,m,k) = (2,2,k)$, our method performs particularly well. Our improvement compared to previous results increases with $k$. We show that the (addition) optimization process can behave very differently depending on the dimensions considered, indicating how further improvements (beyond our results) can be targeted. In particular, in the $(n,m,k) = (2,2,k)$ setting, we show evidence of structural FMM properties coming into play, concretely showing that FMM generation with a minimal number of additions is sometimes suboptimal with respect to the entire FMM pipeline. Finally, we make our neural network implementation, our generated FMM schemes, heatmap utilities and datasets publicly available.

Metadata
Available format(s)
PDF
Category
Foundations
Publication info
Preprint.
Keywords
Strassen's algorithmFast matrix multiplicationCryptanalysis
Contact author(s)
erik martensson @ liu se
paul stankovski_wagner @ eit lth se
joshua stapleton ai @ gmail com
History
2026-08-15: approved
2026-08-14: received
See all versions
Short URL
https://ia.cr/2026/1688
License
Creative Commons Attribution
CC BY

BibTeX

@misc{cryptoeprint:2026/1688,
      author = {Erik Mårtensson and Paul Stankovski Wagner and Joshua Stapleton},
      title = {Hell’s Bells: A Neural Network Pipeline for Ternary Fast Matrix Multiplication Algorithms},
      howpublished = {Cryptology {ePrint} Archive, Paper 2026/1688},
      year = {2026},
      url = {https://eprint.iacr.org/2026/1688}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.