EmbedDistill: A Geometric Knowledge Distillation for Information Retrieval

Seungyeon Kim, Ankit Singh Rawat, Manzil Zaheer, Sadeep Jayasumana, Veeranjaneyulu Sadhanala, Wittawat Jitkrittum, Aditya Krishna Menon, Rob Fergus, Sanjiv Kumar · DOI

Abstract

Modern Information Retrieval (IR) relies on large Transformer models that are computationally expensive for production deployment. While Knowledge Distillation (KD) is commonly used to compress these models, traditional score-matching techniques often fail to capture the rich semantic relationships within the embedding space. We present EmbedDistill, a novel framework that aligns the underlying embedding geometry of teacher and student models. By employing an "asymmetric" architecture—pairing a compact student query encoder with a large, frozen teacher document encoder—EmbedDistill achieves 95-97% of the performance of massive models with only 1/10th the parameters for online inference.

Introduction

Information Retrieval systems typically utilize a two-stage pipeline: a Dual-Encoder (DE) retriever for candidate generation and a Cross-Encoder (CE) re-ranker for fine-tuning. Despite their accuracy, the computational cost of these models is a significant barrier. Traditional Knowledge Distillation (KD) attempts to mitigate this by training a smaller "student" model to match the relevance scores of a "teacher." However, score-matching provides a weak signal that ignores the geometric relationships between queries and documents. This often leads to a "generalization gap" where students underperform on unseen data.

EmbedDistill addresses this by focusing on the semantic space's geometry. The core insight is that the relative positions of queries and documents in the embedding space contain significantly more information than a scalar relevance score. By aligning these spaces directly, the teacher-student generalization gap is reduced.

Methods

EmbedDistill introduces three primary innovations to improve distillation efficiency and performance:

  1. Embedding Matching: The student is trained to minimize the distance between its internal representations and the teacher’s embeddings, forcing it to learn the teacher's semantic manifold.
  2. Asymmetric Student Architectures: Since document indexing occurs offline, the student can "inherit" the teacher's large, frozen document encoder while using a tiny, fast query encoder (e.g., 4-layer BERT-mini) for real-time processing.
  3. CE to DE Distillation: To distill from powerful Cross-Encoders, which do not naturally produce separate embeddings, the authors use a "dual-pooling" strategy to extract proxy embeddings from the teacher.
  4. Task-Specific Query Generation: Synthetic queries generated by a BART model help the student explore the data manifold and align embeddings on a broader range of examples.
Architectural overview of DE to DE and CE to DE distillation processes.

Results

The framework was evaluated on Natural Questions (NQ), MSMARCO, and the BEIR benchmark for zero-shot performance.

On MSMARCO, an asymmetric student with a query encoder 1/10th the size of the teacher retained 95-97% of the teacher's performance. On the NQ dataset, the inclusion of query embedding matching and synthetic query generation significantly boosted Recall@5 for a 4-layer student compared to standard distillation.

Ablation study showing the impact of different components on retrieval performance (Recall@k).

As shown in the ablation study (Figure 2), the combination of inheriting document embeddings and query embedding matching provides substantial gains over direct training or simple score distillation. For the 4-layer model, R@5 increases from 24.8 (direct) to 61.2 (with embedding matching), eventually reaching 64.3 with query generation.

Conclusion

EmbedDistill demonstrates that geometric alignment is a superior signal for IR distillation compared to traditional score matching. The asymmetric architecture provides a "free lunch" by leveraging high-quality offline document indices without increasing online latency. While currently focused on Transformer-based NLP tasks, future work may extend these geometric principles to multi-modal settings and other architectures.

Summary updated

BibTeX
@misc{kim2023embeddistill,
  author = {Seungyeon Kim and Ankit Singh Rawat and Manzil Zaheer and Sadeep Jayasumana and Veeranjaneyulu Sadhanala and Wittawat Jitkrittum and Aditya Krishna Menon and Rob Fergus and Sanjiv Kumar},
  title = {{EmbedDistill: A Geometric Knowledge Distillation for Information Retrieval}},
  year = {2023},
  eprint = {2301.12005},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.12005},
}
Figure