揭示大模型知识蒸馏的核心机制并提升性能
A Unified Approach to Interpreting Knowledge Distillation for Large Language Models via Interactions

- 通过分解输出得分中的交互项,发现蒸馏本质是稀疏化交互
- 复杂交互的稀疏程度决定不同蒸馏方法性能差异
- 提出新损失函数CIP,可通用提升各类蒸馏方法效果
尽管知识蒸馏(KD)在大语言模型(LLM)中表现成功,但其有效性背后的机制仍不明确。本文提出一种统一方法,通过分析输入变量间的交互关系来探究多种KD方法的共同机制。我们将大模型输出得分分解为多个交互项之和,每个交互项代表一组输入变量(如词语)间的非线性关系。基于此分解,我们发现各类KD方法的共性机制是交互项的稀疏化:学生模型在推理时仅保留少量交互项,其余交互被抑制至零效应。进一步发现,不同KD方法的性能差异源于其处理复杂交互的能力;能促使学生模型实现更高复杂交互稀疏度的方法通常表现更优。为此,我们提出一种即插即用的损失函数——复杂交互惩罚(CIP),在蒸馏过程中显式强制复杂交互稀疏化。大量实验表明,引入CIP能一致提升多种KD方法在域内与域外基准上的性能。
原文摘要 · Abstract (English)
Despite the success of knowledge distillation (KD) in Large Language Models (LLMs), the underlying mechanism behind its efficacy remains unclear. In this paper, we propose a unified approach to explore the common mechanism of various KD methods using interactions. Specifically, we decompose the output score of the LLM into the sum of numerous interactions. Each interaction represents a nonlinear relationship involving a set of input variables (e.g., words). Based on the decomposed interactions, we discover that the common mechanism underlying various KD methods is the sparsification of interactions, i.e., student models retain fewer interactions for inference while suppressing other interactions to zero effects. Furthermore, we discover that the performance variance across different KD methods arises from their capabilities in handling complex interactions. A KD method typically yields better performance if it enables the student model to achieve higher sparsity of complex interactions. Motivated by these insights, we propose a plug-and-play loss function called Complex Interaction Penalty (CIP) to explicitly enforce the sparsity of complex interactions during the distillation process. Extensive experiments demonstrate that integrating CIP consistently improves the performance of diverse KD methods on both in-domain and out-of-distribution benchmarks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。