Approximate Nearest-Neighbor Search (ANNS) efficiently finds data items whose embeddings are close to that of a given query in a high-dimensional space, aiming to balance accuracy with speed. Used in recommendation systems, image and video retrieval, natural language processing, and retrieval-augmented generation (RAG), ANNS algorithms such as IVFPQ, HNSW graphs, Annoy, and MRPT utilize graph, tree, clustering, and quantization techniques to navigate large vector spaces. Despite this progress, ANNS systems spend up to 99% of query time to compute distances in their final refinement phase. In this paper, we present PANORAMA, a machine learning-driven approach that tackles the ANNS verification bottleneck through data-adaptive learned orthogonal transforms that facilitate the accretive refinement of distance bounds. Such transforms compact over 90% of signal energy into the first half of dimensions, enabling early candidate pruning with partial distance computations. We integrate PANORAMA into state-of-the-art ANNS methods, namely IVFPQ/Flat, HNSW, MRPT, and Annoy, without index modification, using level-major memory layouts, SIMD-vectorized partial distance computations, and cache-aware access patterns. Experiments across diverse datasets -- from image-based CIFAR-10 and GIST to modern embedding spaces including OpenAI's Ada 2 and Large 3 -- demonstrate that PANORAMA affords a 2--30$\times$ end-to-end speedup with no recall loss.
翻译:近似最近邻搜索(ANNS)旨在高效地查找高维空间中嵌入向量与给定查询向量相近的数据项,力求在精度与速度之间取得平衡。ANNS算法(如IVFPQ、HNSW图、Annoy和MRPT)通过图结构、树结构、聚类和量化等技术在大规模向量空间中进行导航,广泛应用于推荐系统、图像视频检索、自然语言处理以及检索增强生成(RAG)等领域。尽管已有显著进展,现有ANNS系统在最终精炼阶段仍需消耗高达99%的查询时间用于距离计算。本文提出PANORAMA——一种机器学习驱动的方法,通过数据自适应的学习正交变换来解决ANNS验证瓶颈,该变换能够促进距离界限的累积式精炼。此类变换可将超过90%的信号能量压缩至前半数维度,从而通过部分距离计算实现早期候选剪枝。我们将PANORAMA无缝集成到最先进的ANNS方法(包括IVFPQ/Flat、HNSW、MRPT和Annoy)中,无需修改索引结构,采用层级主序内存布局、SIMD向量化的部分距离计算以及缓存感知访问模式。在多样化数据集(从基于图像的CIFAR-10和GIST到现代嵌入空间,包括OpenAI的Ada 2和Large 3)上的实验表明,PANORAMA能够在保持召回率不变的前提下,实现2-30$\times$的端到端加速。