Fast Similarity Sketching
Authors:
- Soren DahlgaardSDSoren Dahlgaard
- Mathias Bak Tejs KnudsenMKMathias Bak Tejs Knudsen
- Mikkel ThorupMTMikkel Thorup
- 1 October 2017
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- No. 02725428,p. 663-671
Abstract
We consider the Similarity Sketching problem: Given a universe [u] = {0, ... ,u - 1} we want a random function S mapping subsets A ⊆ [u] into vectors S(A) of size t, such that similarity is preserved. More precisely: Given sets A, B ⊆ [u], define X i = [S(A)[i] = S(B)[i]] and X = Σ i∈[t] X i . We want to have E[X] = t · J(A, B), where J(A, B) = |A ∩ B|/|A ∪ B| and furthermore to have strong concentration guarantees (i.e. Chernoff-style bounds) for X. This is a fundamental problem which has found numerous applications in data mining, large-scale classification, computer vision, similarity search, etc. via the classic MinHash algorithm. The vectors S(A) are also called sketches. The seminal t×MinHash algorithm uses t random hash functions h 1 , ... , h t , and stores (min a∈A h 1 (A), ... , min a∈A h t (A)) as the sketch of A. The main drawback of MinHash is, however, its O(t · |A|) running time, and finding a sketch with similar properties and faster running time has been the subject of several papers. Addressing this, Li et al. [NIPS'12] introduced one permutation hashing (OPH), which creates a sketch of size t in O(t+|A|) time, but with the drawback that possibly some of the t entries are “empty” when |A| = O(t). One could argue that sketching is not necessary in this case, however the desire in most applications is to have one sketching procedure that works for sets of all sizes. Therefore, filling out these empty entries is the subject of several follow-up papers initiated by Shrivastava and Li [ICML'14]. However, these “densification” schemes fail to provide good concentration bounds exactly in the case |A| = O(t), where they are needed. In this paper we present a new sketch which obtains essentially the best of both worlds. That is, a fast O(t log t+|A|) expected running time while getting the same strong concentration bounds as MinHash. Our new sketch can be seen as a mix between sampling with replacement and sampling without replacement. We demonstrate the power of our new sketch by considering popular applications in large-scale classification with linear SVM as introduced by Li et al. [NIPS'11] as well as approximate similarity search using the LSH framework of Indyk and Motwani [STOC'98]. In particular, for the j 1 , j 2 -approximate similarity search problem on a collection of n sets we obtain a data-structure with space usage O(n 1+ρ + Σ A∈C |A|) and O(n ρ log n + |Q|) expected time for querying a set Q compared to a O(n ρ log n · |Q|) expected query time of the classic result of Indyk and Motwani.Keywords
All Related Versions
This publication has 13 references indexed in Scilit:
- Hashing for Statistics over K-Partitions2015
- 0-Bit Consistent Weighted Sampling2015
- Optimal Data-Dependent Hashing for Approximate Near Neighbors2015
- Bottom-k and priority sampling, set similarity and subset sums with minimal independence2013
- Sketching for Big Data Recommender Systems Using Fast Pseudo-random FingerprintsLecture Notes in Computer Science, 2013
- Nearest-Neighbor Methods in Learning and Vision (Shakhnarovich, G. et al., Eds.; 2006) [Book review]IEEE Transactions on Neural Networks, 2008
- Finding near-duplicate web pages2006
- Approximate nearest neighbors1998
- Syntactic clustering of the WebComputer Networks and ISDN Systems, 1997
- Chernoff–Hoeffding Bounds for Applications with Limited IndependenceSIAM Journal on Discrete Mathematics, 1995