DeeBERT: Dynamic Early Exiting for Accelerating BERT Inference

Ji Xin, Raphael Tang, Jaejun Lee, Yaoliang Yu, Jimmy Lin
4/27/2020
cs.CLcs.LG

Official code: castorini/DeeBERT (160 stars, Apache-2.0, last commit 2022-03-25).

Abstract

Large-scale pre-trained language models such as BERT have brought significant improvements to NLP applications. However, they are also notorious for being slow in inference, which makes them difficult to deploy in real-time applications. We propose a simple but effective method, DeeBERT, to accelerate BERT inference. Our approach allows samples to exit earlier without passing through the entire model. Experiments show that DeeBERT is able to save up to ~40% inference time with minimal degradation in model quality. Further analyses show different behaviors in the BERT transformer layers and also reveal their redundancy. Our work provides new ideas to efficiently apply deep transformer-based models to downstream tasks. Code is available at https://github.com/castorini/DeeBERT.

View on arXivView PDF

Code Implementations(1)

castorini/DeeBERTOfficial100%
Apache-2.0

DeeBERT: Dynamic Early Exiting for Accelerating BERT Inference

16028Shell, PythonApr 12, 20204 years agoApache-2.0

Cite this paper

@article{xin2020deebert,
  title  = {DeeBERT: Dynamic Early Exiting for Accelerating BERT Inference},
  author = {Ji Xin and Raphael Tang and Jaejun Lee and Yaoliang Yu and Jimmy Lin},
  year   = {2020},
  eprint = {2004.12993},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.12993}
}

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/2004.12993.svg)](https://codeofpaper.com/paper/2004.12993)

Discussion