Abstract
Dense retrieval overcomes the lexical gap and has shown great success in ad-hoc information retrieval (IR). Despite their success, dense retrievers are expensive to serve across practical use cases. For use cases requiring to search from millions of documents, the dense index becomes bulky and requires high memory usage for storing the index. More recently, learning-to-hash (LTH) techniques, for e.g., BPR and JPQ, produce binary document vectors, thereby reducing the memory requirement to efficiently store the dense index. LTH techniques are supervised and finetune the retriever using a ranking loss. They outperform their counterparts, i.e., traditional out-of-the-box vector compression techniques such as PCA or PQ. A missing piece from prior work is that existing techniques have been evaluated only in-domain, i.e., on a single dataset such as MS MARCO. In our work, we evaluate LTH and vector compression techniques for improving the downstream zero-shot retrieval accuracy of the TAS-B dense retriever while maintaining efficiency at inference. Our results demonstrate that, unlike prior work, LTH strategies when applied naively can underperform the zero-shot TAS-B dense retriever on average by up to 14% nDCG@10 on the BEIR benchmark. To solve this limitation, in our work, we propose an easy yet effective solution of injecting domain adaptation with existing supervised LTH techniques. We experiment with two well-known unsupervised domain adaptation techniques: GenQ and GPL. Our domain adaptation injection technique can improve the downstream zero-shot retrieval effectiveness for both BPR and JPQ variants of the TAS-B model by on average 11.5% and 8.2% nDCG@10 while both maintaining 32× memory efficiency and 14× and 2× speedup respectively in CPU retrieval latency on BEIR.
Introduction
Dense retrieval (DR) has revolutionized search by matching the semantic meaning of a query to a document. However, the operational cost of DR is significant; storing high-dimensional dense vectors for millions of documents requires substantial memory (e.g., ~65GB for 21 million passages). While Learning-to-Hash (LTH) techniques like Binary Passage Retriever (BPR) and Joint Optimization of Query Encoder and Product Quantization (JPQ) offer a solution by compressing vectors into compact binary codes, they often suffer from a "specialization trap."
Supervised hashing techniques are typically trained on a single source domain (e.g., MS MARCO). When deployed in "zero-shot" scenarios—where the model encounters a completely new domain like medical research or financial documents—their performance degrades significantly. Naive hashing can reduce retrieval accuracy by as much as 14% nDCG@10 compared to the original dense model. This work addresses this gap by integrating unsupervised domain adaptation into the hashing process.
Methodology
The proposed approach utilizes the TAS-B dense retriever as a backbone and evaluates two primary LTH techniques:
- Binary Passage Retriever (BPR): Employs a latent hash layer to generate binary codes, utilizing a two-stage retrieve-then-rerank strategy.
- Joint Optimization of Query Encoder and Product Quantization (JPQ): Jointly learns vector embeddings and quantization centroids to minimize ranking loss.
To overcome domain shift, we inject Domain Adaptation using two unsupervised methods:
- GenQ: Employs a T5 model to generate synthetic queries for target documents, creating a domain-specific training set.
- GPL (Generative Pseudo Labeling): Enhances GenQ by using a Cross-Encoder "Teacher" model to label synthetic queries. We utilize the MarginMSE loss to allow the hashing model to learn from the specific score margins provided by the teacher, rather than just binary labels.
Results and Discussion
Our evaluation on the BEIR benchmark demonstrates that domain adaptation is critical for maintaining the efficacy of compressed retrievers.
Efficiency and Accuracy Trade-offs
As shown in Figure 1, the original TAS-B model requires approximately 27GB for the MS MARCO index. LTH techniques reduce this requirement to under 1GB (a 32× reduction). While naive BPR and JPQ show a drop in average nDCG@10, the injection of GPL boosts performance significantly. Specifically, GPL improved the zero-shot accuracy of BPR by 11.5% and JPQ by 8.2% on average.
Notably, the JPQ+GPL model achieved an average nDCG@10 of 0.435, which actually outperforms the original uncompressed TAS-B model (0.415) by 2.0 points. This suggests that domain adaptation not only recovers lost performance from compression but can also enhance the underlying retriever's robustness.
Performance Across Diverse Domains
The effectiveness of these methods is consistent across the 18 diverse datasets in the BEIR benchmark, covering domains from COVID-19 research to fact-checking.
As detailed in Figure 2, the adapted models (columns with +GPL) consistently outperform their non-adapted counterparts. For instance, on TREC-COVID, JPQ+GPL reaches 0.717 nDCG@10, a substantial increase over the base JPQ (0.601) and even the original TAS-B (0.481).
Conclusion
This work demonstrates that the "bulky index" problem in dense retrieval can be solved without sacrificing zero-shot robustness. By combining Learning-to-Hash with unsupervised domain adaptation (GPL), we achieve a 32× reduction in memory usage and significant latency speedups (up to 14× for BPR) while maintaining or even exceeding the accuracy of original dense retrievers. Future work will focus on reducing the computational overhead of the GPL process and exploring more efficient "teacher" models.
Summary updated