English

Faster and Space Efficient Indexing for Locality Sensitive Hashing

Data Structures and Algorithms 2025-07-18 v2 Machine Learning

Abstract

This work suggests faster and space-efficient index construction algorithms for LSH for Euclidean distance (\textit{a.k.a.}~\ELSH) and cosine similarity (\textit{a.k.a.}~\SRP). The index construction step of these LSHs relies on grouping data points into several bins of hash tables based on their hashcode. To generate an mm-dimensional hashcode of the dd-dimensional data point, these LSHs first project the data point onto a dd-dimensional random Gaussian vector and then discretise the resulting inner product. The time and space complexity of both \ELSH~and \SRP~for computing an mm-sized hashcode of a dd-dimensional vector is O(md)O(md), which becomes impractical for large values of mm and dd. To overcome this problem, we propose two alternative LSH hashcode generation algorithms, both for Euclidean distance and cosine similarity, namely, \CSELSH, \HCSELSH~and \CSSRP, \HCSSRP, respectively. \CSELSH~and \CSSRP~are based on count sketch \cite{count_sketch} and \HCSELSH~and \HCSSRP~utilize higher-order count sketch \cite{shi2019higher}. These proposals significantly reduce the hashcode computation time from O(md)O(md) to O(d)O(d). Additionally, both \CSELSH~and \CSSRP~reduce the space complexity from O(md)O(md) to O(d)O(d); ~and \HCSELSH, \HCSSRP~ reduce the space complexity from O(md)O(md) to O(NdN)O(N \sqrt[N]{d}) respectively, where N1N\geq 1 denotes the size of the input/reshaped tensor. Our proposals are backed by strong mathematical guarantees, and we validate their performance through simulations on various real-world datasets.

Keywords

Cite

@article{arxiv.2503.06737,
  title  = {Faster and Space Efficient Indexing for Locality Sensitive Hashing},
  author = {Bhisham Dev Verma and Rameshwar Pratap},
  journal= {arXiv preprint arXiv:2503.06737},
  year   = {2025}
}
R2 v1 2026-06-28T22:13:06.298Z