Compressed matrix multiplication

  • Authors:
  • Rasmus Pagh

  • Affiliations:
  • IT University of Copenhagen, København S, Denmark

  • Venue:
  • ACM Transactions on Computation Theory (TOCT) - Special issue on innovations in theoretical computer science 2012
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a simple algorithm that approximates the product of n-by-n real matrices A and B. Let ‖AB‖F denote the Frobenius norm of AB, and b be a parameter determining the time/accuracy trade-off. Given 2-wise independent hash functions h1,h2: [n]→ [b], and s1,s2: [n]→ {−1,+1} the algorithm works by first “compressing” the matrix product into the polynomial p(x) = ∑k=1n \left(∑i=1n Aik s1(i) xh1(i)\right) \left(∑j=1n Bkj s2(j) xh2(j)\right). Using the fast Fourier transform to compute polynomial multiplication, we can compute c0,…,cb−1 such that ∑i ci xi = (p(x) mod xb) + (p(x) div xb) in time Õ(n2+ nb). An unbiased estimator of (AB)ij with variance at most ‖AB‖F2/b can then be computed as: Cij = s1(i)s2(j)c(h1(i)+h2(j)) mod b. Our approach also leads to an algorithm for computing AB exactly, with high probability, in time Õ(N + nb) in the case where A and B have at most N nonzero entries, and AB has at most b nonzero entries.