arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.10068cs.CL
收藏

面向大语言模型蒸馏的多粒度语义修正方法

Multi-Granularity Semantic Revision for Large Language Model Distillation

University of Science and Technology of China(中国科学技术大学);Hong Kong University of Science and Technology (GZ)(香港科技大学(广州))

Xiaoyu Liu, Yun Zhang, Wei Li, Simiao Li, Xudong Huang, Hanting Chen, Yehui Tang, Jie Hu, Zhiwei Xiong, Yunhe Wang

AI总结:

针对现有大语言模型蒸馏依赖学生生成输出易出错、损失难对齐高信息部分的问题,提出多粒度语义修正方法,从序列、token、跨度三层优化,在0.1B-13B模型上验证了性能优势。

摘要:

知识蒸馏在大语言模型(LLM)压缩中发挥着关键作用,它能在大型教师模型的指导下提升小型学生模型的性能。然而,现有的LLM蒸馏方法过度依赖学生模型生成的输出,这可能会引入生成错误,进而误导蒸馏过程。此外,由于LLM输出的分布较为复杂,以往研究提出的蒸馏损失函数难以对齐信息量最丰富的部分。为解决这些问题,我们提出了一种面向LLM蒸馏的多粒度语义修正方法。在序列层面,我们提出了序列校正与重生成(sequence correction and re-generation, SCRG)策略。SCRG首先计算教师模型与学生模型之间的语义认知差异以检测错误token,随后用教师模型生成的token对其进行校正,并重新生成序列,从而减少生成错误并增强生成多样性。在token层面,我们设计了分布自适应裁剪KL(distribution adaptive clipping Kullback-Leibler, DAC-KL)损失作为蒸馏目标函数。DAC-KL损失利用一个可学习的子网络,从教师模型的输出中自适应提取语义密集区域,避免蒸馏过程中冗余信息的干扰。最后,在跨度(span)层面,我们利用序列的跨度先验计算跨度内部的概率相关性,并约束教师模型与学生模型的概率相关性保持一致,进一步增强语义信息的迁移。我们在参数规模从0.1B到13B的不同模型家族上开展了大量实验,结果表明,与现有方法相比,我们的方法具有更优的性能。

英文摘要:

Knowledge distillation plays a key role in compressing the Large Language Models (LLMs), which boosts a small-size student model under large teacher models' guidance. However, existing LLM distillation methods overly rely on student-generated outputs, which may introduce generation errors and misguide the distillation process. Moreover, the distillation loss functions introduced in previous art struggle to align the most informative part due to the complex distribution of LLMs' outputs. To address these problems, we propose a multi-granularity semantic revision method for LLM distillation. At the sequence level, we propose a sequence correction and re-generation (SCRG) strategy. SCRG first calculates the semantic cognitive difference between the teacher and student to detect the error token, then corrects it with the teacher-generated one, and re-generates the sequence to reduce generation errors and enhance generation diversity. At the token level, we design a distribution adaptive clipping Kullback-Leibler (DAC-KL) loss as the distillation objective function. DAC-KL loss exploits a learnable sub-network to adaptively extract semantically dense areas from the teacher's output, avoiding the interference of redundant information in the distillation process. Finally, at the span level, we leverage the span priors of a sequence to compute the probability correlations within spans, and constrain the teacher and student's probability correlations to be consistent, further enhancing the transfer of semantic information. Extensive experiments across different model families with parameters ranging from 0.1B to 13B demonstrate the superiority of our method compared to existing methods.

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

↑