Abstract
State-of-the-art sentence embeddings are currently dominated by massive Pretrained Language Models (PLMs) like the 11-billion-parameter Sentence-T5. While highly effective, these models are computationally prohibitive for real-time applications. This paper introduces DistilCSE, a two-stage framework that compresses these giants into lightweight versions using a novel Contrastive Knowledge Distillation (CKD) loss. By ensuring objective consistency between the teacher and student, a 110M parameter student model can outperform its 11B parameter teacher, achieving state-of-the-art results with only 1% of the parameters.
Introduction
Knowledge Distillation (KD) is the standard approach for model compression, where a smaller "student" model mimics a larger "teacher." However, traditional KD methods often fail for sentence embeddings because they rely on Mean Squared Error (MSE) to match absolute vector positions. This creates a mathematical mismatch—or objective inconsistency—with the teacher's original contrastive learning objective. The authors identify this mismatch as a primary cause of performance degradation in distilled embedding models.
Methodology
DistilCSE addresses the consistency problem through a two-stage process:
- Stage 1: Contrastive Knowledge Distillation (CKD). Using a massive unlabeled corpus, the student learns relational mapping via the InfoNCE loss. Instead of matching absolute points, the student ensures its representation of a sentence is close to the teacher's representation of that same sentence, relative to other sentences in the batch. A memory bank mechanism (storing 65,536 embeddings) is used to scale the comparison without increasing batch size.
- Stage 2: Contrastive Fine-tuning. The student is refined on labeled data (e.g., NLI) using standard supervised contrastive learning.
Experiments and Results
The framework was trained on News-5m (unlabeled) and the NLI dataset (labeled), then evaluated across seven Semantic Textual Similarity (STS) benchmarks.
Key findings include:
- Efficiency: The 110M parameter DistilCSE-CKD model achieved an average STS score of 85.04, surpassing the 11B Sentence-T5 (84.94) despite having 100x fewer parameters.
- Data Scaling: Performance saturated at just 5 million unlabeled sentences, representing a tiny fraction of the data typically required to train the massive teacher models.
- Model Agnostic Benefits: The benefits scaled down to even smaller architectures; a 52M parameter model (Tiny-L6) outperformed a 330M parameter SimCSE-RoBERTa teacher.
Analysis: Why CKD Works
The primary driver of performance is the improvement in alignment—the property of keeping similar items close in the embedding space. By matching the teacher's contrastive objective, CKD produces a more coherent relational structure than standard MSE-based distillation.
Conclusion
DistilCSE demonstrates that objective consistency is paramount in knowledge distillation for embeddings. By focusing on relational mapping rather than absolute vector matching, the framework enables the creation of highly efficient, production-ready models that rival the performance of the world's largest language models.
Summary updated