arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2404.14827cs.CL
收藏

句子级还是词元级?关于知识蒸馏的全面研究

Sentence-Level or Token-Level? A Comprehensive Study on Knowledge Distillation

Shenyang Institute of Computing Technology, Chinese Academy of Sciences(中国科学院沈阳计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);University of Science and Technology of China(中国科学技术大学)

Jingxuan Wei, Linzhuang Sun, Yichong Leng, Xu Tan, Bihui Yu, Ruifeng Guo

AI总结:

本研究通过改变模型大小、文本复杂度等系统分析句子级与词元级知识蒸馏的适用场景,并提出基于门控机制的混合方法,显著提升了蒸馏性能。

摘要:

知识蒸馏,即将知识从教师模型转移到学生模型,已成为神经机器翻译中用于压缩模型或简化训练目标的强大技术。知识蒸馏包含两种主要方法:句子级蒸馏和词元级蒸馏。在句子级蒸馏中,学生模型被训练以对齐教师模型的输出,这可以缓解训练难度并赋予学生模型对全局结构的全面理解。不同的是,词元级蒸馏要求学生模型学习教师模型的输出分布,从而促进更细粒度的知识转移。研究揭示了句子级和词元级蒸馏在不同场景下的表现存在差异,导致在知识蒸馏方法的经验选择上产生困惑。在本研究中,我们认为具有更复杂目标(即分布)的词元级蒸馏更适合“简单”场景,而句子级蒸馏在“复杂”场景中表现更佳。为了验证我们的假设,我们通过改变学生模型的模型大小、文本复杂性和解码过程难度,系统地分析了蒸馏方法的性能。虽然我们的实验结果验证了我们的假设,但定义给定场景的复杂程度仍是一项具有挑战性的任务。因此,我们进一步引入了一种新颖的混合方法,该方法通过门控机制结合了词元级和句子级蒸馏,旨在利用两种单独方法的优势。实验表明,该混合方法在性能上大幅超越了词元级或句子级蒸馏方法以及先前的工作,证明了所提出的混合方法的有效性。

英文摘要:

Knowledge distillation, transferring knowledge from a teacher model to a student model, has emerged as a powerful technique in neural machine translation for compressing models or simplifying training targets. Knowledge distillation encompasses two primary methods: sentence-level distillation and token-level distillation. In sentence-level distillation, the student model is trained to align with the output of the teacher model, which can alleviate the training difficulty and give student model a comprehensive understanding of global structure. Differently, token-level distillation requires the student model to learn the output distribution of the teacher model, facilitating a more fine-grained transfer of knowledge. Studies have revealed divergent performances between sentence-level and token-level distillation across different scenarios, leading to the confusion on the empirical selection of knowledge distillation methods. In this study, we argue that token-level distillation, with its more complex objective (i.e., distribution), is better suited for ``simple'' scenarios, while sentence-level distillation excels in ``complex'' scenarios. To substantiate our hypothesis, we systematically analyze the performance of distillation methods by varying the model size of student models, the complexity of text, and the difficulty of decoding procedure. While our experimental results validate our hypothesis, defining the complexity level of a given scenario remains a challenging task. So we further introduce a novel hybrid method that combines token-level and sentence-level distillation through a gating mechanism, aiming to leverage the advantages of both individual methods. Experiments demonstrate that the hybrid method surpasses the performance of token-level or sentence-level distillation methods and the previous works by a margin, demonstrating the effectiveness of the proposed hybrid method.

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

↑