Abstract
Dense retrieval overcome 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$\times$ memory efficiency and 14$\times$ and 2$\times$ speedup respectively in CPU retrieval latency on BEIR.
Introduction
Dense retrieval has revolutionized information retrieval by overcoming the lexical gap through neural embeddings. However, deploying these models at scale introduces a significant "memory tax." Storing high-dimensional floating-point vectors for millions of documents requires substantial RAM, often exceeding the capacity of standard hardware. For example, an index for 21 million passages can require upwards of 65GB of memory.
To mitigate this, researchers have turned to Learning-to-Hash (LTH) techniques, such as Binary Passage Retriever (BPR) and Joint Product Quantization (JPQ), which compress vectors into compact binary codes. While effective in-domain (e.g., on MS MARCO), these models often struggle in "zero-shot" scenarios. When applied to new domains like medical or legal documents, their accuracy can drop by as much as 14% compared to uncompressed models. This paper addresses this brittleness by proposing the injection of unsupervised domain adaptation into the LTH training pipeline.
Methodology
The authors utilize TAS-B, a robust and generalizable dense retriever, as the base model. They explore two primary strategies for injecting domain adaptation into LTH:
- LTH Baselines (BPR & JPQ): The TAS-B model is converted into compressed versions using supervised ranking losses. BPR focuses on binary hashing, while JPQ utilizes quantized centroids.
- GenQ Injection: A pre-trained T5 model generates synthetic questions for documents in the target domain. The LTH model is then fine-tuned on these synthetic query-document pairs.
- GPL (Generative Pseudo Labeling) Injection: A more advanced approach where synthetic queries are scored by a "Teacher" model (a Cross-Encoder). This provides a cleaner training signal via the MarginMSE loss, helping the model learn relative relevance scores in the target domain.
Experimental Results
The effectiveness of these methods was evaluated using the BEIR benchmark, which consists of 18 diverse datasets. The results highlight a clear Pareto frontier between index size and retrieval accuracy.
Efficiency and Effectiveness
As shown in Figure 1, standard LTH techniques significantly reduce the index size (from ~27GB for TAS-B to <1GB) but often at the cost of accuracy. However, injecting GPL adaptation allows these compressed models to recover and even surpass the original model's performance. Specifically, JPQ+GPL achieves a higher average nDCG@10 than the uncompressed TAS-B baseline while maintaining a 32× reduction in memory.
Zero-Shot Performance Across Domains
The detailed breakdown across the 18 BEIR datasets confirms the robustness of the proposed approach.
Key findings from the data include:
- Accuracy Boost: GPL injection improved the zero-shot accuracy of BPR by 11.5% and JPQ by 8.2% on average.
- JPQ Robustness: JPQ generally handles domain shifts better than BPR, even without adaptation.
- Superiority over Baselines: The JPQ+GPL model reached an average nDCG@10 of 0.435, outperforming the original TAS-B model's 0.415.
- Inference Speed: Beyond memory savings, BPR achieved a 14× speedup and JPQ a 2× speedup in CPU retrieval latency.
Discussion and Conclusion
This work demonstrates that the perceived trade-off between efficiency and zero-shot effectiveness in dense retrieval is not insurmountable. By "injecting" domain knowledge through synthetic data generation and pseudo-labeling, LTH models can be made both extremely compact and highly accurate across diverse domains.
While the current approach requires domain-specific adaptation (one model per domain) and involves computationally intensive training for GPL, it sets a new standard for efficient, high-performance retrieval. Future work may explore more efficient adaptation processes or even stronger base models to further push the boundaries of zero-shot dense retrieval.
Summary updated