Recent advances in multimodal retrieval-augmented generation (RAG) have increased the demand for efficient out-of-distribution (OOD) vector search, in which query and base vectors follow different distributions. Mainstream graph-based indexes perform well for in-distribution (ID) queries but often require substantially more distance computations for OOD queries to achieve the same recall. Despite using historical queries to improve graph construction, existing OOD indexes still lead to inefficient search paths. In this paper, we propose Matrix, a graph-based index that calibrates construction distances by matching the second moments of distance differences induced by base vectors and OOD queries. We derive a unique symmetric positive definite solution and prove that paired transformations preserve the original distances between queries and base vectors. To efficiently reach scattered nearest neighbors, we learn a binary tree from historical OOD queries and their nearest neighbors to quickly select suitable entry vertices. Extensive experiments on four real-world OOD datasets show that, at matched Recall@100, Matrix achieves up to 2.97x the throughput of the fastest state-of-the-art OOD index and up to 43% fewer distance computations than the baseline with the lowest count, while maintaining a modest index cost. With only 1/40 as many historical queries, Matrix outperforms all evaluated baselines on LAION.
翻译:暂无翻译