MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers

By Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, Ming Zhou. 2020

2,387 citations recorded by the source corpus.

Pre-trained language models (e.g., BERT (Devlin et al., 2018) and its variants) have achieved remarkable success in varieties of NLP tasks. However, these models usually consist of hundreds of millions of parameters which brings challenges for fine-tuning and online serving in real-life applications due to latency and capacity constraints. In this work, we present a simple and effective approach to compress large Transformer (Vaswani et al., 2017) based pre-trained models, termed as deep self-attention distillation. The small model (student) is trained by deeply mimicking the self-attention module, which plays a vital role in Transformer networks, of the large model (teacher). Specifically, we propose distilling the self-attention module of the last Transformer layer of the teacher, which is effective and flexible for the student. Furthermore, we introduce the scaled dot-product between values in the self-attention module as the new deep self-attention knowledge, in addition to the attention distributions (i.e., the scaled dot-product of queries and keys) that have been used in existing works. Moreover, we show that introducing a teacher assistant (Mirzadeh et al., 2019) also helps the distillation of large pre-trained Transformer models. Experimental results demonstrate that our monolingual model outperforms state-of-the-art baselines in different parameter size of student models. In particular, it retains more than 99% accuracy on SQuAD 2.0 and several GLUE benchmark tasks using 50% of the Transformer parameters and computations of the teacher model. We also obtain competitive results in applying deep self-attention distillation to multilingual pre-trained models.

Subfields: Artificial Intelligence, Electrical and Electronic Engineering, Materials Chemistry, Efficiency & Compression

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Jianfeng Gao
  2. Mohit Bansal
  3. Furu Wei
  4. Zhe Gan
  5. Percy Liang
  6. Luke S. Zettlemoyer
  7. Yejin Choi
  8. Caiming Xiong

In Electrical and Electronic Engineering

  1. Yi Tay
  2. Mostafa Dehghani
  3. Kurt Keutzer
  4. A. Gholami
  5. Derya Soydaner
  6. Michael W. Mahoney
  7. Ming Ding
  8. Zi-Mei Yao

In Materials Chemistry

  1. Yang Liu
  2. Dacheng Tao
  3. Alec Radford
  4. Jianfeng Gao
  5. Julian McAuley
  6. Mostafa Dehghani
  7. Furu Wei
  8. Xipeng Qiu

In Efficiency & Compression

  1. Zi-Mei Yao
  2. Kurt Keutzer
  3. A. Gholami
  4. Michael W. Mahoney
  5. Minjia Zhang
  6. Yuxiong He
  7. Furu Wei
  8. Alexander M. Rush

Citations in the corpus