NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation

Sebastian Hofstätter, Sophia Althammer, Michael Schröder, Mete Sertkan, Allan HanburyarXiv 2020

In the world of Information Retrieval (IR), we are constantly battling a trade-off: do we want results that are incredibly accurate, or do we want them now? State-of-the-art neural ranking models like $BERT_{CAT}$ (which processes a query and a document together through all layers of a Transformer) are highly effective but prohibitively slow for real-time production use. Conversely, efficient architectures designed for speed often suffer from a significant "effectiveness gap."

This paper from researchers at TU Wien introduces a novel way to bridge this gap using Cross-Architecture Knowledge Distillation.

TL;DR

The authors propose Margin-MSE, a model-agnostic loss function for knowledge distillation that allows efficient student rankers to learn from powerful teacher models, regardless of their architectural differences. By focusing on the margin between document scores rather than raw score values, they significantly boost the effectiveness of fast models like ColBERT and $BERT_{DOT}$, sometimes even surpassing the original teacher's performance while maintaining sub-millisecond latencies.

What Problem Does This Paper Address?

Knowledge Distillation (KD) is a common technique where a large "teacher" model trains a smaller "student" model to mimic its behavior. However, in ranking tasks, different architectures naturally gravitate toward different output score ranges.

As shown in Figure 1, a $BERT_{CAT}$ model might output scores centered around zero, while a dot-product model like ColBERT produces much higher positive magnitudes, and a Transformer-Kernel (TK) model stays mostly negative.

Figure 1: Raw query-passage pair scores during training of different ranking models. The margin between the positive and negative samples is shaded.

Standard KD methods that try to force a student to match the teacher's raw pointwise scores fail because they fight against the student's natural architectural tendencies. The authors needed a way to transfer the teacher's ranking logic without forcing it into a specific score distribution.

Methods

The core innovation is the Margin-MSE loss. Instead of teaching the student to predict a specific score for a document, the authors teach the student to predict the same score difference (margin) between a relevant document ($p^+$) and a non-relevant one ($p^-$) as the teacher.

The loss function is defined as: $$\mathcal{L}(Q, P^+, P^-) = MSE(score_s(Q, P^+) - score_s(Q, P^-), score_t(Q, P^+) - score_t(Q, P^-))$$

This approach is architecture-agnostic. The student can stay in its "comfortable" score range as long as it learns the relative preferences of the teacher.

The authors also utilized a Teacher Ensemble. They trained three different large models (BERT-Base, BERT-Large, and ALBERT) and averaged their margins to provide a more robust and diverse signal to the students. The training process is a clean, three-step pipeline:

  1. Train the heavy teacher(s).
  2. Use the teacher(s) to pre-calculate and store scores for all training triples.
  3. Train various efficient student architectures (TK, ColBERT, PreTT, $BERT_{DOT}$) using the Margin-MSE loss against those stored scores.
Figure 2: Our knowledge distillation process, re-visiting the same training triples in all steps: ➊Training the BERTCAT model; ➋Using the trained BERTCAT to create scores for all training triples; ➌Individually training the student models with Margin- MSE using the teacher scores.

Datasets

The models were trained and evaluated on:

  • MSMARCO-Passage: A large-scale dataset based on Bing queries, containing 8.8 million passages and 40 million training triples.
  • TREC-DL’19: A densely-judged query set used for evaluating the generalization of the models.

Key Insights and Ideas

  • Margins are the Universal Language of Ranking: Raw scores are arbitrary and architecture-dependent, but the relative distance between a "good" and "bad" result is a fundamental signal that can be transferred across very different neural designs.
  • Teacher Diversity Matters: Figure 5 shows that different teacher architectures (even within the BERT family) produce different margin distributions. Combining them into an ensemble provides a "richer" curriculum for the student.
  • Closing the Gap (and then some): The most striking insight is that distilled efficient models don't just get closer to the teacher; in several metrics, distilled students like ColBERT and PreTT actually outperformed the $BERT_{CAT}$ baseline they were meant to emulate.
Figure 5: Distribution of the margins between relevant and non-relevant documents of the three teacher models on MS MARCO-Passage training data

Key Results

The results show a dramatic shift in the efficiency-effectiveness trade-off curve.

  • Effectiveness Gains: On MSMARCO-DEV, the distilled ColBERT student improved its nDCG@10 from .417 (baseline) to .436 (with ensemble distillation).
  • Latency vs. Accuracy: Figures 3 and 4 visualize this shift. Distilled models move "up and to the left," providing higher accuracy at much lower latencies. For example, distilled ColBERT achieves higher nDCG than the $BERT_{CAT}$ teacher while being roughly 30x faster.
  • Dense Retrieval: The method also proved highly effective for $BERT_{DOT}$ models used in dense nearest-neighbor retrieval, producing results competitive with much more complex and computationally expensive training methods like ANCE or RocketQA.
Figure 3: Query latency vs. nDCG@10 on TREC’19

Limitations and Future Work

  • Storage Requirements: While models like ColBERT are fast, they require significant storage for pre-computed passage representations (up to 2TB for a large collection), which might be a bottleneck for some production environments.
  • Extreme Changes: Per-query analysis (Figure 6) showed that while the ensemble teacher (T2) is better on average, it can lead to more "extreme" results—improving queries more significantly but also occasionally causing larger decreases compared to a single teacher.
  • Future Directions: The authors suggest combining this distillation approach with other training adaptations like curriculum learning or dynamic index sampling for end-to-end neural retrieval.

The researchers have released their teacher-score training files and source code to the community, making it easier for others to deploy these high-performance, efficient rankers.

Summary updated

BibTeX
@misc{hofstatter2020improving,
  author = {Sebastian Hofstätter and Sophia Althammer and Michael Schröder and Mete Sertkan and Allan Hanbury},
  title = {{Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation}},
  year = {2020},
  eprint = {2010.02666},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.02666},
}
Figure