AutoTinyBERT: Automatic Hyper-parameter Optimization for Efficient Pre-trained Language Models
8328Authors
nan
Abstract
AbstractPre-trained language models (PLMs) have achieved great success in natural language processing. Most of PLMs follow the default setting of architecture hyper-parameters (e.g., the hidden dimension is a quarter of the intermediate dimension in feed-forward sub-networks) in BERT. Few studies have been conducted to explore the design of architecture hyper-parameters in BERT, especially for the more efficient PLMs with tiny sizes, which are essential for practical deployment on resource-constrained devices. In this paper, we adopt the one-shot Neural Architecture Search (NAS) to automatically search architecture hyper-parameters. Specifically, we carefully design the techniques of one-shot learning and the search space to provide an adaptive and efficient development way of tiny PLMs for various latency constraints. We name our method AutoTinyBERT and evaluate its effectiveness on the GLUE and SQuAD benchmarks. The extensive experiments show that our method outperforms both the SOTA search-based baseline (NAS-BERT) and the SOTA distillation-based methods (such as DistilBERT, TinyBERT, MiniLM, and MobileBERT). In addition, based on the obtained architectures, we propose a more efficient development method that is even faster than the development of a single PLM. The source code and models will be publicly available upon publication.
Keywords
Full Content
Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, pages 5146–5157 August 1–6, 2021. ©2021 Association for Computational Linguistics 5146 AutoTinyBERT: Automatic Hyper-parameter Optimization for Efficient Pre-trained Language Models Yichun Yin1, Cheng Chen2*, Lifeng Shang1, Xin Jiang1, Xiao Chen1, Qun Liu1 1Huawei Noah’s Ark Lab 2Department of Computer Science and Technology, Tsinghua University {yinyichun,shang.lifeng,jiang.xin,chen.xiao2,qun.liu}@huawei.com c-chen19@mails.tsinghua.edu.cn Abstract Pre-trained language models (PLMs) have achieved great success in natural language pro- cessing. Most of PLMs follow the default set- ting of architecture hyper-parameters (e.g., the hidden dimension is a quarter of the intermedi- ate dimension in feed-forward sub-networks) in BERT (Devlin et al., 2019). Few studies have been conducted to explore the design of archi- tecture hyper-parameters in BERT, especially for the more efficient PLMs with tiny sizes, which are essential for practical deployment on resource-constrained devices. In this pa- per, we adopt the one-shot Neural Architecture Search (NAS) to automatically search architec- ture hyper-parameters. Specifically, we care- fully design the techniques of one-shot learn- ing and the search space to provide an adaptive and efficient development way of tiny PLMs for various latency constraints. We name our method AutoTinyBERT1 and evaluate its ef- fectiveness on the GLUE and SQuAD bench- marks. The extensive experiments show that our method outperforms both the SOTA search- based baseline (NAS-BERT) and the SOTA distillation-based methods (such as DistilBERT, TinyBERT, MiniLM and MobileBERT). In ad- dition, based on the obtained architectures, we propose a more efficient development method that is even faster than the development of a single PLM. 1 Introduction Pre-trained language models, such as BERT (De- vlin et al., 2019), RoBERTa (Liu et al., 2019) and XLNet (Yang et al., 2019), have become prevalent in natural language processing. To improve model performance, most PLMs (e.g. ELECTRA (Clark et al., 2019) and GPT-2/3 (Radford et al., 2019; *Contribution during internship at Noah’s Ark Lab. 1Our code implementation and pre-trained models are available at https://github.com/huawei-noah/ Pretrained-Language-Model . 5 10 15 20 25 30 Speedup (compared to BERT-base) 68 70 72 74 76 78 GLUE score (%) AutoTinyBERT(Ours) BERT PF NAS-BERT Figure 1: Inference speedup vs. GLUE scores. Under the same speedup constraint, our method outperforms both the default hyper-parameter setting of BERT (De- vlin et al., 2019), PF (Turc et al., 2019)) and NAS- BERT (Xu et al., 2021). More details are in the Sec- tion 4.2. Brown et al., 2020)) follow the default rule of hyper-parameter setting2 in BERT to scale up their model sizes. Due to its simplicity, this rule has been widely used and can help large PLMs obtain promising results (Brown et al., 2020). In many industrial scenarios, we need to deploy PLMs on resource-constrained devices, such as smartphones and servers with limited computation power. Due to the expensive computation and slow inference speed, it is usually difficult to deploy PLMs such as BERT (12/24 layers, 110M/340M parameters) and GPT-2 (48 layers, 1.5B parame- ters) at their original scales. Therefore, …
Content truncated to 500 words
Labeled Text
AbstractPre-trained language models (PLMs) have achieved great success in natural language processing. Most of PLMs follow the default setting of architecture hyper-parameters (e.g., the hidden dimension is a quarter of the intermediate dimension in feed-forward sub-networks) in BERT. Few studies have been conducted to explore the design of architecture hyper-parameters in BERT, especially for the more efficient PLMs with tiny sizes, which are essential for practical deployment on resource-constrained devices. In this paper, we adopt the one-shot Neural Architecture Search (NAS) to automatically search architecture hyper-parameters. Specifically, we carefully design the techniques of one-shot learning and the search space to provide an adaptive and efficient development way of tiny PLMs for various latency constraints. We name our method AutoTinyBERT and evaluate its effectiveness on the GLUE and SQuAD benchmarks. The extensive experiments show that our method outperforms both the SOTA search-based baseline (NAS-BERT) and the SOTA distillation-based methods (such as DistilBERT, TinyBERT, MiniLM, and MobileBERT). In addition, based on the obtained architectures, we propose a more efficient development method that is even faster than the development of a single PLM. The source code and models will be publicly available upon publication.
Publication Details
- Paper ID:
- 8328
- Year:
- 2021
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan