MicroBERT: Distilling MoE-Based Knowledge from BERT into a Lighter Model

Dashun Zheng, Jiaxuan Li, Yunchu Yang, Yapeng Wang, P. Pang
{"title":"MicroBERT: Distilling MoE-Based Knowledge from BERT into a Lighter Model","authors":"Dashun Zheng, Jiaxuan Li, Yunchu Yang, Yapeng Wang, P. Pang","doi":"10.3390/app14146171","DOIUrl":null,"url":null,"abstract":"Natural language-processing tasks have been improved greatly by large language models (LLMs). However, numerous parameters make their execution computationally expensive and difficult on resource-constrained devices. For this problem, as well as maintaining accuracy, some techniques such as distillation and quantization have been proposed. Unfortunately, current methods fail to integrate model pruning with downstream tasks and overlook sentence-level semantic modeling, resulting in reduced efficiency of distillation. To alleviate these limitations, we propose a novel distilled lightweight model for BERT named MicroBERT. This method can transfer the knowledge contained in the “teacher” BERT model to a “student” BERT model. The sentence-level feature alignment loss (FAL) distillation mechanism, guided by Mixture-of-Experts (MoE), captures comprehensive contextual semantic knowledge from the “teacher” model to enhance the “student” model’s performance while reducing its parameters. To make the outputs of “teacher” and “student” models comparable, we introduce the idea of a generative adversarial network (GAN) to train a discriminator. Our experimental results based on four datasets show that all steps of our distillation mechanism are effective, and the MicroBERT (101.14%) model outperforms TinyBERT (99%) by 2.24% in terms of average distillation reductions in various tasks on the GLUE dataset.","PeriodicalId":502388,"journal":{"name":"Applied Sciences","volume":"4 11","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-07-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Applied Sciences","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.3390/app14146171","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Natural language-processing tasks have been improved greatly by large language models (LLMs). However, numerous parameters make their execution computationally expensive and difficult on resource-constrained devices. For this problem, as well as maintaining accuracy, some techniques such as distillation and quantization have been proposed. Unfortunately, current methods fail to integrate model pruning with downstream tasks and overlook sentence-level semantic modeling, resulting in reduced efficiency of distillation. To alleviate these limitations, we propose a novel distilled lightweight model for BERT named MicroBERT. This method can transfer the knowledge contained in the “teacher” BERT model to a “student” BERT model. The sentence-level feature alignment loss (FAL) distillation mechanism, guided by Mixture-of-Experts (MoE), captures comprehensive contextual semantic knowledge from the “teacher” model to enhance the “student” model’s performance while reducing its parameters. To make the outputs of “teacher” and “student” models comparable, we introduce the idea of a generative adversarial network (GAN) to train a discriminator. Our experimental results based on four datasets show that all steps of our distillation mechanism are effective, and the MicroBERT (101.14%) model outperforms TinyBERT (99%) by 2.24% in terms of average distillation reductions in various tasks on the GLUE dataset.
MicroBERT:将 BERT 中基于 MoE 的知识提炼为更轻的模型
大型语言模型(LLM)极大地改进了自然语言处理任务。然而,由于参数繁多,在资源有限的设备上执行这些模型的计算成本高昂且困难重重。针对这一问题,为了保持准确性,人们提出了一些技术,如蒸馏和量化。遗憾的是,目前的方法未能将模型剪枝与下游任务结合起来,并且忽略了句子级语义建模,从而降低了蒸馏的效率。为了缓解这些局限性,我们提出了一种用于 BERT 的新型轻量级蒸馏模型,命名为 MicroBERT。这种方法可以将 "教师 "BERT 模型中包含的知识转移到 "学生 "BERT 模型中。在专家混合物(MoE)的指导下,句子级特征对齐损失(FAL)蒸馏机制从 "教师 "模型中获取全面的上下文语义知识,以提高 "学生 "模型的性能,同时降低其参数。为了使 "教师 "模型和 "学生 "模型的输出具有可比性,我们引入了生成对抗网络(GAN)的理念来训练判别器。我们基于四个数据集的实验结果表明,我们的蒸馏机制的所有步骤都是有效的,在 GLUE 数据集的各种任务中,MicroBERT(101.14%)模型的平均蒸馏率比 TinyBERT(99%)高出 2.24%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信