用大模型教小模型,比直接训练效果更好。
Distillation versus Contrastive Learning: How to Train Your Rerankers
- 用高性能大模型做教师,蒸馏训练小模型
- 蒸馏后模型在域内和域外任务表现更优
- 若无强教师模型,直接训练仍是可靠选择
有效训练文本重排序器对信息检索至关重要。目前广泛采用两种策略:对比学习(直接基于真实标签优化)和知识蒸馏(从更大模型迁移知识)。本文通过在相同数据上,使用同一对比学习模型作为教师,训练不同规模(0.5B、1.5B、3B、7B)和架构(Transformer、RNN)的交叉编码器重排序器,实证比较这两种方法。结果表明,当教师模型性能更强时,知识蒸馏在域内和域外任务中普遍优于对比学习,该结论在不同学生模型规模与架构下均成立。然而,若教师模型与学生容量相当,则优势不再显著,尤其在域外任务中表现更差。研究为根据可用教师模型选择训练策略提供了实践指导:若有更强大教师模型,推荐使用蒸馏训练小模型;否则对比学习仍是稳健基线。代码已公开以支持可复现性。
原文摘要 · Abstract (English)
Training effective text rerankers is crucial for information retrieval. Two strategies are widely used: contrastive learning (optimizing directly on ground-truth labels) and knowledge distillation (transferring knowledge from a larger reranker). While both have been studied extensively, a clear comparison of their effectiveness for training cross-encoder rerankers under practical conditions is needed. This paper empirically compares these strategies by training rerankers of different sizes (0.5B, 1.5B, 3B, 7B) and architectures (Transformer, Recurrent) using both methods on the same data, with a strong contrastive learning model acting as the distillation teacher. Our results show that knowledge distillation generally yields better in-domain and out-of-domain ranking performance than contrastive learning when distilling from a more performant teacher model. This finding is consistent across student model sizes and architectures. However, distilling from a teacher of the same capacity does not provide the same advantage, particularly for out-of-domain tasks. These findings offer practical guidance for choosing a training strategy based on available teacher models. We recommend using knowledge distillation to train smaller rerankers if a larger, more performant teacher is accessible; in its absence, contrastive learning remains a robust baseline. Our code implementation is made available to facilitate reproducbility.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。