Learning Effective Representations for Retrieval Using Self-Distillation with Adaptive Relevance Margins

Lukas Gienapp, Niklas Deckers, Martin Potthast, Harrisen ScellsarXiv 2024 · DOI

TL;DR

This paper introduces a self-distillation training method for bi-encoder retrieval models that eliminates the need for expensive cross-encoder "teacher" models and complex batch sampling. By using a novel, parameter-free loss function with Adaptive Relevance Margins, the authors achieve state-of-the-art effectiveness while using only 13.5% of the training data and speeding up training by 3x to 15x.

What Problem Does This Paper Address?

In modern information retrieval, bi-encoders (like DPR or Sentence-BERT) are the gold standard for efficiency because they allow for pre-computing document embeddings. However, to make them highly effective, they are typically trained using knowledge distillation. This involves a "teacher" model (usually a computationally heavy cross-encoder) scoring millions of query-document pairs to provide a supervision signal for the "student" bi-encoder.

This standard regime has three major drawbacks:

  1. High Cost: It requires an expensive forward pass of a cross-encoder for every training sample.
  2. Complexity: It relies on sophisticated batch sampling (like TAS-B) to find "hard negatives"—documents that are similar to the query but not relevant—which is crucial for learning.
  3. Static Data: These methods often require a static dataset, making them difficult to adapt to online learning-to-rank scenarios where data arrives continuously.

The authors aim to simplify this process by letting the model learn from its own internal representations, effectively "teaching itself" without an external supervisor.

Methods

The core innovation is the Adaptive Relevance Margin loss.

Standard triplet loss uses a static margin ($\epsilon$), forcing the model to separate positive and negative documents by a fixed distance. The authors propose replacing this fixed $\epsilon$ with a value derived from the model's own pre-trained language modeling capabilities.

Figure 1: Conceptual overview of a typical bi-encoder teacher distillation training regime (left) and our proposed self- distillation approach (right). Blue is the data, green is the bi-encoder and purple is the cross-encoder model.

They iterate through three variants:

  • Static Targets: The traditional approach using a fixed hyperparameter $\epsilon$.
  • Adaptive Targets: The margin is set per-triplet based on the similarity between the positive and negative document. If the documents are very similar, the margin becomes larger, forcing the model to work harder to distinguish them. This performs implicit hard negative mining.
  • Distributed Targets: This extends the adaptive approach to the entire batch. Instead of one target, it uses the distribution of similarities across all in-batch negatives to estimate the ideal margin.
Conceptual illustration of how different target variants shift documents in the latent space.

Datasets

  • Training: The MSMARCO-Passage collection, containing roughly 40 million training triplets.
  • Evaluation (In-Domain): TREC-DL 19 and TREC-DL 20, which provide high-quality, dense relevance judgments.
  • Evaluation (Zero-Shot): The BEIR benchmark, a suite of 14 diverse retrieval datasets (e.g., BioASQ, FiQA, Touche-2020) used to test how well the model generalizes to unseen domains.

Key Insights and Ideas

  • Pre-trained Knowledge is Enough: The authors demonstrate that BERT-style models already possess strong text similarity capabilities from their pre-training phase. We don't need a cross-encoder to tell a bi-encoder that two documents are similar; the bi-encoder already "knows."
  • Implicit Mining beats Explicit Sampling: By scaling the loss based on document similarity, the model naturally focuses on the most informative (hardest) examples. This removes the need for complex clustering or sampling strategies like TAS-B.
  • Hyperparameter-Free Training: The "Distributed Targets" variant is robust and doesn't require tuning a margin parameter, which usually varies wildly depending on the specific model and task.
  • Data Efficiency: The self-distillation signal is so dense and informative that the model converges much faster, requiring significantly fewer training triplets to reach peak performance.

Key Results

  • Efficiency: The proposed method matches the effectiveness of state-of-the-art teacher distillation while using only 13.5% of the training data.
  • Speed: Training time is reduced by 3x to 15x compared to methods requiring hyperparameter sweeps or teacher inference.
  • Performance: On TREC-DL 20, the distributed self-distillation approach achieved an nDCG@10 of 0.622, which is statistically equivalent to the best-performing teacher-distilled models in reproduction studies.
  • Zero-Shot: On the BEIR benchmark, the model outperformed standard dense retrievers like DPR and matched the performance of more complex models like ANCE, despite the much lower training cost.

Limitations and Future Work

  • Zero-Shot Gap: While competitive, there is still a small performance gap (approx. 0.09 nDCG) compared to the very best teacher-based methods in zero-shot settings. The authors suggest that cross-encoders might still capture some nuance that self-distillation misses when generalizing to entirely new domains.
  • Overfitting: The authors noted that effectiveness can decline if training continues too long after the peak, necessitating an early-stopping criterion.
  • Beyond Text: The authors suggest this approach could be transferred to other modalities, such as image or music retrieval, where high-quality teacher models might not even exist.

Summary updated

BibTeX
@misc{gienapp2024learning,
  author = {Lukas Gienapp and Niklas Deckers and Martin Potthast and Harrisen Scells},
  title = {{Learning Effective Representations for Retrieval Using Self-Distillation with Adaptive Relevance Margins}},
  year = {2024},
  eprint = {2407.21515},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.21515},
}
Figure