BERT 학습 속도 향상을 위한 다단계 계층별 학습 방법: 점진적 스택킹 2.0
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.