We present a simple randomized algorithm for approximate matrix multiplication (AMM) whose error scales with the *output* norm $\|AB\|_F$. Given any $n\times n$ matrices $A,B$ and a runtime parameter $r\leq n$, the algorithm produces in $O(n^2(r+\log n))$ time, a matrix $C$ with total squared error $\mathbb{E}[\|C-AB\|_F^2]\le (1-\frac{r}{n})\|AB\|_F^2$, per-entry variance $\|AB\|_F^2/n^2$ and bias $\mathbb{E}[C]=\frac{r}{n}AB$. Alternatively, the algorithm can compute an *unbiased* estimation with expected total squared error $\frac{n}{r}\|{AB}\|_{F}^2$, recovering the state-of-art AMM error obtained by Pagh's TensorSketch algorithm (Pagh, 2013). Our algorithm is a log-factor faster. The key insight in the algorithm is a new variation of pseudo-random rotation of the input matrices (a Fast Hadamard Transform with asymmetric diagonal scaling), which redistributes the Frobenius norm of the *output* $AB$ uniformly across its entries.
翻译:我们提出了一种简单的随机算法用于近似矩阵乘法(AMM),其误差与*输出*范数 $\|AB\|_F$ 成比例。给定任意 $n\times n$ 矩阵 $A,B$ 和一个运行时间参数 $r\leq n$,该算法在 $O(n^2(r+\log n))$ 时间内生成一个矩阵 $C$,其总平方误差 $\mathbb{E}[\|C-AB\|_F^2]\le (1-\frac{r}{n})\|AB\|_F^2$,逐项方差为 $\|AB\|_F^2/n^2$,偏差为 $\mathbb{E}[C]=\frac{r}{n}AB$。或者,该算法可以计算一个*无偏*估计,其期望总平方误差为 $\frac{n}{r}\|{AB}\|_{F}^2$,从而恢复了由 Pagh 的 TensorSketch 算法(Pagh, 2013)获得的最先进的 AMM 误差。我们的算法在速度上快一个对数因子。该算法的关键见解是对输入矩阵进行伪随机旋转的一种新变体(一种具有非对称对角缩放的快速哈达玛变换),该变换将*输出* $AB$ 的 Frobenius 范数均匀地重新分布到其各个条目上。