English

Almost Optimal Tensor Sketch

Data Structures and Algorithms 2019-09-05 v1 Machine Learning Probability Machine Learning

Abstract

We construct a matrix MRmdcM\in R^{m\otimes d^c} with just m=O(cλε2polylog1/εδ)m=O(c\,\lambda\,\varepsilon^{-2}\text{poly}\log1/\varepsilon\delta) rows, which preserves the norm Mx2=(1±ε)x2\|Mx\|_2=(1\pm\varepsilon)\|x\|_2 of all xx in any given λ\lambda dimensional subspace of Rd R^d with probability at least 1δ1-\delta. This matrix can be applied to tensors x(1)x(c)Rdcx^{(1)}\otimes\dots\otimes x^{(c)}\in R^{d^c} in O(cmmin{d,m})O(c\, m \min\{d,m\}) time -- hence the name "Tensor Sketch". (Here xy=asvec(xyT)=[x1y1,x1y2,,x1ym,x2y1,,xnym]Rnmx\otimes y = \text{asvec}(xy^T) = [x_1y_1, x_1y_2,\dots,x_1y_m,x_2y_1,\dots,x_ny_m]\in R^{nm}.) This improves upon earlier Tensor Sketch constructions by Pagh and Pham~[TOCT 2013, SIGKDD 2013] and Avron et al.~[NIPS 2014] which require m=Ω(3cλ2δ1)m=\Omega(3^c\lambda^2\delta^{-1}) rows for the same guarantees. The factors of λ\lambda, ε2\varepsilon^{-2} and log1/δ\log1/\delta can all be shown to be necessary making our sketch optimal up to log factors. With another construction we get λ\lambda times more rows m=O~(cλ2ε2(log1/δ)3)m=\tilde O(c\,\lambda^2\,\varepsilon^{-2}(\log1/\delta)^3), but the matrix can be applied to any vector x(1)x(c)Rdcx^{(1)}\otimes\dots\otimes x^{(c)}\in R^{d^c} in just O~(c(d+m))\tilde O(c\, (d+m)) time. This matches the application time of Tensor Sketch while still improving the exponential dependencies in cc and log1/δ\log1/\delta. Technically, we show two main lemmas: (1) For many Johnson Lindenstrauss (JL) constructions, if Q,QRm×dQ,Q'\in R^{m\times d} are independent JL matrices, the element-wise product QxQyQx \circ Q'y equals M(xy)M(x\otimes y) for some MRm×d2M\in R^{m\times d^2} which is itself a JL matrix. (2) If M(i)Rm×mdM^{(i)}\in R^{m\times md} are independent JL matrices, then M(1)(x(M(2)y))=M(xy)M^{(1)}(x \otimes (M^{(2)}y \otimes \dots)) = M(x\otimes y\otimes \dots) for some MRm×dcM\in R^{m\times d^c} which is itself a JL matrix. Combining these two results give an efficient sketch for tensors of any size.

Keywords

Cite

@article{arxiv.1909.01821,
  title  = {Almost Optimal Tensor Sketch},
  author = {Thomas D. Ahle and Jakob B. T. Knudsen},
  journal= {arXiv preprint arXiv:1909.01821},
  year   = {2019}
}
R2 v1 2026-06-23T11:05:22.168Z