Clustering-based nearest neighbor search is an effective method in which points are partitioned into geometric shards to form an index, with only a few shards searched during query processing to find a set of top-$k$ vectors. Even though the search efficacy is heavily influenced by the algorithm that identifies the shards to probe, it has received little attention in the literature. This work bridges that gap by studying routing in clustering-based maximum inner product search. We unpack existing routers and notice the surprising contribution of optimism. We then take a page from the sequential decision making literature and formalize that insight following the principle of ``optimism in the face of uncertainty.'' In particular, we present a framework that incorporates the moments of the distribution of inner products within each shard to estimate the maximum inner product. We then present an instance of our algorithm that uses only the first two moments to reach the same accuracy as state-of-the-art routers such as ScaNN by probing up to $50\%$ fewer points on benchmark datasets. Our algorithm is also space-efficient: we design a sketch of the second moment whose size is independent of the number of points and requires $\mathcal{O}(1)$ vectors per shard.
翻译:基于聚类的最近邻搜索是一种有效方法,其将数据点划分为几何分片以构建索引,在查询处理时仅搜索少数分片即可找到一组 top-$k$ 向量。尽管搜索效果很大程度上取决于确定待探查分片的算法,但该问题在文献中鲜少受到关注。本研究通过探究基于聚类的最大内积搜索中的路由机制来填补这一空白。我们剖析了现有路由器的设计,并注意到乐观策略的意外贡献。随后,我们借鉴序列决策理论的研究思路,依据“面对不确定性保持乐观”的原则对该洞见进行形式化。具体而言,我们提出了一个框架,该框架通过纳入每个分片内积分布的矩来估计最大内积值。进而提出算法的一个实例,该实例仅使用前两阶矩即可达到与 ScaNN 等先进路由器相当的精度,同时在基准数据集上探查的点数减少高达 $50\%$。我们的算法还具有空间高效性:我们设计了二阶矩的草图表示,其尺寸与数据点数量无关,且每个分片仅需 $\mathcal{O}(1)$ 个向量。