English

BERT Loses Patience: Fast and Robust Inference with Early Exit

Computation and Language 2020-10-23 v3 Machine Learning

Abstract

In this paper, we propose Patience-based Early Exit, a straightforward yet effective inference method that can be used as a plug-and-play technique to simultaneously improve the efficiency and robustness of a pretrained language model (PLM). To achieve this, our approach couples an internal-classifier with each layer of a PLM and dynamically stops inference when the intermediate predictions of the internal classifiers remain unchanged for a pre-defined number of steps. Our approach improves inference efficiency as it allows the model to make a prediction with fewer layers. Meanwhile, experimental results with an ALBERT model show that our method can improve the accuracy and robustness of the model by preventing it from overthinking and exploiting multiple classifiers for prediction, yielding a better accuracy-speed trade-off compared to existing early exit methods.

Keywords

Cite

@article{arxiv.2006.04152,
  title  = {BERT Loses Patience: Fast and Robust Inference with Early Exit},
  author = {Wangchunshu Zhou and Canwen Xu and Tao Ge and Julian McAuley and Ke Xu and Furu Wei},
  journal= {arXiv preprint arXiv:2006.04152},
  year   = {2020}
}

Comments

NeurIPS 2020

R2 v1 2026-06-23T16:07:33.295Z