arXiv:2503.06737cs.DScs.LG2025-03被引 1

提出新型LSH算法,大幅提速并节省内存,适用于大规模向量检索。

Faster and Space Efficient Indexing for Locality Sensitive Hashing

  • 基于计数草图改进哈希码生成,将时间复杂度从O(md)降至O(d)
  • 新方法在真实数据集上验证,支持高维大容量数据快速索引
  • 适合需要高效向量搜索的推荐系统与相似性计算场景

本文针对欧氏距离(ELSH)和余弦相似度(SRP)的局部敏感哈希(LSH)索引构建问题,提出更快速、更省空间的算法。传统方法生成m维哈希码需O(md)时间与空间,当维度d或哈希长度m较大时效率低下。本文提出 exttt{CSELSH}、 exttt{HCSELSH}用于欧氏距离, exttt{CSSRP}、 exttt{HCSSRP}用于余弦相似度,分别基于计数草图及其高阶变体。这些方法将哈希码计算时间降为O(d),同时 exttt{CSELSH}与 exttt{CSSRP}将空间复杂度从O(md)降至O(d), exttt{HCSELSH}与 exttt{HCSSRP}进一步降至O(N imes oot N floor d),其中N≥1为输入张量的重塑尺寸。所有方法均有严格数学保证,并在多个真实数据集上通过仿真验证性能。

原文摘要 · Abstract (English)

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 $m$-dimensional hashcode of the $d$-dimensional data point, these LSHs first project the data point onto a $d$-dimensional random Gaussian vector and then discretise the resulting inner product. The time and space complexity of both \ELSH~and \SRP~for computing an $m$-sized hashcode of a $d$-dimensional vector is $O(md)$, which becomes impractical for large values of $m$ and $d$. 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)$ to $O(d)$. Additionally, both \CSELSH~and \CSSRP~reduce the space complexity from $O(md)$ to $O(d)$; ~and \HCSELSH, \HCSSRP~ reduce the space complexity from $O(md)$ to $O(N \sqrt[N]{d})$ respectively, where $N\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.

LSH向量检索高效算法降维

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。