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

了解和改进知识蒸馏Quantization-大型Transformer编码器意识培训

Understanding and Improving Knowledge Distillation for Quantization-Aware Training of Large Transformer Encoders

Hanyang University(汉阳大学)

Minsoo Kim, Sihwa Lee, Sukjin Hong, Du-Seong Chang, Jungwook Choi

摘要:

知识蒸馏(KD)是模型压缩的一种常用方法,它利用教师传授的知识来增强轻量级模型的能力。特别地,KD已被用于Transformer编码器(如BERT)的量化感知训练(QAT)中,以利用降低精度的权重参数来提高学生模型的准确性。然而,很少有人知道哪种KD方法最适合Transformers的QAT。在这项工作中,我们提供了一个深入的分析机制KD的注意力恢复的量化大Transformers。特别是,我们发现,以前采用的MSE损失的注意力分数是不够的恢复自我注意力的信息。因此,我们提出了两种KD方法:注意力地图和注意力输出损失。此外,我们探讨了这两种损失的统一,以解决注意力地图和输出损失之间的任务依赖性偏好。在各种Transformer编码器模型上的实验结果表明,所提出的KD方法实现了最先进的精度与子2位权重量化的QAT。

英文摘要:

Knowledge distillation (KD) has been a ubiquitous method for model compression to strengthen the capability of a lightweight model with the transferred knowledge from the teacher. In particular, KD has been employed in quantization-aware training (QAT) of Transformer encoders like BERT to improve the accuracy of the student model with the reduced-precision weight parameters. However, little is understood about which of the various KD approaches best fits the QAT of Transformers. In this work, we provide an in-depth analysis of the mechanism of KD on attention recovery of quantized large Transformers. In particular, we reveal that the previously adopted MSE loss on the attention score is insufficient for recovering the self-attention information. Therefore, we propose two KD methods; attention-map and attention-output losses. Furthermore, we explore the unification of both losses to address task-dependent preference between attention-map and output losses. The experimental results on various Transformer encoder models demonstrate that the proposed KD methods achieve state-of-the-art accuracy for QAT with sub-2-bit weight quantization.

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

↑