Papers
Topics
Authors
Recent
Search
2000 character limit reached

Output-Sparse Matrix Multiplication

Updated 8 July 2026
  • 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 ABAB exactly when two sparse matrices are multiplied and the product itself has only moutm_{out} nonzero entries, with running time depending on minm_{in} and moutm_{out} 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-kk 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 AA and BB, represented as lists of nonzero entries, and the key parameters are minm_{in}, the total number of nonzeros in the inputs, and moutm_{out}, the total number of nonzeros in the product ABAB (Abboud et al., 2023). The goal is to compute moutm_{out}0 with running time depending explicitly on both moutm_{out}1 and moutm_{out}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

moutm_{out}3

or, when an output mask is present,

moutm_{out}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: moutm_{out}5 The second is robust or top-moutm_{out}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

moutm_{out}7

and defines the sparse multiplication exponent moutm_{out}8 as the unique solution of

moutm_{out}9

Here minm_{in}0 is the rectangular matrix multiplication exponent for multiplying an minm_{in}1 matrix by an minm_{in}2 matrix (Abboud et al., 2023). The resulting exact bounds are minm_{in}3 for Boolean matrices deterministically and for arbitrary rings randomized, for every minm_{in}4 (Abboud et al., 2023).

In the fully sparse regime, where

minm_{in}5

the same work gives

minm_{in}6

using current rectangular matrix multiplication bounds, improving the previous minm_{in}7 benchmark in the Boolean case (Abboud et al., 2023). The paper further states that when minm_{in}8, the runtime is already near-linear minm_{in}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 moutm_{out}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 moutm_{out}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 moutm_{out}2 matrices over an arbitrary ring moutm_{out}3 under the promise

moutm_{out}4

This is moutm_{out}5-OSMM over moutm_{out}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

moutm_{out}7

arithmetic operations over any ring moutm_{out}8, for all moutm_{out}9 and kk0 (Bennett et al., 14 Aug 2025). Its mechanism is a two-pass reduction to sparse recovery. If kk1 has at most kk2 nonzeros, with kk3, the first pass recovers every kk4-sparse column of kk5 from measurements

kk6

where kk7 is a sparse deterministic compressed-sensing matrix (Bennett et al., 14 Aug 2025). Since there can be fewer than kk8 columns with more than kk9 nonzeros, the residual has fewer than AA0 nonzero columns, and therefore every row of the residual is AA1-sparse; a second recovery pass on the transpose completes the product (Bennett et al., 14 Aug 2025).

The randomized algorithm improves the exponent to

AA2

where AA3 (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 AA4 (Bennett et al., 14 Aug 2025).

The paper also proves optimality for the randomized bounds by reduction from rectangular matrix multiplication. For OSMM with AA5, there is a randomized algorithm in time AA6 for every AA7 if and only if

AA8

(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-AA9 output variants

A recent generalization replaces exact recovery of all output nonzeros by recovery of the significant output entries. For BB0 and BB1, robust sparse matrix multiplication asks for a matrix BB2 such that

BB3

where BB4 is obtained by zeroing out the largest BB5 entries in absolute value (Bringmann et al., 1 Jul 2026). This is an BB6-style tail guarantee for matrices, and the paper observes that if BB7, then BB8, so the guarantee forces BB9 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-minm_{in}0 multiplication. If sparse matrix multiplication with input sparsity minm_{in}1 and output sparsity minm_{in}2 runs in time minm_{in}3, then robust sparse matrix multiplication is computable in time

minm_{in}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-minm_{in}5 output-sensitive routine with only polylogarithmic overhead, replacing minm_{in}6 by minm_{in}7 (Bringmann et al., 1 Jul 2026).

Plugging in the state-of-the-art exact sparse multiplication algorithm yields

minm_{in}8

and when

minm_{in}9

the paper obtains

moutm_{out}0

for any moutm_{out}1, with high probability (Bringmann et al., 1 Jul 2026). Since outputting moutm_{out}2 entries costs moutm_{out}3, the paper describes this as “almost-optimal” in that regime (Bringmann et al., 1 Jul 2026).

The reduction treats moutm_{out}4 as an unknown matrix accessible through compressed products moutm_{out}5, where moutm_{out}6 and moutm_{out}7 are sparse sketching matrices with

moutm_{out}8

Because

moutm_{out}9

such queries can be implemented via exact sparse multiplication on compressed instances (Bringmann et al., 1 Jul 2026). The reduction then combines ABAB0-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 ABAB1 (Bringmann et al., 1 Jul 2026).

This robust variant is not exact OSMM unless ABAB2 or the tail is zero, but it is more targeted than standard approximate matrix multiplication. The approximation depends on ABAB3, not on all of ABAB4, 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 ABAB5 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: ABAB6 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

ABAB7

rather than estimating ABAB8 directly (Du et al., 2022). Given exact row-wise FLOP counts and a sampled estimate ABAB9 of the compression ratio, the predicted output row size is

moutm_{out}00

On 625 test cases, the paper reports average absolute relative error moutm_{out}01 for the proposed method versus moutm_{out}02 for the reference design, with worst-case errors moutm_{out}03 and moutm_{out}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

moutm_{out}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

moutm_{out}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

moutm_{out}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 moutm_{out}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

moutm_{out}09

Its temporary storage is moutm_{out}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

moutm_{out}11

with complexity

moutm_{out}12

and space

moutm_{out}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 moutm_{out}14 and moutm_{out}15 over a semiring, with

moutm_{out}16

the product can be computed in

moutm_{out}17

I/Os, and this is matched up to polylogarithmic factors by a lower bound

moutm_{out}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 moutm_{out}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 moutm_{out}20, moutm_{out}21, and a required-output indicator moutm_{out}22 has at most moutm_{out}23 nonzeros, the problem can be solved in moutm_{out}24 rounds over fields and rings supporting fast matrix multiplication and moutm_{out}25 rounds over semirings (Gupta et al., 2022). This is a supported OSMM result: only entries in the known sparse support of moutm_{out}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: moutm_{out}27 where computing all of moutm_{out}28 is wasteful when wedges far outnumber triangles (Buluç, 6 Aug 2025). Sparse attention similarly computes only masked entries,

moutm_{out}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 moutm_{out}30 or moutm_{out}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-moutm_{out}32 or heavy-output sense with tail-sensitive error guarantees, and becomes exact only when the tail vanishes or moutm_{out}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-moutm_{out}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.

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 Output-Sparse Matrix Multiplication (OSMM).