Abstract
Standard Locality-Sensitive Hashing (LSH) algorithms often suffer from a hidden performance bottleneck: a $1/p_1$ factor in query time that can turn "sub-linear" searches into slow, linear-time scans when similarity probabilities are low. This paper introduces a simple "High-Low Tables" ensemble method that reduces this overhead to $1/p_1^{1-\rho}$, potentially offering up to a factor of $n$ improvement in both speed and memory for high-dimensional datasets.
Introduction
Locality-Sensitive Hashing (LSH) is a fundamental technique for approximate nearest neighbor search in high-dimensional spaces. By hashing items such that similar items collide with high probability ($p_1$) and dissimilar items collide with low probability ($p_2$), LSH enables sub-linear query times. The classic Indyk-Motwani algorithm provides a query time bound of $\tilde{O}(n^\rho / p_1)$, where $\rho = \frac{\log(1/p_1)}{\log(1/p_2)}$.
However, a significant practical bottleneck exists: when $p_1$ is small—a common occurrence in high-dimensional datasets using Cosine or Jaccard similarity—the $1/p_1$ term can dominate, potentially making LSH slower than a brute-force linear scan. This paper identifies that this penalty is not a fundamental limit of hashing but rather a side effect of the "integer rounding" required when concatenating hash functions to amplify the gap between $p_1$ and $p_2$.
The High-Low Tables Method
The $1/p_1$ penalty arises because we must use an integer number of hash functions ($k$) per table. Because we cannot use a fractional number of functions, we often over-amplify, which drives the collision probability lower than necessary and forces the construction of more tables to maintain recall.
The proposed solution is LSH with High-Low Tables, an ensemble approach:
- Ensemble Construction: Instead of a single fixed $k$, the algorithm uses a mix of tables with $k = \lfloor \kappa \rfloor$ (High probability tables) and $k = \lceil \kappa \rceil$ (Low probability tables).
- Optimal Weighting: The method provides a precise formula to determine the number of each table type required to balance false positives and false negatives optimally.
- Smoothing the Gap: By mixing these table types, the algorithm effectively achieves a "fractional" amount of amplification, smoothing out the rounding error that causes the $1/p_1$ bottleneck.
Theoretical Results and Savings
The High-Low Tables method improves the query time bound to $\tilde{O}(n^\rho / p_1^{1-\rho})$. This new bound is mathematically guaranteed to be better than or equal to the traditional bound for any valid $p_1$.
When $p_1$ and $p_2$ are both small (e.g., near $1/n$), the improvement can be as large as a factor of $n$. Furthermore, because fewer tables are required to achieve the same recall, space complexity improves by the same factor. This approach provides a sub-linear query time guarantee for any collision probabilities at least $1/n$, a guarantee previously unavailable.
Practical Implications and Datasets
To demonstrate the relevance of these theoretical findings, the author analyzed the similarity distributions of several real-world datasets across various domains, including search (AOL), social networks (Orkut, Flickr), and recommendation systems (Netflix, Spotify).
The analysis confirms that in many practical scenarios, similarity values fall into ranges where $p_1$ is small enough to make the traditional $1/p_1$ factor a major performance hurdle. The High-Low Tables method offers a straightforward way to reclaim this lost performance.
Conclusion
The $1/p_1$ bottleneck in LSH is an artifact of integer rounding in hash function amplification. By employing an ensemble of High and Low tables, we can interpolate between integer states and reach the theoretical performance "sweet spot." This method is easy to implement in existing LSH libraries and offers significant improvements in both query time and memory usage. Future research may explore whether similar ensemble techniques can resolve bottlenecks in tree-based LSH methods.
Summary updated