Knowledge distillation (KD) is widely used for compressing a teacher model to a smaller student model, reducing its inference cost and memory footprint while preserving model capabilities. However, current KD methods for auto-regressive sequence models (e.g., large language models) suffer from missing a standardized objective function. Moreover, the recent use of student-generated outputs to address training-inference mismatches has significantly escalated computational costs. To tackle these issues, we introduce DistiLLM, a more effective and efficient KD framework for auto-regressive language models. DistiLLM comprises two components: (1) a novel skew Kullback-Leibler divergence loss, where we unveil and leverage its theoretical properties, and (2) an adaptive off-policy approach designed to enhance the efficiency in utilizing student-generated outputs. Extensive experiments, including instruction-following tasks, demonstrate the effectiveness of DistiLLM in building high-performing student models while achieving up to 4.3$\times$ speedup compared to recent KD methods.
翻译:知识蒸馏(KD)广泛用于将教师模型压缩为更小的学生模型,从而降低推理成本和内存占用,同时保留模型能力。然而,当前针对自回归序列模型(如大型语言模型)的KD方法缺乏标准化的目标函数。此外,近期使用学生生成输出解决训练-推理不匹配问题的方法显著增加了计算成本。为解决这些问题,我们提出DistiLLM——一种更高效、更有效的自回归语言模型KD框架。DistiLLM包含两个组件:(1)新型偏斜KL散度损失函数,我们揭示并利用了其理论特性;(2)自适应离策略方法,旨在提升学生生成输出的利用效率。在包括指令遵循任务在内的大量实验中,DistiLLM在构建高性能学生模型的同时,相比近期KD方法实现了高达4.3倍的加速效果。