Abstract
We investigate improving the retrieval effectiveness of embedding models through the lens of corpus-specific fine-tuning. Prior work has shown that fine-tuning with queries generated using a dataset's retrieval corpus can boost retrieval effectiveness for the dataset. However, we find that surprisingly, fine-tuning using the conventional InfoNCE contrastive loss often reduces effectiveness in state-of-the-art models. To overcome this, we revisit cross-encoder listwise distillation and demonstrate that, unlike using contrastive learning alone, listwise distillation can help more consistently improve retrieval effectiveness across multiple datasets. Additionally, we show that synthesizing more training data using diverse query types (such as claims, keywords, and questions) yields greater effectiveness than using any single query type alone, regardless of the query type used in evaluation. Our findings further indicate that synthetic queries offer comparable utility to human-written queries for training. We use our approach to train an embedding model that achieves state-of-the-art effectiveness among BERT embedding models. We release our model and both query generation and training code to facilitate further research.
TL;DR
Fine-tuning state-of-the-art (SOTA) embedding models using standard contrastive loss (InfoNCE) often unexpectedly reduces their retrieval effectiveness. This paper demonstrates that combining cross-encoder listwise distillation with diverse synthetic query generation (claims, keywords, etc.) consistently improves performance, resulting in a new SOTA BERT-base retriever called cadet-embed-base-v1.
The Problem: The Limits of Contrastive Learning
Dense retrieval relies on "bi-encoders" (like BERT) to map queries and documents into a shared vector space. To adapt these models to specific domains, it is common practice to fine-tune them on synthetic queries generated from the target corpus.
The industry standard for this fine-tuning is contrastive learning (specifically the InfoNCE loss), which aims to minimize the distance between "positive" pairs while maximizing the distance to "negative" pairs. However, this study reveals a significant drawback: when high-performing SOTA models are fine-tuned on a new corpus using contrastive loss, their performance frequently degrades.
The authors posit that contrastive loss is too "binary"—it treats relevance as a 0 or 1 signal. In reality, relevance exists on a spectrum. Even with techniques like "hard-negative mining" and "denoising," contrastive learning fails to capture the nuanced relevance rankings that a more computationally intensive cross-encoder model can discern.
Proposed Methodology
The researchers introduce a two-pronged strategy to enhance fine-tuning:
- Cross-Encoder Listwise Distillation: Rather than relying on binary labels, they employ a powerful "teacher" model (a cross-encoder like RankT5) to score a list of candidate documents. The "student" bi-encoder is then trained to match the teacher’s entire probability distribution across that list using KL divergence. This allows the student to learn the relative relevance between documents, moving beyond simple binary classification.
- Diverse Synthetic Query Generation: Moving beyond simple question generation, the authors utilized Llama-3.1 8B to generate six distinct query types from 100k sampled passages: Questions, Claims, Titles, Keywords, and both Zero-shot and Few-shot natural search queries.
- Two-Stage Quality Filtering: To ensure high-quality training data, synthetic queries were only retained if the source passage appeared in the top results of a retriever and was subsequently ranked #1 by a reranker.
Key Insights
- Contrastive Loss as a Performance Ceiling: For highly optimized models like BGE or GTE, additional contrastive training can introduce noise that erodes the model's general knowledge.
- The Necessity of Continuous Signals: Even after filtering "false negatives," contrastive loss still underperformed. This suggests the issue is the loss function itself, which lacks the continuous relevance signal provided by listwise distillation.
- Diversity Over Quantity: Training on a mixture of query types (e.g., keywords, claims, and questions) proved more effective than training on any single type, enhancing the retriever's robustness to varied user search behaviors.
- Synthetic Data Parity: Head-to-head comparisons on MSMARCO showed that models trained on Llama-generated queries performed as well as, or better than, those trained on human-written queries.
Results and Impact
The resulting model, cadet-embed-base-v1, sets a new benchmark for BERT-base retrievers.
- Consistency: While contrastive fine-tuning often led to performance drops, the distillation approach yielded consistent improvements in NDCG@10 across nearly all datasets.
- SOTA Performance: On the BEIR benchmark, the distilled model (using RankT5 and Gemma teachers) achieved an average NDCG@10 of 51.3, outperforming base BGE, GTE, and Arctic models.
- Efficiency: By utilizing a BERT-base architecture (110M parameters), the model provides high accuracy while remaining computationally efficient for production environments.
Limitations and Future Work
While successful, the study identifies several areas for further exploration. The current focus was on BERT-base models; applying these distillation techniques to larger LLM-based embedding models is a logical next step. Additionally, while the underlying LLMs are multilingual, this research focused on English-language effectiveness. Finally, the student model's performance is inherently limited by the teacher's capabilities; if the cross-encoder teacher struggles in a niche domain (e.g., highly technical legal text), the distilled student will likely reflect those limitations.
The model and code are available on Hugging Face and GitHub.
Summary updated