arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.13555cs.CLcs.AI
收藏

BiLD:用于大语言模型蒸馏的双向 Logits 差异损失

BiLD: Bi-directional Logits Difference Loss for Large Language Model Distillation

KTH Royal Institute of Technology(瑞典皇家理工学院);OPPO AI Center(OPPO AI中心)

Minchong Li, Feng Zhou, Xiaohui Song

AI总结:

针对大语言模型 logits 蒸馏中的长尾噪声与排序信息利用不足问题,本文提出仅用 top-k 并构建双向 logits 差异的 BiLD 损失,在13个数据集上优于多种基线方法。

摘要:

近年来,大语言模型(LLM)在各类自然语言处理(NLP)任务上展现出卓越能力。然而,这种令人瞩目的性能往往伴随着参数规模增加的权衡,给广泛部署带来重大挑战。知识蒸馏(KD)通过将知识从大型教师模型迁移到较小的学生模型提供了解决方案。本文研究在 logit 层面对 LLM 进行任务特定蒸馏。研究发现,经过微调的 LLM 的 logits 比视觉模型呈现出更极端的长尾分布,长尾中隐藏的“噪声”会影响蒸馏性能。此外,现有 logits 蒸馏方法通常难以有效利用 logits 中的内部排序信息。为解决这些问题,我们提出双向 Logits 差异(BiLD)损失。BiLD 损失仅使用教师模型和学生模型的 top-k logits 来过滤长尾噪声,并通过构建 logits 差异来利用内部 logits 排序信息。为评估 BiLD 损失,我们使用两类 LLM 在 13 个数据集上进行了全面实验。结果表明,仅使用 top-8 logits 的 BiLD 损失优于监督微调(SFT)、原始 KL 损失,以及来自 NLP 和 CV 领域的其他五种蒸馏方法。

英文摘要:

In recent years, large language models (LLMs) have shown exceptional capabilities across various natural language processing (NLP) tasks. However, such impressive performance often comes with the trade-off of an increased parameter size, posing significant challenges for widespread deployment. Knowledge distillation (KD) provides a solution by transferring knowledge from a large teacher model to a smaller student model. In this paper, we explore the task-specific distillation of LLMs at the logit level. Our investigation reveals that the logits of fine-tuned LLMs exhibit a more extreme long-tail distribution than those from vision models, with hidden "noise" in the long tail affecting distillation performance. Furthermore, existing logits distillation methods often struggle to effectively utilize the internal ranking information from the logits. To address these, we propose the Bi-directional Logits Difference (BiLD) loss. The BiLD loss filters out the long-tail noise by utilizing only top-$k$ teacher and student logits, and leverages the internal logits ranking information by constructing logits differences. To evaluate BiLD loss, we conduct comprehensive experiments on 13 datasets using two types of LLMs. Our results show that the BiLD loss, with only the top-8 logits, outperforms supervised fine-tuning (SFT), vanilla KL loss, and five other distillation methods from both NLP and CV fields.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