Lune

ICLR2024Top-tier venue

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 Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • RocketQAv2: A Joint Training Method for Dense Passage Retrieval and Passage Re-ranking cites Scalable Zero-shot Entity Linking with Dense Entity Retrieval
  • Relevance-Based Embeddings: Lightweight Candidate Retrieval via Heavy-Ranker Calls cites Scalable Zero-shot Entity Linking with Dense Entity Retrieval
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. MVGPT: Generative Materialized View ForecastingYue Han, Guoliang Li, Wenchun Xu, Xianglei Ran et al.ICDE 2026
  2. Relevance-Based Embeddings: Lightweight Candidate Retrieval via Heavy-Ranker CallsKirill Shevkunov, Andrey Ploskonosov, Liudmila ProkhorenkovaICML 2026

Builds on18

  1. Accelerating Large-Scale Inference with Anisotropic Vector QuantizationRuiqi Guo, Philip Sun, Erik Lindgren, Quan Geng et al.ICML 2020 · 539 citations
  2. A Comprehensive Survey and Experimental Comparison of Graph-Based Approximate Nearest Neighbor SearchMengzhao Wang, Xiaoliang Xu, Qiang Yue, Yuxiang WangVLDB 2021 · 354 citations
  3. Scalable Zero-shot Entity Linking with Dense Entity RetrievalLedell Wu, Fabio Petroni, Martin Josifoski, Sebastian Riedel et al.EMNLP 2020 · 336 citations
  4. 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
  5. 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

  1. Efficient Nearest Neighbor Search for Cross-Encoder Models using Matrix FactorizationNishant Yadav, Nicholas Monath, Rico Angell, Manzil Zaheer et al.EMNLP 2022 · 4 citations
  2. Efficient k-NN Search with Cross-Encoders using Adaptive Multi-Round CUR DecompositionNishant Yadav, Nicholas Monath, Manzil Zaheer, Andrew McCallumEMNLP Findings 2023
  3. Thinking Fast and Slow: Efficient Text-to-Visual Retrieval With TransformersAntoine Miech, Jean-Baptiste Alayrac, Ivan Laptev, Josef Sivic et al.CVPR 2021
  4. In defense of dual-encoders for neural rankingAditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Seungyeon Kim et al.ICML 2022 · 29 citations
  5. 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
Dusk over the sea between two cliffs drawn in fine vertical lines