基于角度多索引散列的二进制空间快速余弦相似性搜索
Fast Cosine Similarity Search in Binary Space with Angular Multi-index Hashing
摘要:
给定一个大的数据集的二进制代码和一个二进制查询点,我们解决如何有效地找到$K$代码的数据集,产生最大的余弦相似的查询。这个问题的直接答案是将查询与数据集中的所有项进行比较,但这只适用于小数据集。一种增强搜索时间并实现次线性成本的潜在解决方案是使用填充有数据集的二进制代码的哈希表,然后查找查询的附近桶以检索最近的邻居。然而,如果代码在余弦相似性而不是汉明距离方面进行比较,则主要问题是要探测的桶的顺序不明显。为了研究这个问题,我们首先详细说明汉明距离和余弦相似性之间的联系。这样做允许我们系统地在哈希表中找到探测序列。然而,用单个表解决最近邻搜索仅对短二进制码是实用的。为了解决这个问题,我们提出了角度多索引哈希搜索算法,它依赖于建立多个哈希表的二进制代码子串。所提出的搜索算法解决了精确的角度$K$最近邻问题的时间,往往是数量级快于线性扫描基线,甚至近似方法。
英文摘要:
Given a large dataset of binary codes and a binary query point, we address how to efficiently find $K$ codes in the dataset that yield the largest cosine similarities to the query. The straightforward answer to this problem is to compare the query with all items in the dataset, but this is practical only for small datasets. One potential solution to enhance the search time and achieve sublinear cost is to use a hash table populated with binary codes of the dataset and then look up the nearby buckets to the query to retrieve the nearest neighbors. However, if codes are compared in terms of cosine similarity rather than the Hamming distance, then the main issue is that the order of buckets to probe is not evident. To examine this issue, we first elaborate on the connection between the Hamming distance and the cosine similarity. Doing this allows us to systematically find the probing sequence in the hash table. However, solving the nearest neighbor search with a single table is only practical for short binary codes. To address this issue, we propose the angular multi-index hashing search algorithm which relies on building multiple hash tables on binary code substrings. The proposed search algorithm solves the exact angular $K$ nearest neighbor problem in a time that is often orders of magnitude faster than the linear scan baseline and even approximation methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。