Papers
Topics
Authors
Recent
Search
2000 character limit reached

Pagh’s Compressed Matrix Multiplication

Updated 11 July 2026
  • The paper introduces a novel randomized algorithm that compresses the product of two matrices using hash-and-sign sketches combined with FFT-based polynomial multiplication.
  • It achieves unbiased entry estimations with variance bounded by the tail energy, ensuring robust recovery of significant entries in spiky outputs.
  • The approach supports exact sparse recovery in regimes with few nonzeros and has been extended via black-box reductions to modern robust sparse multiplication methods.

Searching arXiv for Pagh's compressed matrix multiplication and closely related follow-up work. Pagh’s compressed matrix multiplication is a randomized sketch-based method for representing the product ABAB of two real n×nn\times n matrices in compressed form, so that individual entries can be estimated, large entries can be recovered, and sparse outputs can in some regimes be obtained exactly without materializing the full dense product (Pagh, 2011). In later terminology, especially in the sparse-multiplication literature, this problem is identified with “robust sparse matrix multiplication,” because the target guarantee is not classical Frobenius- or spectral-norm approximation but an entrywise additive guarantee governed by the tail of the output after removing its kk largest entries (Bringmann et al., 1 Jul 2026). The line of work originates with Rasmus Pagh’s 2011 paper “Compressed Matrix Multiplication” (Pagh, 2011), which compresses the matrix product via hash-and-sign sketches and FFT-based polynomial multiplication, and it has subsequently been reinterpreted as a sparse-recovery problem, engineered with alternative transforms such as the Fast Walsh–Hadamard Transform, and generalized by black-box reductions from exact sparse matrix multiplication (Andersson et al., 14 Jan 2026).

1. Historical position and terminology

Pagh introduced compressed matrix multiplication as a method for approximating and querying matrix products when the output is sparse or compressible in Frobenius mass, with motivating applications including sample covariance matrices and basis transforms that induce sparsity (Pagh, 2011). The central objective is not generic acceleration of dense exact matrix multiplication, but output-sensitive recovery of significant entries, together with efficient sparse exact multiplication when the true product has few nonzeros (Pagh, 2011).

Subsequent literature has clarified that “compressed matrix multiplication” in Pagh’s sense is distinct from both classical approximate matrix multiplication and exact algebraic compression schemes. Bringmann, Fischer, and Nakos state that the study of the robust problem “was initiated in 2013 by Pagh,” and note that Pagh “referred to the problem as compressed matrix multiplication,” whereas they prefer the term “robust sparse matrix multiplication” to align with sparse-recovery terminology (Bringmann et al., 1 Jul 2026). This terminological shift matters because the relevant guarantee is the matrix analogue of the /2\ell_\infty/\ell_2 sparse-recovery guarantee, not the usual projection- or sampling-based approximation guarantee depending on ABF\|AB\|_F or AFBF\|A\|_F\|B\|_F (Bringmann et al., 1 Jul 2026).

A separate line, “Compressed Modular Matrix Multiplication,” uses deterministic QQ-adic packing of residues modulo a small prime into machine words and is exact rather than randomized (0803.1975). That work is algebraic digit packing, not Pagh-style sketching. This distinction is essential because both use the phrase “compressed matrix multiplication,” but the underlying models, guarantees, and arithmetic assumptions are entirely different (0803.1975).

2. Core sketching construction in Pagh’s algorithm

Pagh’s method starts from the outer-product decomposition

AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,

where aka_k is column kk of n×nn\times n0 and n×nn\times n1 is row n×nn\times n2 of n×nn\times n3 (Pagh, 2011). The product is compressed into a polynomial

n×nn\times n4

using random bucket hash functions n×nn\times n5 and random sign functions n×nn\times n6 (Pagh, 2011). Expanding the polynomial yields

n×nn\times n7

so the coefficients aggregate signed contributions of product entries that collide under the pair hash

n×nn\times n8

After reduction modulo n×nn\times n9, the bucket coefficients are

kk0

and the estimator for an entry is

kk1

This is a CountSketch-style estimator over index pairs kk2, with random signs canceling collision noise in expectation (Pagh, 2011).

The method is computationally viable because the sketch of each outer product is a convolution of two length-kk3 vectors, so FFT computes it in near-linear time. Pagh’s dense-case running time is kk4, and for sparse inputs with kk5 total nonzeros the bound is kk6 (Pagh, 2011). This suggests that the essential abstraction is not explicit formation of kk7, but direct computation of a compressed representation from the factors.

3. Statistical guarantees and sparse-output exactness

The basic estimator is unbiased: kk8 and has variance bounded by

kk9

These guarantees arise because the target contribution is always present with squared sign /2\ell_\infty/\ell_20, while off-target collisions have mean zero under the random signs and occur with probability about /2\ell_\infty/\ell_21 under the hash family (Pagh, 2011).

