Faster and space efficient indexing for locality sensitive hashing

IF 0.9 4区 计算机科学 Q3 COMPUTER SCIENCE, THEORY & METHODS
Bhisham Dev Verma , Rameshwar Pratap
{"title":"Faster and space efficient indexing for locality sensitive hashing","authors":"Bhisham Dev Verma ,&nbsp;Rameshwar Pratap","doi":"10.1016/j.tcs.2025.115479","DOIUrl":null,"url":null,"abstract":"<div><div>This work suggests faster and space-efficient index construction algorithms for LSH for Euclidean distance (<em>a.k.a.</em> E2LSH) and cosine similarity (<em>a.k.a.</em> 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 <em>m</em>-dimensional hashcode of the <em>d</em>-dimensional data point, these LSHs first project the data point onto a <em>d</em>-dimensional random Gaussian vector and then discretise the resulting inner product. The time and space complexity of both E2LSH and SRP for computing an <em>m</em>-sized hashcode of a <em>d</em>-dimensional vector is <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mi>d</mi><mo>)</mo></math></span>, which becomes impractical for large values of <em>m</em> and <em>d</em>. To overcome this problem, we propose two alternative LSH hashcode generation algorithms both for Euclidean distance and cosine similarity, namely, CS-E2LSH, HCS-E2LSH and CS-SRP, HCS-SRP, respectively. CS-E2LSH and CS-SRP are based on count sketch <span><span>[1]</span></span> and HCS-E2LSH and HCS-SRP utilize higher-order count sketch <span><span>[2]</span></span>. These proposals significantly reduce the hashcode computation time from <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mi>d</mi><mo>)</mo></math></span> to <span><math><mi>O</mi><mo>(</mo><mi>d</mi><mo>)</mo></math></span>. Additionally, both CS-E2LSH and CS-SRP reduce the space complexity from <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mi>d</mi><mo>)</mo></math></span> to <span><math><mi>O</mi><mo>(</mo><mi>d</mi><mo>)</mo></math></span>; and HCS-E2LSH, HCS-SRP reduce the space complexity from <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mi>d</mi><mo>)</mo></math></span> to <span><math><mi>O</mi><mo>(</mo><mi>N</mi><mroot><mrow><mi>d</mi></mrow><mrow><mi>N</mi></mrow></mroot><mo>)</mo></math></span> respectively, where <span><math><mi>N</mi><mo>≥</mo><mn>1</mn></math></span> 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.</div></div>","PeriodicalId":49438,"journal":{"name":"Theoretical Computer Science","volume":"1055 ","pages":"Article 115479"},"PeriodicalIF":0.9000,"publicationDate":"2025-07-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theoretical Computer Science","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0304397525004177","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0

Abstract

This work suggests faster and space-efficient index construction algorithms for LSH for Euclidean distance (a.k.a. E2LSH) and cosine similarity (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 E2LSH 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, CS-E2LSH, HCS-E2LSH and CS-SRP, HCS-SRP, respectively. CS-E2LSH and CS-SRP are based on count sketch [1] and HCS-E2LSH and HCS-SRP utilize higher-order count sketch [2]. These proposals significantly reduce the hashcode computation time from O(md) to O(d). Additionally, both CS-E2LSH and CS-SRP reduce the space complexity from O(md) to O(d); and HCS-E2LSH, HCS-SRP reduce the space complexity from O(md) to O(NdN) respectively, where N1 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.
对位置敏感的散列进行更快和空间有效的索引
这项工作提出了欧几里得距离(E2LSH)和余弦相似度(SRP)的LSH更快和更节省空间的索引构建算法。这些lsh的索引构建步骤依赖于根据散列码将数据点分组到几个散列表中。为了生成d维数据点的m维哈希码,这些lsh首先将数据点投影到d维随机高斯向量上,然后离散得到的内积。E2LSH和SRP用于计算d维向量的m大小的哈希码的时间和空间复杂度都是O(md),对于m和d的大值来说,这变得不切实际。为了克服这个问题,我们提出了两种用于欧几里得距离和余弦相似度的LSH哈希码生成算法,分别是CS-E2LSH, HCS-E2LSH和CS-SRP, HCS-SRP。CS-E2LSH和CS-SRP基于计数草图[1],HCS-E2LSH和HCS-SRP使用高阶计数草图[2]。这些建议显著地将哈希码计算时间从0 (md)减少到0 (d)。此外,CS-E2LSH和CS-SRP都将空间复杂度从0 (md)降低到O(d);HCS-E2LSH、HCS-SRP分别将空间复杂度从0 (md)降低到O(NdN),其中N≥1表示输入/重塑张量的大小。我们的建议得到了强大的数学保证的支持,我们通过对各种现实世界数据集的模拟来验证它们的性能。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Theoretical Computer Science
Theoretical Computer Science 工程技术-计算机:理论方法
CiteScore
2.60
自引率
18.20%
发文量
471
审稿时长
12.6 months
期刊介绍: Theoretical Computer Science is mathematical and abstract in spirit, but it derives its motivation from practical and everyday computation. Its aim is to understand the nature of computation and, as a consequence of this understanding, provide more efficient methodologies. All papers introducing or studying mathematical, logic and formal concepts and methods are welcome, provided that their motivation is clearly drawn from the field of computing.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信