Scalability and Total Recall with Fast CoveringLSH

Ninh Pham, Rasmus Pagh

TL;DR

Locality-sensitive hashing (LSH) is the industry standard for fast similarity search, but it typically sacrifices perfect recall. This paper introduces Fast CoveringLSH (fcLSH), an algorithm that guarantees 100% recall (zero false negatives) while significantly accelerating hash computations using the Fast Hadamard Transform.

The Challenge: Balancing Speed and Accuracy

Finding similar items in massive, high-dimensional datasets—such as image embeddings or document fingerprints—is computationally intensive due to the "curse of dimensionality." Locality-sensitive hashing (LSH) addresses this by hashing similar points into the same "buckets," enabling sub-linear search times.

However, traditional LSH is probabilistic. There is always a risk that two highly similar items will fail to collide, resulting in a false negative. For applications requiring absolute precision—such as fingerprint recognition, entity resolution, or plagiarism detection—this lack of 100% recall is a significant drawback. While a theoretical framework called "CoveringLSH" proved that false negatives could be eliminated via correlated hash functions, its naive implementation requires $O(dL)$ time (where $d$ is dimensions and $L$ is the number of hash tables), making it too slow for practical use.

Methods: Fast CoveringLSH (fcLSH)

The authors propose Fast CoveringLSH (fcLSH), which transforms the theoretical CoveringLSH framework into a practical tool through two primary innovations:

  1. Hadamard Codes for $r$-covering: Instead of random bit selection, the method employs Hadamard codes to create an "$r$-covering" LSH family. This mathematically guarantees that any two binary vectors within a Hamming distance of $r$ will collide in at least one hash table, ensuring zero false negatives.
  2. Fast Hadamard Transform (FHT): The computational bottleneck of basic CoveringLSH is the matrix-vector multiplication needed for hash generation. By mapping this operation to the Fast Hadamard Transform, fcLSH reduces computation time from $O(dL)$ to $O(d + L \log L)$. This provides a massive asymptotic speedup in high-dimensional settings.
Comparison of time complexity for different hashing methods, highlighting the efficiency gains of fcLSH.
  1. Replication and Partitioning: To maintain sub-linear query times across varying search radii, fcLSH dynamically replicates or partitions data dimensions to optimize the search ratio relative to the dataset size.

Experimental Evaluation

The authors evaluated fcLSH against synthetic and real-world datasets, including ANN_SIFT1M (1 million image features), Webspam (350,000 documents), and high-dimensional sets like Enron (~28K dimensions) and MovieLens (~140K dimensions).

Key Results

  • Total Recall: Across all tests, fcLSH achieved 100% recall. In contrast, classic LSH variants consistently missed neighbors, yielding recall rates between 92% and 99%.
  • Superior Efficiency: On the ANN_SIFT1M dataset, fcLSH evaluated up to 14 times fewer candidates and processed 7 times fewer collisions than Multi-Index Hashing (MIH).
  • Robustness to Data Distribution: While methods like MIH perform well on uniform synthetic data, they struggle with the clustered distributions typical of real-world images and text. fcLSH proved significantly more robust in these scenarios.
Precision and Recall performance of fcLSH compared to other methods across varying dataset sizes.

Limitations and Future Work

The $r$-covering guarantee requires the number of hash tables ($L$) to grow exponentially with the search radius $r$. For $r \ge 10$, memory constraints require a partitioning trick. While this maintains 100% recall, it slightly reduces the algorithm's pruning power, leading to more false positives that must be filtered. Future research will focus on extending this exact-recall framework to other distance metrics and further reducing space complexity.

Summary updated

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