arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.15032cs.CLcs.AIcs.LG
收藏

如何蒸馏你的BERT:关于权重初始化与蒸馏目标影响的实证研究

How to Distill your BERT: An Empirical Study on the Impact of Weight Initialisation and Distillation Objectives

Center for Information and Language Processing (CIS), LMU Munich(慕尼黑大学信息与语言处理中心(CIS));Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心(MCML))

Xinpeng Wang, Leonie Weissweiler, Hinrich Schütze, Barbara Plank

AI总结:

本文首次在任务特定与任务无关两种设置下全面评估BERT中间层蒸馏目标,发现注意力迁移总体最优,并证明用教师低层初始化学生模型可显著提升任务特定蒸馏性能,同时发布了高效Transformer蒸馏框架。

摘要:

近年来,各种中间层蒸馏(ILD)目标已被证明能够通过知识蒸馏(KD)改善BERT模型的压缩效果。然而,目前缺乏在任务特定和任务无关两种设置下对这些目标的全面评估。据我们所知,这是首项在这两种设置下全面评估蒸馏目标的工作。我们表明,注意力迁移总体上给出了最佳性能。我们还研究了在从教师层初始化学生模型时层选择的影响,发现其在任务特定蒸馏中对性能有显著影响。对于普通KD和隐藏状态迁移,使用教师较低层进行初始化相比较高层带来了相当大的提升,尤其是在QNLI任务上(准确率的绝对百分比变化最高达17.8)。注意力迁移在不同初始化设置下表现一致。我们发布了代码,作为一个高效的基于Transformer的模型蒸馏框架,以供进一步研究。

英文摘要:

Recently, various intermediate layer distillation (ILD) objectives have been shown to improve compression of BERT models via Knowledge Distillation (KD). However, a comprehensive evaluation of the objectives in both task-specific and task-agnostic settings is lacking. To the best of our knowledge, this is the first work comprehensively evaluating distillation objectives in both settings. We show that attention transfer gives the best performance overall. We also study the impact of layer choice when initializing the student from the teacher layers, finding a significant impact on the performance in task-specific distillation. For vanilla KD and hidden states transfer, initialisation with lower layers of the teacher gives a considerable improvement over higher layers, especially on the task of QNLI (up to an absolute percentage change of 17.8 in accuracy). Attention transfer behaves consistently under different initialisation settings. We release our code as an efficient transformer-based model distillation framework for further studies.

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

↑