paper-with-me

Papers

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

2020-02-25 · NeurIPS 2020 12 · Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, Ming Zhou

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.

📄 PDF Abstract BibTeX arXiv:2002.10957

Code (1)

microsoft/unilm 공식 구현 pytorch

Tasks

Sentence RetrievalZero-shot Text Search

Methods 이 논문이 사용한 방법론

Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Position-Wise Feed-Forward Layer 설명 없음
Residual Connection 설명 없음
Attention Dropout Attention Dropout is a type of dropout used in attention-based architectures, where elements are randomly dropped out of the…
Linear Warmup With Linear Decay Linear Warmup With Linear Decay is a learning rate schedule in which we increase the learning rate linearly for $n$ updates and then linearly decay afterwards.
Weight Decay 설명 없음
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…

Similar Papers 제목 키워드 기반

MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformers

2020-12-31 · Findings (ACL) 2021 8 · Wenhui Wang, Hangbo Bao, Shaohan Huang, Li Dong 외

We generalize deep self-attention distillation in MiniLM (Wang et al., 2020) by only using self-attention relation distillation for task-agnostic compression of pretrained Transformers. In particular, we define multi-hea…

RelationXLM-R

A Comparative Analysis of Task-Agnostic Distillation Methods for Compressing Transformer Language Models

2023-10-13 · Takuma Udagawa, Aashka Trivedi, Michele Merler, Bishwaranjan Bhattacharjee

Large language models have become a vital component in modern NLP, achieving state of the art performance in a variety of tasks. However, they are often inefficient for real-world deployment due to their expensive infere…

Knowledge Distillation

QuaLA-MiniLM: a Quantized Length Adaptive MiniLM

2022-10-31 · Shira Guskin, Moshe Wasserblat, Chang Wang, Haihao Shen

Limited computational budgets often prevent transformers from being used in production and from having their high accuracy utilized. A knowledge distillation approach addresses the computational efficiency by self-distil…

Computational EfficiencyKnowledge DistillationQuantizationQuestion Answering

Extract then Distill: Efficient and Effective Task-Agnostic BERT Distillation

2021-04-24 · Cheng Chen, Yichun Yin, Lifeng Shang, Zhi Wang 외

Task-agnostic knowledge distillation, a teacher-student framework, has been proved effective for BERT compression. Although achieving promising results on NLP tasks, it requires enormous computational resources. In this …

Knowledge Distillation

BitNet Distillation

2025-10-15 · Xun Wu, Shaohan Huang, Wenhui Wang, Ting Song 외 arxiv

In this paper, we present BitNet Distillation (BitDistill), a lightweight pipeline that fine-tunes off-the-shelf full-precision LLMs (e.g., Qwen) into 1.58-bit precision (i.e., ternary weights {-1, 0, 1}) for specific do…