论文地址:https://arxiv.org/pdf/1909.10351.pdf?trk=public_post_comment-text
代码地址:Pretrained-Language-Model/TinyBERT at master · huawei-noah/Pretrained-Language-Model · GitHub
0、蒸馏transformer模型的推荐文献(以Bert为例)
SKDBert(AAAI-2023)(多教师蒸馏+随机采样分布)✖️
Tinybert (EMNLP 2020) (指定跨层蒸馏)√
MobileBERT(ACL 2020)(体积小)√
PKDBert (2019) 更浅,hidden states 在多个中间层上的知识传输,教师模型经过任务优化微调 √
DistilBert(NeurIPS 2019) 深度减半
MiniLM (NeurIPS 2020)
SqueezeBERT(2020)(多层分组卷积)
Internal KD(AAAI 2020) (指定跨层蒸馏)
一、Tinybert
Tinybert (EMNL 2020) (指定跨层蒸馏) √(embedding层,attn和mlp分别做mse loss)
Tinybert > DistilBert,PKDBert | MobileBERT(24层)
跨层方法:
-> TinyBERT6 g(m) = 2 × m
-> TinyBERT4 g(m) = 3 × m
蒸馏目标:L attn,L hidn,L embd:MSE loss;L pred,CE loss
蒸馏阶段:two-stage learning -> pre-training-then-fine-tuning
GD (General Distillation) √
TD (Task-specific Distillation)
DA (Data Augmentation)
消融实验结果