翻转知识蒸馏:利用小模型专长提升大语言模型在文本匹配中的性能
Flipping Knowledge Distillation: Leveraging Small Models' Expertise to Enhance LLMs in Text Matching
AI总结:
提出翻转知识蒸馏范式,让大语言模型通过LoRA以编码器-解码器方式向小模型学习,并采用边际感知对比学习对齐相似性,在金融和医疗基准上提升文本匹配性能。
摘要:
知识蒸馏通常涉及将知识从大语言模型(LLM)转移到较小的语言模型(SLM)。然而,在文本匹配等任务中,经过微调的较小模型往往能产生更有效的领域特定表示,因为它们专注于优化输入对的相似性。为了同时利用小模型的专门优势和大语言模型丰富的语义理解,我们引入了一种翻转知识蒸馏范式,其中大语言模型向小模型学习。具体来说,我们通过使用LoRA以编码器-解码器的方式重新解释大语言模型,解决了仅解码器的大语言模型与较小的基于编码器的模型之间的架构差距。编码器生成压缩表示,而解码器将其映射到输出空间。在训练期间,编码器产生表示及其相似性,然后使用我们提出的边际感知对比学习(MCL)方法,将这些相似性与教师模型产生的相似性分数对齐。MCL确保正负对的相似性准确,并自适应地处理正负样本内部的差异。我们的范式仅需要一个性能合理的小模型,即可使大语言模型实现改进的性能。在金融和医疗保健基准以及实际应用上的实验证实了其有效性,该模型已完全部署在在线环境中。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。