Staged Training for Transformer Language Models

Sheng Shen, Pete Walsh, Kurt Keutzer, Jesse Dodge, Matthew Peters +1 more
3/11/2022
cs.CL
transformer-attention

Official code: allenai/staged-training (33 stars, Jupyter Notebook, Apache-2.0, PyTorch, last commit 2022-03-31).

Abstract

The current standard approach to scaling transformer language models trains each model size from a different random initialization. As an alternative, we consider a staged training setup that begins with a small model and incrementally increases the amount of compute used for training by applying a "growth operator" to increase the model depth and width.

Show full abstract

By initializing each stage with the output of the previous one, the training process effectively re-uses the compute from prior stages and becomes more efficient. Our growth operators each take as input the entire training state (including model parameters, optimizer state, learning rate schedule, etc.) and output a new training state from which training continues. We identify two important properties of these growth operators, namely that they preserve both the loss and the "training dynamics" after applying the operator. While the loss-preserving property has been discussed previously, to the best of our knowledge this work is the first to identify the importance of preserving the training dynamics (the rate of decrease of the loss during training). To find the optimal schedule for stages, we use the scaling laws from (Kaplan et al., 2020) to find a precise schedule that gives the most compute saving by starting a new stage when training efficiency starts decreasing. We empirically validate our growth operators and staged training for autoregressive language models, showing up to 22% compute savings compared to a strong baseline trained from scratch. Our code is available at https://github.com/allenai/staged-training.

View on arXivView PDF

Code Implementations(1)

PyTorchApache-2.0

Staged Training for Transformer Language Models

332Jupyter Notebook, PythonMar 3, 20224 years agoApache-2.0
deep-learninglanguage-modelnlppytorchtransformers

Similar Papers

Cite this paper

@article{shen2022staged,
  title  = {Staged Training for Transformer Language Models},
  author = {Sheng Shen and Pete Walsh and Kurt Keutzer and Jesse Dodge and Matthew Peters and Iz Beltagy},
  year   = {2022},
  eprint = {2203.06211},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.06211}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.06211.svg)](https://codeofpaper.com/paper/2203.06211)

Discussion