Lune

ICLR2025Top-tier venue

Matrix Product Sketching via Coordinated Sampling

Majid Daliri, Juliana Freire, Danrong Li, Christopher Musco

2025Year

Abstract

We revisit the well-studied problem of approximating a matrix product, ATB\mathbf{A}^T\mathbf{B}, based on small space sketches S(A)\mathcal{S}(\mathbf{A}) and S(B)\mathcal{S}(\mathbf{B}) of A∈Rn×d\mathbf{A} \in \R^{n \times d} and B∈Rn×m\mathbf{B}\in \R^{n \times m}. We are interested in the setting where the sketches must be computed independently of each other, except for the use of a shared random seed. We prove that, when A\mathbf{A} and B\mathbf{B} are sparse, methods based on coordinated random sampling can outperform classical linear sketching approaches, like Johnson-Lindenstrauss Projection or CountSketch. For example, to obtain Frobenius norm error ε∥A∥F∥B∥Fε\|\mathbf{A}\|_F\|\mathbf{B}\|_F, coordinated sampling requires sketches of size O(s/ε2)O(s/ε^2) when A\mathbf{A} and B\mathbf{B} have at most s≤d,ms \leq d,m non-zeros per row. In contrast, linear sketching leads to sketches of size O(d/ε2)O(d/ε^2) and O(m/ε2)O(m/ε^2) for A\mathbf{A} and B\mathbf{B}. We empirically evaluate our approach on two applications: 1) distributed linear regression in databases, a problem motivated by tasks like dataset discovery and augmentation, and 2) approximating attention matrices in transformer-based language models. In both cases, our sampling algorithms yield an order of magnitude improvement over linear sketching.

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

Builds on9

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines