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

语言模型压缩中中间表示的对比蒸馏

Contrastive Distillation on Intermediate Representations for Language Model Compression

Microsoft Dynamics 365 AI Research(微软Dynamics 365人工智能研究院)

Siqi Sun, Zhe Gan, Yu Cheng, Yuwei Fang, Shuohang Wang, Jingjing Liu

摘要:

现有的语言模型压缩方法大多使用简单的L2损失将大BERT模型的中间表示中的知识提取到较小的模型中。尽管被广泛使用,但这个目标的设计假设隐藏表示的所有维度都是独立的,未能捕获教师网络中间层中的重要结构知识。为了实现更好的蒸馏效果,我们提出了对比蒸馏的中间表示(COSTO),一个原则性的知识蒸馏框架,学生通过对比的目标,通过教师的中间层进行培训,以提取知识。通过学习从大量的负样本中区分出正样本,Coconut有助于学生利用教师隐藏层中的丰富信息。CONDITION可以很容易地应用于在预训练和微调阶段压缩大规模语言模型,并在GLUE基准测试中实现了卓越的性能,优于最先进的压缩方法。

英文摘要:

Existing language model compression methods mostly use a simple L2 loss to distill knowledge in the intermediate representations of a large BERT model to a smaller one. Although widely used, this objective by design assumes that all the dimensions of hidden representations are independent, failing to capture important structural knowledge in the intermediate layers of the teacher network. To achieve better distillation efficacy, we propose Contrastive Distillation on Intermediate Representations (CoDIR), a principled knowledge distillation framework where the student is trained to distill knowledge through intermediate layers of the teacher via a contrastive objective. By learning to distinguish positive sample from a large set of negative samples, CoDIR facilitates the student's exploitation of rich information in teacher's hidden layers. CoDIR can be readily applied to compress large-scale language models in both pre-training and finetuning stages, and achieves superb performance on the GLUE benchmark, outperforming state-of-the-art compression methods.

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

↑