TinyBERT: Distilling BERT for Natural Language Understanding
Xiaoqi Jiao1 , Yichun Yin2∗2{}^{2\hskip 0.3pt*}\hskip 0.3pt\thanks{\hskip 0.5pt Corresponding authors.}, Lifeng Shang2‡, Xin Jiang2 Xiao Chen2, Linlin Li3, Fang Wang1‡ and Qun Liu2 1Key Laboratory of Information Storage System, Huazhong University of Science and Technology, Wuhan National Laboratory for Optoelectronics 2Huawei Noah’s Ark Lab 3Huawei Technologies Co., Ltd. Authors contribute equally. This work is done when Xiaoqi Jiao is an intern at Huawei Noah’s Ark Lab. Corresponding authors.
Abstract
Language model pre-training, such as BERT, has significantly improved the performances of many natural language processing tasks. However, pre-trained language models are usually computationally expensive, so it is difficult to efficiently execute them on resource-restricted devices. To accelerate inference and reduce model size while maintaining accuracy, we first propose a novel Transformer distillation method that is specially designed for knowledge distillation (KD) of the Transformer-based models. By leveraging this new KD method, the plenty of knowledge encoded in a large “teacher” BERT can be effectively transferred to a small “student” TinyBERT. Then, we introduce a new two-stage learning framework for TinyBERT, which performs Transformer distillation at both the pre-training and task-specific learning stages. This framework ensures that TinyBERT can capture the general-domain as well as the task-specific knowledge in BERT.
原文 arXiv:1909.10351;中英对照 + 大白话阅读 https://aha.fim.ai/paper/1909.10351v5