Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

BERT Loses Patience: Fast and Robust Inference with Early Exit

About

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.

Wangchunshu Zhou, Canwen Xu, Tao Ge, Julian McAuley, Ke Xu, Furu Wei• 2020

Related benchmarks

TaskDatasetResultRank
Image ClassificationCIFAR-100 (test)
Accuracy75.4
3518
Image ClassificationCIFAR-10 (test)
Accuracy94.4
3381
Language ModelingPTB
Perplexity22.9
1234
Image CaptioningMS COCO Karpathy (test)
CIDEr119.8
706
Image ClassificationTinyImageNet (test)
Accuracy60.2
499
Visual Question AnsweringOK-VQA (test)
Accuracy31.2
327
Sentiment AnalysisIMDB (test)
Accuracy-2.4
306
Image ClassificationImageNet (test)--
235
Language ModelingWikiText-103
PPL10.2
216
Visual EntailmentSNLI-VE (test)
Overall Accuracy85.2
199
Showing 10 of 40 rows

Other info

Follow for update