Adaptive Retrieval and Scalable Indexing for k-NN Search with Cross-Encoders
Nishant Yadav, Nicholas Monath, Manzil Zaheer, Rob Fergus, Andrew McCallum
Abstract
Cross-encoder (CE) models which compute similarity by jointly encoding a query-item pair perform better than using dot-product with embedding-based models (dual-encoders) at estimating query-item relevance. Existing approaches perform k-NN search with cross-encoders by approximating the CE similarity with a vector embedding space fit either with dual-encoders (DE) or CUR matrix factorization. DE-based retrieve-and-rerank approaches suffer from poor recall as DE generalizes poorly to new domains and the test-time retrieval with DE is decoupled from the CE. While CUR-based approaches can be more accurate than the DE-based retrieve-and-rerank approach, such approaches require a prohibitively large number of CE calls to compute item embeddings, thus making it impractical for deployment at scale. In this paper, we address these shortcomings with our proposed sparse-matrix factorization based method that efficiently computes latent query and item representations to approximate CE scores and performs k-NN search with the approximate CE similarity. In an offline indexing stage, we compute item embeddings by factorizing a sparse matrix containing query-item CE scores for a set of train queries. Our method produces a high-quality approximation while requiring only a fraction of CE similarity calls as compared to CUR-based methods, and allows for leveraging DE models to initialize the embedding space while avoiding compute-and resource-intensive finetuning of DE via distillation. At test time, we keep item embeddings fixed and perform retrieval over multiple rounds, alternating between a) estimating the test query embedding by minimizing error in approximating CE scores of items retrieved thus far, and b) using the updated test query embedding for retrieving more items in the next round. Our proposed k-NN search method can achieve up to 5% and 54% improvement in k-NN recall for k = 1 and 100 respectively over the widely-used DE-based retrieve-and-rerank approach. Furthermore, our proposed approach to index the items by aligning item embeddings with the CE achieves up to 100× and 5× speedup over CUR-based and dual-encoder distillation based approaches respectively while matching or improving k-NN search recall over baselines.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e498cd58-bd1c-4042-9c70-66b0543fa7feCited by top-tier papers2
- MVGPT: Generative Materialized View ForecastingYue Han, Guoliang Li, Wenchun Xu, Xianglei Ran et al.ICDE 2026
- Relevance-Based Embeddings: Lightweight Candidate Retrieval via Heavy-Ranker CallsKirill Shevkunov, Andrey Ploskonosov, Liudmila ProkhorenkovaICML 2026
Builds on16
- Accelerating Large-Scale Inference with Anisotropic Vector QuantizationRuiqi Guo, Philip Sun, Erik Lindgren, Quan Geng et al.ICML 2020 · 539 citations
- A Comprehensive Survey and Experimental Comparison of Graph-Based Approximate Nearest Neighbor SearchMengzhao Wang, Xiaoliang Xu, Qiang Yue, Yuxiang WangVLDB 2021 · 354 citations
- Scalable Zero-shot Entity Linking with Dense Entity RetrievalLedell Wu, Fabio Petroni, Martin Josifoski, Sebastian Riedel et al.EMNLP 2020 · 336 citations
- RocketQAv2: A Joint Training Method for Dense Passage Retrieval and Passage Re-rankingRuiyang Ren, Yingqi Qu, Jing Liu, Wayne Xin Zhao et al.EMNLP 2021 · 147 citations
- Training Data is More Valuable than You Think: A Simple and Effective Method by Retrieving from Training DataShuohang Wang, Yichong Xu, Yuwei Fang, Yang Liu et al.ACL 2022 · 115 citations
Related papers
- Efficient Nearest Neighbor Search for Cross-Encoder Models using Matrix FactorizationNishant Yadav, Nicholas Monath, Rico Angell, Manzil Zaheer et al.EMNLP 2022 · 4 citations
- Thinking Fast and Slow: Efficient Text-to-Visual Retrieval With TransformersAntoine Miech, Jean-Baptiste Alayrac, Ivan Laptev, Josef Sivic et al.CVPR 2021
- In defense of dual-encoders for neural rankingAditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Seungyeon Kim et al.ICML 2022 · 29 citations
- Improving the Accuracy of Dense Retrieval on the Quantized Indexes via Gradient Optimization of the Target EmbeddingsCong Tan, Yongqi Shao, Hong Huo, Tao FangAAAI 2026
- USTAD: Unified Single-model Training Achieving Diverse Scores for Information RetrievalSeungyeon Kim, Ankit Singh Rawat, Manzil Zaheer, Wittawat Jitkrittum et al.ICML 2024 · 3 citations
