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

RefBERT:通过引用预先计算的表示来压缩BERT

RefBERT: Compressing BERT by Referencing to Pre-computed Representations

University of California, Santa Barbara(加州大学圣巴巴拉分校);Ping An Life Insurance Company of China, Ltd.(中国平安人寿保险股份有限公司)

Xinyi Wang, Haiqin Yang, Liang Zhao, Yang Mo, Jianping Shen

摘要:

最近开发的大型预训练语言模型,例如,BERT在许多下游自然语言处理应用中取得了显著的性能。这些预先训练的语言模型通常包含数亿个参数,并且在现实世界的应用中遭受高计算和延迟。期望减少模型的计算开销以用于快速训练和推理,同时保持模型在下游应用中的性能。几条工作线利用知识蒸馏来将教师模型压缩成更小的学生模型。然而,他们往往丢弃教师的知识时,推理。因此,在本文中,我们提出RefBERT来利用从教师那里学到的知识,即,促进对参考样本的预先计算的BERT表示,并将BERT压缩成较小的学生模型。为了保证我们的建议,我们提供的损失函数和参考样本的使用理论的理由。值得注意的是,理论结果表明,包括预先计算的教师对参考样本的表示确实增加了学习学生模型时的互信息。最后,我们进行了实证评估,并表明我们的RefBERT可以击败香草TinyBERT超过8.1\%,并实现了超过94\%的性能$\BERTBASE$在GLUE基准。同时,RefBERT比BERT $_{\rm BASE}$小7.4倍,推理速度快9.5倍。

英文摘要:

Recently developed large pre-trained language models, e.g., BERT, have achieved remarkable performance in many downstream natural language processing applications. These pre-trained language models often contain hundreds of millions of parameters and suffer from high computation and latency in real-world applications. It is desirable to reduce the computation overhead of the models for fast training and inference while keeping the model performance in downstream applications. Several lines of work utilize knowledge distillation to compress the teacher model to a smaller student model. However, they usually discard the teacher's knowledge when in inference. Differently, in this paper, we propose RefBERT to leverage the knowledge learned from the teacher, i.e., facilitating the pre-computed BERT representation on the reference sample and compressing BERT into a smaller student model. To guarantee our proposal, we provide theoretical justification on the loss function and the usage of reference samples. Significantly, the theoretical result shows that including the pre-computed teacher's representations on the reference samples indeed increases the mutual information in learning the student model. Finally, we conduct the empirical evaluation and show that our RefBERT can beat the vanilla TinyBERT over 8.1\% and achieves more than 94\% of the performance of $\BERTBASE$ on the GLUE benchmark. Meanwhile, RefBERT is 7.4x smaller and 9.5x faster on inference than BERT$_{\rm BASE}$.

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

↑