Progressively Stacking 2.0: BERT 訓練の速度向上のためのマルチステージ層別学習手法
Progressively Stacking 2.0: A Multi-stage Layerwise Training Method for BERT Training Speedup
Progressively Stacking 2.0: A Multi-stage Layerwise Training Method for BERT Training Speedup
@misc{yang2020progressively,
title = {Progressively Stacking 2.0: A Multi-stage Layerwise Training Method for BERT Training Speedup},
author = {Cheng Yang and Shengnan Wang and Chao Yang and Yuechuan Li and Ru He and Jingqiao Zhang},
year = {2020},
eprint = {2011.13635},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2011.13635}
}
Yang, C., Wang, S., Yang, C., Li, Y., He, R., & Zhang, J. (2020). Progressively Stacking 2.0: A Multi-stage Layerwise Training Method for BERT Training Speedup [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2011.13635
YANG C, WANG S, YANG C, et al. Progressively Stacking 2.0: A Multi-stage Layerwise Training Method for BERT Training Speedup[EB/OL]. (2020-11-27)[2026-11-29]. https://arxiv.org/abs/2011.13635.
要旨
事前学習された言語モデル、例えば BERT は、多くの自然言語処理タスクにおいて顕著な精度向上をもたらしている。その効果性にもかかわらず、膨大なパラメータ数は BERT モデルの訓練を計算量的に非常に困難なものにしている。本稿では、BERT の訓練時間を削減するための効率的な階層別段階的訓練(MSLT)アプローチを提案する。我々は全体の訓練プロセスを複数の段階に分解する。訓練は少数のエコーダー層のみを持つ小型モデルから開始し、新しいエコーダー層を追加することでモデルの深さを段階的に増加させる。各段階において、新たに追加されたエコーダー層のうち出力層に近い少数の層のみを訓練する。前段階で訓練済みの他のパラメータは、現在の段階では更新されない。BERT の訓練において、逆伝播計算は前向き計算よりもはるかに時間がかかる。特に、勾配同期のための通信時間をさらに含む分散訓練設定ではその傾向が顕著である。提案された訓練戦略では、逆伝播計算に参加するのは頂部少数の層のみであり、残りの層は前向き計算のみに参加する。したがって、計算効率と通信効率の両方が大幅に改善される。実験結果は、提案された手法が顕著な性能低下なしに 110% 以上の訓練速度向上を実現できることを示している。
Pre-trained language models, such as BERT, have achieved significant accuracy gain in many natural language processing tasks. Despite its effectiveness, the huge number of parameters makes training a BERT model computationally very challenging. In this paper, we propose an efficient multi-stage layerwise training (MSLT) approach to reduce the training time of BERT. We decompose the whole training process into several stages. The training is started from a small model with only a few encoder layers and we gradually increase the depth of the model by adding new encoder layers. At each stage, we only train the top (near the output layer) few encoder layers which are newly added. The parameters of the other layers which have been trained in the previous stages will not be updated in the current stage. In BERT training, the backward computation is much more time-consuming than the forward computation, especially in the distributed training setting in which the backward computation time further includes the communication time for gradient synchronization. In the proposed training strategy, only top few layers participate in backward computation, while most layers only participate in forward computation. Hence both the computation and communication efficiencies are greatly improved. Experimental results show that the proposed method can achieve more than 110% training speedup without significant performance degradation.