Pagh also gives a stronger skew-aware entrywise guarantee in terms of the tail energy after removing large entries. Using /2\ell_\infty/\ell_22 for the squared Frobenius norm after zeroing the /2\ell_\infty/\ell_23 largest-magnitude entries, the median estimator over /2\ell_\infty/\ell_24 repetitions satisfies

/2\ell_\infty/\ell_25

with probability /2\ell_\infty/\ell_26 (Pagh, 2011). This is the direct precursor of later robust sparse matrix multiplication guarantees phrased as /2\ell_\infty/\ell_27-type tail bounds.

The algorithm also admits exact recovery in sufficiently sparse regimes. If /2\ell_\infty/\ell_28 has at most /2\ell_\infty/\ell_29 nonzero entries and ABF\|AB\|_F0, median decoding returns every entry exactly with probability ABF\|AB\|_F1 (Pagh, 2011). More strongly, if ABF\|AB\|_F2 and ABF\|AB\|_F3 have at most ABF\|AB\|_F4 nonzero entries total and ABF\|AB\|_F5 has at most ABF\|AB\|_F6 nonzero entries, then a sparse representation of ABF\|AB\|_F7 can be computed with high probability in time ABF\|AB\|_F8 (Pagh, 2011). This exact sparse-output theorem is the point at which compressed matrix multiplication already overlaps with output-sensitive sparse matrix multiplication, rather than merely approximate estimation.

4. Recovery of heavy entries and the robust interpretation

A defining feature of Pagh’s framework is that it targets recovery of significant entries rather than low-rank or norm-relative approximation of the full dense product (Pagh, 2011). To identify large entries without scanning all ABF\|AB\|_F9 positions, the algorithm augments sketching with error-correcting codes. Code bits are used to create masked sketches whose bucket behavior reveals the row and column indices of isolated heavy entries; decoding yields a candidate set of AFBF\|A\|_F\|B\|_F0 positions containing the large-magnitude entries above an appropriate threshold (Pagh, 2011).

Bringmann, Fischer, and Nakos place this guarantee in sparse-recovery language. For sparse inputs AFBF\|A\|_F\|B\|_F1 with AFBF\|A\|_F\|B\|_F2 and parameter AFBF\|A\|_F\|B\|_F3, they define robust sparse matrix multiplication by the requirement

AFBF\|A\|_F\|B\|_F4

where AFBF\|A\|_F\|B\|_F5 is obtained by zeroing out the AFBF\|A\|_F\|B\|_F6 largest entries of AFBF\|A\|_F\|B\|_F7 in absolute value (Bringmann et al., 1 Jul 2026). They state explicitly that Pagh’s “compressed matrix multiplication” is this robust problem under a later name, and that among known sparse matrix multiplication algorithms, Pagh’s algorithm with running time AFBF\|A\|_F\|B\|_F8 had been the only one known to be robust in this sense (Bringmann et al., 1 Jul 2026).

This interpretation resolves a common misconception. Pagh’s method is not merely an approximate matrix multiplication algorithm in the classical projection or sampling sense. Its central guarantee depends only on the tail of the output, not on the full Frobenius norm of the product, which is substantially stronger when the product is “spiky” and dominated by a small number of large entries (Bringmann et al., 1 Jul 2026).

5. Black-box robustification and the modern structural view

The principal modern development is the reduction of robust sparse matrix multiplication to exact sparse matrix multiplication. Bringmann, Fischer, and Nakos prove that if sparse matrix multiplication with AFBF\|A\|_F\|B\|_F9 nonzero inputs and QQ0 nonzero outputs runs in time QQ1, then robust sparse matrix multiplication runs in time

QQ2

with high probability (Bringmann et al., 1 Jul 2026). Their central message is that Pagh’s guarantee is not a specialized consequence of his FFT-based polynomial encoding, but a black-box consequence of exact sparse multiplication up to polylogarithmic overhead.

The reduction is built around a query model for an unknown matrix QQ3, instantiated later with QQ4. One can query compressed products QQ5, where QQ6 has column sparsity QQ7 and QQ8 has row sparsity QQ9; in the multiplication setting, such a query is answered by computing AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,0, AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,1, and then AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,2 (Bringmann et al., 1 Jul 2026). Sparse-recovery sketches are then applied to recover heavy entries from a small number of such compressed products. The technical toolkit includes an AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,3-tail estimator, a fast heavy-hitter recovery sketch, and a budget-allocation mechanism that assigns per-column recovery budgets AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,4 satisfying

AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,5

with high probability (Bringmann et al., 1 Jul 2026).

