Output-Sparse Matrix Multiplication
- OSMM is the computation of sparse matrix products where performance depends on both the nonzeros in the inputs and the prescribed sparsity of the output.
- State-of-the-art methods employ dimensional reduction, heavy/light decomposition, and compressed sensing to achieve near-linear time in specific sparsity regimes.
- Variants including masked, support-restricted, and robust top-k approaches allow OSMM to address diverse applications in graph analytics, machine learning, and scientific computing.
Searching arXiv for recent OSMM papers and exact IDs cited in the article. Output-Sparse Matrix Multiplication (OSMM) denotes sparse matrix multiplication in regimes where algorithmic cost is intended to reflect not only input sparsity but also the sparsity, restriction, or practical significance of the output. In its most direct form, OSMM asks to compute exactly when two sparse matrices are multiplied and the product itself has only nonzero entries, with running time depending on and rather than on ambient dense dimensions alone (Abboud et al., 2023). More broadly, the literature also treats masked products, support-restricted products, and robust top- variants as output-sparse or output-aware forms of sparse matrix multiplication, because they compute only a prescribed or significant subset of output entries (Buluç, 6 Aug 2025, Bringmann et al., 1 Jul 2026).
1. Problem definition and scope
In the exact output-sensitive formulation, the input consists of sparse matrices and , represented as lists of nonzero entries, and the key parameters are , the total number of nonzeros in the inputs, and , the total number of nonzeros in the product (Abboud et al., 2023). The goal is to compute 0 with running time depending explicitly on both 1 and 2. This is the sense in which OSMM is “output-sparse”: the output sparsity is part of the problem specification, not merely an observed consequence after computation (Abboud et al., 2023).
A broader systems and application-level view uses the general sparse matrix product
3
or, when an output mask is present,
4
This perspective places canonical sparse matrix-matrix multiplication (SpGEMM), Masked-SpGEMM, SpMM, SDDMM, and related variants in one algebraic framework (Buluç, 6 Aug 2025). Within that framework, OSMM is the subset where the result itself is sparse, only a sparse subset of output indices is required, or the multiplication should be organized to avoid materializing dense or unnecessarily large intermediates (Buluç, 6 Aug 2025).
The literature distinguishes exact OSMM from two neighboring notions. The first is masked or support-restricted multiplication, where the output sparsity pattern is known in advance and only entries permitted by a sparse mask are computed: 5 The second is robust or top-6 output recovery, where one does not compute all nonzeros exactly but instead recovers the significant output entries with error controlled by the small tail of the product (Buluç, 6 Aug 2025, Bringmann et al., 1 Jul 2026).
2. Exact output-sensitive complexity
A central recent complexity result studies sparse matrix multiplication when
7
and defines the sparse multiplication exponent 8 as the unique solution of
9
Here 0 is the rectangular matrix multiplication exponent for multiplying an 1 matrix by an 2 matrix (Abboud et al., 2023). The resulting exact bounds are 3 for Boolean matrices deterministically and for arbitrary rings randomized, for every 4 (Abboud et al., 2023).
In the fully sparse regime, where
5
the same work gives
6
using current rectangular matrix multiplication bounds, improving the previous 7 benchmark in the Boolean case (Abboud et al., 2023). The paper further states that when 8, the runtime is already near-linear 9, hence almost optimal unconditionally (Abboud et al., 2023). This identifies a regime in which exact OSMM becomes essentially output-linear.
The underlying algorithmic strategy has two stages. First, a sparse-output product is reduced to multiplication in a smaller rectangular space whose outer dimensions satisfy roughly 0; second, that reduced problem is solved by a heavy/light decomposition together with dense rectangular multiplication on the heavy part (Abboud et al., 2023). A key conceptual consequence is that output sparsity can be converted into dimensional shrinkage, after which fast rectangular matrix multiplication determines the asymptotic frontier (Abboud et al., 2023).
The same work relates this frontier to all-edge triangle problems. It proves conditional lower bounds matching the upper-bound exponent 1 under a partially sparse all-edge triangle hypothesis, and in the fully sparse case gives an equivalence to a specific unbalanced all-edge triangle problem (Abboud et al., 2023). This positions exact OSMM at a fine-grained boundary tied closely to sparse graph triangle structure.
3. Compressed sensing and exact OSMM over rings
A separate exact OSMM framework studies 2 matrices over an arbitrary ring 3 under the promise
4
This is 5-OSMM over 6: the output is promised sparse, while the inputs may be dense (Bennett et al., 14 Aug 2025). The paper gives two compressed-sensing-based algorithms.
The deterministic algorithm runs in
7
arithmetic operations over any ring 8, for all 9 and 0 (Bennett et al., 14 Aug 2025). Its mechanism is a two-pass reduction to sparse recovery. If 1 has at most 2 nonzeros, with 3, the first pass recovers every 4-sparse column of 5 from measurements
6
where 7 is a sparse deterministic compressed-sensing matrix (Bennett et al., 14 Aug 2025). Since there can be fewer than 8 columns with more than 9 nonzeros, the residual has fewer than 0 nonzero columns, and therefore every row of the residual is 1-sparse; a second recovery pass on the transpose completes the product (Bennett et al., 14 Aug 2025).
The randomized algorithm improves the exponent to
2
where 3 (Bennett et al., 14 Aug 2025). It iteratively peels columns by sparsity scale using compressed sensing and a column-wise Freivalds-type verification routine. The active subproblem width shrinks with the threshold, and a flattening inequality yields the bound 4 (Bennett et al., 14 Aug 2025).
The paper also proves optimality for the randomized bounds by reduction from rectangular matrix multiplication. For OSMM with 5, there is a randomized algorithm in time 6 for every 7 if and only if
8
(Bennett et al., 14 Aug 2025). This gives exact OSMM an alternative compressed-sensing interpretation: sparse recovery is used not to approximate the output, but to reconstruct it exactly from a small number of structured measurements.
4. Robust and top-9 output variants
A recent generalization replaces exact recovery of all output nonzeros by recovery of the significant output entries. For 0 and 1, robust sparse matrix multiplication asks for a matrix 2 such that
3
where 4 is obtained by zeroing out the largest 5 entries in absolute value (Bringmann et al., 1 Jul 2026). This is an 6-style tail guarantee for matrices, and the paper observes that if 7, then 8, so the guarantee forces 9 exactly (Bringmann et al., 1 Jul 2026). In that sense, robust sparse multiplication strictly generalizes exact sparse multiplication.
The main theorem is a black-box reduction from exact output-sensitive multiplication to robust top-0 multiplication. If sparse matrix multiplication with input sparsity 1 and output sparsity 2 runs in time 3, then robust sparse matrix multiplication is computable in time
4
by a randomized algorithm that succeeds with high probability (Bringmann et al., 1 Jul 2026). In OSMM terms, any exact output-sensitive sparse multiplication routine can be converted into a robust top-5 output-sensitive routine with only polylogarithmic overhead, replacing 6 by 7 (Bringmann et al., 1 Jul 2026).
Plugging in the state-of-the-art exact sparse multiplication algorithm yields
8
and when
9
the paper obtains
0
for any 1, with high probability (Bringmann et al., 1 Jul 2026). Since outputting 2 entries costs 3, the paper describes this as “almost-optimal” in that regime (Bringmann et al., 1 Jul 2026).
The reduction treats 4 as an unknown matrix accessible through compressed products 5, where 6 and 7 are sparse sketching matrices with
8
Because
9
such queries can be implemented via exact sparse multiplication on compressed instances (Bringmann et al., 1 Jul 2026). The reduction then combines 0-tail sketches, heavy-hitter recovery sketches, Count-Sketch, AMS sketches, random signs, error-correcting-code ideas, and a minimum-cost multiple-choice knapsack approximation to allocate per-column recovery budgets whose total sum is 1 (Bringmann et al., 1 Jul 2026).
This robust variant is not exact OSMM unless 2 or the tail is zero, but it is more targeted than standard approximate matrix multiplication. The approximation depends on 3, not on all of 4, and is entrywise rather than merely Frobenius-norm global (Bringmann et al., 1 Jul 2026). This suggests a distinct OSMM regime: products that are sparse up to noise, or whose application semantics depend mainly on a sparse set of dominant entries.
5. Symbolic structure, masks, and compression ratio
Many practical sparse multiplication systems do not know 5 or the exact output structure in advance. A survey treatment emphasizes that SpGEMM is harder than SpMM because the output size is often unknown beforehand, and that output sparsity may arise explicitly through masks, implicitly through sparse products, or through application-level pruning and truncation (Buluç, 6 Aug 2025). In Masked-SpGEMM and SDDMM, only entries in a sparse mask are computed: 6 which is the most direct systems realization of output-restricted multiplication (Buluç, 6 Aug 2025).
The same survey highlights two implementation strategies for masked multiplication in triangle counting. One may use a mask-driven or output-driven method that iterates over existing mask entries and computes only the required dot products, or an input-driven method that traverses the sparse inputs but suppresses writes for entries masked out (Buluç, 6 Aug 2025). This distinction formalizes two contrasting OSMM philosophies: compute from desired outputs, or compute from input structure while filtering the result.
A related systems problem is output-structure prediction. One recent method predicts the number of nonzeros per output row by estimating the sampled compression ratio
7
rather than estimating 8 directly (Du et al., 2022). Given exact row-wise FLOP counts and a sampled estimate 9 of the compression ratio, the predicted output row size is
00
On 625 test cases, the paper reports average absolute relative error 01 for the proposed method versus 02 for the reference design, with worst-case errors 03 and 04, respectively (Du et al., 2022). This is not exact symbolic computation, but it addresses a core OSMM systems requirement: memory allocation and load balancing before materializing the output.
The notion of compression ratio also appears in performance studies as
05
quantifying how many intermediate products collapse into each final output nonzero on average (Nagasaka et al., 2018, Gu et al., 2020). High compression ratio means the cost is driven more by candidate products than by actual output entries; low compression ratio means the output is sparse in a stronger, more directly exploitable sense (Nagasaka et al., 2018, Gu et al., 2020).
6. Systems, distributed, and I/O perspectives
In shared-memory implementations, exact SpGEMM kernels are often organized row-wise and compared via their dependence on intermediate work and output materialization. A study of multicore and Intel KNL systems models hash-based SpGEMM with
06
where the first term reflects accumulation over generated products and the second reflects sorting output rows when sorted output is required (Nagasaka et al., 2018). The same paper models heap-based SpGEMM as
07
making explicit that heap methods depend more strongly on intermediate products than on the final number of output nonzeros (Nagasaka et al., 2018). It concludes that unsorted output can significantly help hash-based methods, and that compression ratio 08 is a useful predictor of algorithm choice (Nagasaka et al., 2018).
A complementary bandwidth-oriented approach, PB-SpGEMM, adopts an outer-product expand-sort-compress structure and analyzes arithmetic intensity in terms of
09
Its temporary storage is 10, so the method is most suitable when the output is sparse and the compression factor is modest (Gu et al., 2020). This sharpens an important OSMM distinction: output sparsity alone is insufficient if it is achieved only after a very large intermediate expansion.
In distributed memory, hypersparsity becomes a local phenomenon even when the global problem is only ordinarily sparse. A foundational 2D SpGEMM work introduces a hypersparse serial kernel based on the outer-product identity
11
with complexity
12
and space
13
(Buluç et al., 2010). Its relevance to OSMM is that local subproblems in a distributed decomposition often have sparse or hypersparse outputs even when the global output is not strongly sparse (Buluç et al., 2010).
External-memory complexity yields a different exact OSMM benchmark. For sparse matrices 14 and 15 over a semiring, with
16
the product can be computed in
17
I/Os, and this is matched up to polylogarithmic factors by a lower bound
18
in the semiring I/O model (Pagh et al., 2014). This result makes exact OSMM output-sensitive in terms of the true output size 19, even in the presence of cancellation (Pagh et al., 2014).
A further distributed specialization is the low-bandwidth model with known output support. When each row and column of the support matrices of 20, 21, and a required-output indicator 22 has at most 23 nonzeros, the problem can be solved in 24 rounds over fields and rings supporting fast matrix multiplication and 25 rounds over semirings (Gupta et al., 2022). This is a supported OSMM result: only entries in the known sparse support of 26 must be produced.
7. Applications, distinctions, and open directions
OSMM arises across graph algorithms, machine learning, computational biology, chemistry, and scientific computing. Triangle counting is a canonical masked example: 27 where computing all of 28 is wasteful when wedges far outnumber triangles (Buluç, 6 Aug 2025). Sparse attention similarly computes only masked entries,
29
and graph sampling or mini-batch extraction in GNNs constructs sparse submatrices rather than full dense products (Buluç, 6 Aug 2025). In computational biology and chemistry, Gram matrices, overlap matrices, and truncation-based products are often effectively output-sparse because only a small subset of pairwise interactions survives thresholds or physical cutoffs (Buluç, 6 Aug 2025).
Several distinctions recur throughout the literature. Exact OSMM computes the full sparse product and is parameterized by 30 or 31 (Abboud et al., 2023, Bennett et al., 14 Aug 2025). Masked or support-restricted multiplication computes only entries in a known sparse output pattern (Buluç, 6 Aug 2025, Gupta et al., 2022). Robust OSMM computes only the significant entries in a top-32 or heavy-output sense with tail-sensitive error guarantees, and becomes exact only when the tail vanishes or 33 dominates the true output sparsity (Bringmann et al., 1 Jul 2026). This suggests that “OSMM” is best treated as a family of output-aware multiplication problems rather than a single formal problem statement.
A frequent misconception is to identify all sparse matrix multiplication with OSMM. The survey literature explicitly notes that general SpGEMM is broader: sparse inputs do not imply sparse outputs, and in some regimes the output is dense enough that a dense representation is preferable (Buluç, 6 Aug 2025). Another misconception is that output sparsity alone determines the right algorithm. In semiring settings, even the legality of intersection-based sparse traversal can depend on algebraic properties such as whether implicit zeros act as multiplicative annihilators (Buluç, 6 Aug 2025).
The open directions emphasized by the cited work are complementary. Exact complexity papers point toward improved rectangular matrix multiplication exponents and sharper relations to triangle problems as the route to better exact bounds (Abboud et al., 2023). Compressed-sensing approaches suggest further simplification or derandomization, especially over rings (Bennett et al., 14 Aug 2025). Robust top-34 work implicitly highlights deterministic robustification and stronger guarantees as natural next questions (Bringmann et al., 1 Jul 2026). Supported distributed results explicitly ask whether the assumption of known output support can be removed (Gupta et al., 2022). Taken together, these directions indicate that the central unresolved theme in OSMM is not merely exploiting sparsity, but exploiting the right notion of output structure—exact support, masked support, or heavy-output significance—under the appropriate computational model.