Scalability and Total Recall with Fast CoveringLSH

Ninh Pham, Rasmus Pagh

This paper, presented by researchers from the IT University of Copenhagen, introduces Fast CoveringLSH (fcLSH), a significant upgrade to similarity search algorithms that guarantees you will never miss a "near neighbor" again.

TL;DR

Traditional Locality-Sensitive Hashing (LSH) is fast but probabilistic, meaning it often misses relevant results (false negatives). Fast CoveringLSH (fcLSH) provides a practical way to achieve 100% recall in Hamming space while using the Fast Hadamard Transform to slash computation time from $O(dL)$ to $O(d + L \log L)$.

What Problem Does This Paper Address?

In the world of "big data," finding similar items (like near-duplicate web pages or similar images) is a massive challenge. The standard tool for this is Locality-Sensitive Hashing (LSH). LSH works by hashing similar items into the same "buckets" with high probability, allowing us to search only a small fraction of the database.

However, LSH has a major Achilles' heel: it is probabilistic. There is always a chance that two very similar items won't collide in any hash table, leading to false negatives. For high-stakes applications like fingerprint recognition, plagiarism detection, or entity resolution, missing a match is unacceptable.

While a theoretical framework called "CoveringLSH" was recently proposed to eliminate these false negatives, it was computationally expensive. As the dimensionality of data ($d$) and the number of hash tables ($L$) grew, the time spent just calculating hashes became a bottleneck.

Methods

The authors bridge the gap between theoretical "total recall" and practical performance through two main innovations:

  1. The Hadamard Connection: The authors realized that the hash functions required for CoveringLSH—which carefully choose correlated bit positions to "cover" all possible differences—are mathematically related to the rows of a Hadamard matrix.
  2. Fast Hadamard Transform (FHT): By leveraging this connection, they can use the FHT to compute all $L$ hash values simultaneously. This moves the needle on computational complexity from a multiplicative $O(dL)$ to a much more scalable $O(d + L \log L)$.

To handle different search radii, they also employ "replication" (repeating bit strings to increase effective radius) and "partitioning" (splitting strings to decrease it) tricks, ensuring the algorithm stays efficient even when the search parameters aren't a perfect fit for the hash structure.

Datasets

The authors evaluated fcLSH against synthetic data and four diverse real-world datasets:

  • ANN_SIFT1M: 1 million image feature vectors.
  • Webspam: 350,000 web documents.
  • Enron: ~40,000 emails (high-dimensional text).
  • MovieLens: ~230,000 users and their movie ratings.

The properties of these datasets are summarized below:

Table 2: Data set properties

Key Insights and Ideas

  • Total Recall is Practical: You don't have to trade away accuracy for speed. By using structured, correlated hash functions instead of purely random ones, you can guarantee 100% recall.
  • Pruning Power: Even though fcLSH guarantees finding every neighbor, it doesn't lose its "pruning power." It is just as good as traditional LSH at ignoring "far" points that aren't matches.
  • Overcoming the Curse of Dimensionality: In high-dimensional spaces (like the 256-bit Webspam fingerprints), the distance gap between near and far points is often large enough that fcLSH can filter out 70% of the database, providing a 3x speedup over a simple linear search while remaining just as accurate.
Figure 1: The distance histogram between 50 ran- dom queries and a sampled set of data points of Web- spam 64 bits (left) and Webspam 256 bits (right).

Key Results

  • Speedup: fcLSH is dramatically faster than the basic CoveringLSH (bcLSH) implementation. As dimensionality $d$ increases, the FHT-based approach stays relatively flat while the basic approach's time explodes.
Figure 4: Hash computation time comparison
  • Accuracy: In tests on SIFT data, traditional LSH had a recall between 92% and 96%. fcLSH maintained a perfect 1.0 (100% recall) across all tested radii.
  • Superiority over MIH: fcLSH consistently achieved higher precision than Multi-Index Hashing (MIH), especially on real-world data that isn't uniformly distributed.
Figure 2: Precision/Recall comparison

Limitations and Future Work

  • Space Complexity: For very large search radii, the number of hash tables required ($L$) grows exponentially ($2^{r+1}$). This can lead to high memory usage, limiting the "exact" search to a radius of about 20 in high-dimensional spaces.
  • Hamming Space Only: The current implementation is specific to Hamming distance (binary vectors). The authors suggest that extending this "total recall" guarantee to other similarity measures (like Euclidean distance) is a key open direction.
  • Linear Space Goals: A major future goal is to reduce the space requirement to be linear or near-linear relative to the dataset size while still maintaining the 100% recall guarantee.

Summary updated

Abstract

Locality-sensitive hashing (LSH) has emerged as the dominant algorithmic technique for similarity search with strong performance guarantees in high-dimensional spaces. A drawback of traditional LSH schemes is that they may have \emph{false negatives}, i.e., the recall is less than 100\%. This limits the applicability of LSH in settings requiring precise performance guarantees. Building on the recent theoretical "CoveringLSH" construction that eliminates false negatives, we propose a fast and practical covering LSH scheme for Hamming space called \emph{Fast CoveringLSH (fcLSH)}. Inheriting the design benefits of CoveringLSH our method avoids false negatives and always reports all near neighbors. Compared to CoveringLSH we achieve an asymptotic improvement to the hash function computation time from $\mathcal{O}(dL)$ to $\mathcal{O}(d + L\log{L})$, where $d$ is the dimensionality of data and $L$ is the number of hash tables. Our experiments on synthetic and real-world data sets demonstrate that \emph{fcLSH} is comparable (and often superior) to traditional hashing-based approaches for search radius up to 20 in high-dimensional Hamming space.
BibTeX
@inproceedings{pham2016scalability,
  author = {Ninh Pham and Rasmus Pagh},
  title = {{Scalability and Total Recall with Fast CoveringLSH}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2016},
  doi = {10.1145/2983323.2983742},
}
Figure