MoEBERT: from BERT to Mixture-of-Experts via Importance-Guided Adaptation

Simiao Zuo, Qingru Zhang, Chen Liang, Pengcheng He, Tuo Zhao +1 more
4/15/2022
cs.CL
moedistillation

Official code: SimiaoZuo/MoEBERT (114 stars, Python, Apache-2.0, last commit 2022-05-02).

Abstract

Pre-trained language models have demonstrated superior performance in various natural language processing tasks. However, these models usually contain hundreds of millions of parameters, which limits their practicality because of latency requirements in real-world applications.

Show full abstract

Existing methods train small compressed models via knowledge distillation. However, performance of these small models drops significantly compared with the pre-trained models due to their reduced model capacity. We propose MoEBERT, which uses a Mixture-of-Experts structure to increase model capacity and inference speed. We initialize MoEBERT by adapting the feed-forward neural networks in a pre-trained model into multiple experts. As such, representation power of the pre-trained model is largely retained. During inference, only one of the experts is activated, such that speed can be improved. We also propose a layer-wise distillation method to train MoEBERT. We validate the efficiency and effectiveness of MoEBERT on natural language understanding and question answering tasks. Results show that the proposed method outperforms existing task-specific distillation algorithms. For example, our method outperforms previous approaches by over 2% on the MNLI (mismatched) dataset. Our code is publicly available at https://github.com/SimiaoZuo/MoEBERT.

View on arXivView PDF

Code Implementations(1)

SimiaoZuo/MoEBERTOfficial100%
Apache-2.0

This PyTorch package implements MoEBERT: from BERT to Mixture-of-Experts via Importance-Guided Adaptation (NAACL 2022).

11412Python, Jupyter NotebookApr 15, 20224 years agoApache-2.0

Similar Papers

Cite this paper

@article{zuo2022moebert,
  title  = {MoEBERT: from BERT to Mixture-of-Experts via Importance-Guided Adaptation},
  author = {Simiao Zuo and Qingru Zhang and Chen Liang and Pengcheng He and Tuo Zhao and Weizhu Chen},
  year   = {2022},
  eprint = {2204.07675},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.07675}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.07675.svg)](https://codeofpaper.com/paper/2204.07675)

Discussion