arrow
Return

Accelerating BERT inference with GPU-efficient exit prediction

delete2024-01-22
delete4
PRE
AI
L
Lei Li
C
Chengyu Wang
M
Minghui Qiu
C
Cen Chen *
M
Ming Gao
周傲英 (Aoying Zhou)
DOI:10.1007/s11704-022-2341-9delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
BERT is a representative pre-trained language model that has drawn extensive attention for significant improvements in downstream Natural Language Processing (NLP) tasks. The complex architecture and massive parameters bring BERT competitive performance but also result in slow speed at model inference time. To speed up BERT inference, FastBERT realizes adaptive inference with an acceptable drop in accuracy based on knowledge distillation and the early-exit technique. However, many factors may limit the performance of FastBERT, such as the teacher classifier that is not knowledgeable enough, the batch size shrinkage and the redundant computation of student classifiers. To overcome these limitations, we propose a new BERT inference method with GPU-Efficient Exit Prediction (GEEP). GEEP leverages the shared exit loss to simplify the training process of FastBERT from two steps into only one step and makes the teacher classifier more knowledgeable by feeding diverse Transformer outputs to the teacher classifier. In addition, the exit layer prediction technique is proposed to utilize a GPU hash table to handle the token-level exit layer distribution and to sort test samples by predicted exit layers. In this way, GEEP can avoid batch size shrinkage and redundant computation of student classifiers. Experimental results on twelve public English and Chinese NLP datasets prove the effectiveness of the proposed approach. The source codes of GEEP will be released to the public upon paper acceptance.
Keywords:
BERT
FastBERT
inference acceleration
model distillation
early exit
text classification

Journal

Frontiers of Computer Science cover
Frontiers of Computer Science
IF:
4.6
Papers:
1.6K
Citations:
2.8K

Organization

A
alibaba group
Scholars:
1.1K
Papers: 789
Citations: 0
E
east china normal university
Scholars:
3.0W
Papers: 2.1W
Citations: 25