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

重新思考大语言模型知识蒸馏中的Kullback-Leibler散度

Rethinking Kullback-Leibler Divergence in Knowledge Distillation for Large Language Models

The University of Hong Kong(香港大学);Tsinghua University(清华大学);Tencent AI Lab(腾讯AI Lab)

Taiqiang Wu, Chaofan Tao, Jiahao Wang, Runming Yang, Zhe Zhao, Ngai Wong

AI总结:

本研究针对大语言模型知识蒸馏中KL散度的应用,修正了正反KL散度特性的传统认知,提出自适应结合二者的AKL方法,在多任务上优于基线并提升生成效果。

摘要:

Kullback-Leibler散度已被广泛应用于知识蒸馏(Knowledge Distillation, KD)以压缩大语言模型(Large Language Models, LLMs)。此前研究认为反向Kullback-Leibler(RKL)散度具有模式搜寻特性,因此优于均值搜寻的正向Kullback-Leibler(FKL)散度,本研究通过实验与理论证明,在大语言模型的知识蒸馏中,模式搜寻与均值搜寻特性均未体现。相反,研究发现RKL与FKL共享相同的优化目标,且在足够多的训练轮次后会收敛。但受实际条件限制,大语言模型很少会训练如此多的轮次。同时,我们进一步发现,在训练初期,RKL关注分布的尾部部分,而FKL关注分布的头部部分。据此,我们提出了一种简单且有效的自适应Kullback-Leibler(AKL)散度方法,该方法自适应分配权重以结合FKL与RKL。基于指标和基于GPT-4的评估表明,所提出的AKL在各类任务上均优于基线方法,且提升了生成回复的多样性与质量。代码可在github获取:https://github.com/wutaiqiang/LLM_KD_AKL。

英文摘要:

Kullback-Leiber divergence has been widely used in Knowledge Distillation (KD) to compress Large Language Models (LLMs). Contrary to prior assertions that reverse Kullback-Leibler (RKL) divergence is mode-seeking and thus preferable over the mean-seeking forward Kullback-Leibler (FKL) divergence, this study empirically and theoretically demonstrates that neither mode-seeking nor mean-seeking properties manifest in KD for LLMs. Instead, RKL and FKL are found to share the same optimization objective and both converge after a sufficient number of epochs. However, due to practical constraints, LLMs are seldom trained for such an extensive number of epochs. Meanwhile, we further find that RKL focuses on the tail part of the distributions, while FKL focuses on the head part at the beginning epochs. Consequently, we propose a simple yet effective Adaptive Kullback-Leiber (AKL) divergence method, which adaptively allocates weights to combine FKL and RKL. Metric-based and GPT-4-based evaluations demonstrate that the proposed AKL outperforms the baselines across various tasks and improves the diversity and quality of generated responses. Codes are available at \href{https://github.com/wutaiqiang/LLM_KD_AKL}{github}.

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

↑