Weighted Minwise Hashing Beats Linear Sketching for Inner Product Estimation
Aline Bessa, Majid Daliri, Juliana Freire, Cameron Musco, Christopher Musco, Aécio Santos, Haoxiang Zhang
TL;DR
This work tackles the challenge of estimating inner products between high-dimensional vectors under compact sketches. It introduces Weighted MinHash as a non-linear sketching method that extends MinHash to weighted, real-valued vectors, providing a worst-case bound that matches linear sketches for dense vectors and improves when overlap between supports is small. The method expands vectors with weights, applies Weighted MinHash, and uses an estimator with $m = O(\log(1/\delta)/\epsilon^2)$ to guarantee accurate approximations with high probability, even for sparse data. Empirical results on synthetic and real datasets show WMH outperforming traditional linear sketches and unweighted hashing-based sketches in sparse regimes, with competitive performance when overlap is large, highlighting its practical impact for dataset search, join-size estimation, and related statistics on unjoined tables.
Abstract
We present a new approach for computing compact sketches that can be used to approximate the inner product between pairs of high-dimensional vectors. Based on the Weighted MinHash algorithm, our approach admits strong accuracy guarantees that improve on the guarantees of popular linear sketching approaches for inner product estimation, such as CountSketch and Johnson-Lindenstrauss projection. Specifically, while our method admits guarantees that exactly match linear sketching for dense vectors, it yields significantly lower error for sparse vectors with limited overlap between non-zero entries. Such vectors arise in many applications involving sparse data. They are also important in increasingly popular dataset search applications, where inner product sketches are used to estimate data covariance, conditional means, and other quantities involving columns in unjoined tables. We complement our theoretical results by showing that our approach empirically outperforms existing linear sketches and unweighted hashing-based sketches for sparse vectors.
