arXiv:2507.05617cs.CL2025-07ACL被引 6

让大模型向小模型学习,提升文本匹配效果

Flipping Knowledge Distillation: Leveraging Small Models' Expertise to Enhance LLMs in Text Matching

  • 反向知识蒸馏:大模型从优化过的小微模型学相似度判断
  • 在金融与医疗数据集上显著提升匹配准确率,实测已上线部署
  • 无需顶级小模型,只需表现尚可的小微模型即可生效

传统知识蒸馏通常将大语言模型(LLM)的知识迁移到小语言模型(SLM),但在文本匹配任务中,经过微调的小模型往往能生成更有效的领域特定表示,因其专注于输入对之间的相似性优化。为此,本文提出一种反向知识蒸馏范式,让LLM从SLM学习。针对解码器架构的LLM与编码器架构的SLM间的结构差异,采用LoRA重新诠释LLM为编码器-解码器形式:编码器生成压缩表征,解码器将其映射到输出空间。训练时,编码器生成表征及其相似度,通过提出的边际感知对比学习(MCL)方法与教师模型(即SLM)的相似度得分对齐。MCL确保正负样本对的相似度判断准确,并自适应处理正负样本内部差异。该范式仅需性能合理的SLM即可使LLM获得性能提升。在金融与医疗基准测试及真实场景应用中验证有效,模型已在生产环境全面部署。

原文摘要 · Abstract (English)

Knowledge distillation typically involves transferring knowledge from a Large Language Model (LLM) to a Smaller Language Model (SLM). However, in tasks such as text matching, fine-tuned smaller models often yield more effective domain-specific representations, as they focus on optimizing the similarity of input pairs. To leverage both the specialized strengths of small models and the rich semantic understanding of LLMs, we introduce a flipped knowledge distillation paradigm, where LLM learns from SLM. Specifically, we address the architectural gap between decoder-only LLMs and smaller encoder-based models by reinterpreting LLMs in an encoder-decoder manner using LoRA. The encoder generates compressed representations, while the decoder maps them to the output space. During training, the encoder produces representations and their similarities, which are then aligned with the similarity scores produced by the teacher, using our proposed Margin-aware Contrastive Learning (MCL) approach. The MCL ensures accurate similarity for both positive and negative pairs, and adaptively handles the internal differences within positive and negative samples. Our paradigm requires only a reasonably good-performing SLM, allowing the LLM to achieve improved performance. Experiments on financial and healthcare benchmarks, as well as real-world applications, confirm its effectiveness, and the model has been fully deployed in an online environment.

知识蒸馏文本匹配大模型小模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。