A notable element is a minimum-cost multiple-choice knapsack formulation used to estimate the global tail and derive feasible column budgets from sketch data (Bringmann et al., 1 Jul 2026). This suggests a reinterpretation of Pagh’s original problem: the difficult part is not polynomial compression per se, but allocation of sparse-recovery effort across a highly unbalanced matrix product. In this view, Pagh’s algorithm is the first concrete realization of a broader robustification principle.

6. Complexity improvements and implementation refinements

Instantiating the black-box reduction with the state-of-the-art sparse matrix multiplication algorithm of Abboud, Bringmann, Fischer, and Künnemann yields

AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,6

for robust sparse matrix multiplication (Bringmann et al., 1 Jul 2026). In the regime AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,7, the same reduction gives

AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,8

for any AB=k=1nakbk,AB=\sum_{k=1}^n a_k b_k,9, with high probability (Bringmann et al., 1 Jul 2026). Since aka_k0 time is necessary merely to write down aka_k1 significant outputs, this is essentially optimal in that regime (Bringmann et al., 1 Jul 2026). Historically, this both subsumes and improves Pagh’s aka_k2 bound.

On the implementation side, recent work has revisited Pagh’s original transform step. “Engineering Compressed Matrix Multiplication with the Fast Walsh-Hadamard Transform” replaces the FFT-based cyclic convolution by Walsh–Hadamard-based XOR convolution, using the pair hash

aka_k3

instead of aka_k4, while preserving unbiasedness and variance guarantees (Andersson et al., 14 Jan 2026). The paper states that all relevant correctness results from Pagh carry over to the FWHT variant, because the analysis depends on pairwise-independent bucket assignment and random signed collisions rather than specifically on cyclic convolution (Andersson et al., 14 Jan 2026).

Empirically, this engineering study reports that the FWHT variant is up to aka_k5 faster than the FFT-based version, and under favorable sparsity and magnitude patterns in the product matrix can achieve a speedup of up to aka_k6 over Intel MKL’s DGEMM, while retaining low failure probability in the estimates (Andersson et al., 14 Jan 2026). The implementation targets dense double-precision matrices on 64-core CPU nodes and provides NumPy-compatible Python bindings (Andersson et al., 14 Jan 2026). These results do not alter the algorithmic essence of Pagh’s estimator, but they demonstrate that the sketch-based approach can be practical when the output is sparse or dominated by a few heavy entries.

7. Relation to neighboring compressed-multiplication paradigms

Pagh’s compressed matrix multiplication belongs to a broad family of compressed-output methods, but it occupies a specific niche. It differs from classical approximate matrix multiplication in the Cohen–Lewis, Drineas–Kannan–Mahoney, and Sarlós traditions because those methods typically target Frobenius- or spectral-norm approximation of the whole product, whereas Pagh’s method targets entrywise additive recovery of heavy entries and exact sparse-output recovery when possible (Pagh, 2011, Bringmann et al., 1 Jul 2026). It also differs from exact deterministic packing methods such as aka_k7-adic compressed modular multiplication, which encode several residues into one machine word and remain exact provided explicit arithmetic inequalities hold (0803.1975).

It is also distinct from recent compressed-sensing formulations of output-sparse multiplication over arbitrary rings. “Output-Sparse Matrix Multiplication Using Compressed Sensing” gives deterministic and randomized algorithms that compute aka_k8 exactly under a sparsity promise aka_k9, using explicit compressed sensing and matrix-multiplication verification rather than Pagh’s hash-and-sign polynomial sketch (Bennett et al., 14 Aug 2025). That work is conceptually allied to the “compress first, recover later” paradigm, but technically different: it uses deterministic sparse-recovery matrices over arbitrary rings and exact recovery, whereas Pagh’s original framework is randomized, real-valued, and organized around CountSketch-style bucket collisions (Bennett et al., 14 Aug 2025).

At a broader methodological distance are matrix-compression schemes that support direct exact multiplication in a structured compressed representation, such as grammar-compressed matrix–vector multiplication or adaptive multiplication of kk0-matrices (Ferragina et al., 2022, Börm, 2023). Those lines of work treat “compressed matrix multiplication” as arithmetic directly on compressed operands rather than sketch-based recovery of an implicitly compressed output. The comparison helps isolate what is specific about Pagh’s contribution: not compression of stored matrices, but compressed sensing of the product itself without first forming the product.

In contemporary perspective, Pagh’s compressed matrix multiplication is best understood as the foundational sketch-based formulation of robust sparse matrix multiplication: a method that compresses the product kk1 into a small randomized summary, supports unbiased entry queries with variance kk2, recovers heavy entries through coding-based decoding, yields exact multiplication in sparse-output regimes, and—through later work—admits a black-box equivalence to exact sparse matrix multiplication up to polylogarithmic overhead (Pagh, 2011, Bringmann et al., 1 Jul 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Pagh’s Compressed Matrix Multiplication.