Staged Training for Transformer Language Models

Sheng Shen, Pete Walsh, Kurt Keutzer, Jesse Dodge, Matthew E. Peters, Iz Beltagy

Introduction

Training large-scale Transformer models is traditionally a monolithic and computationally intensive process. Researchers typically select a target architecture—often containing billions of parameters—and train it from a random initialization until convergence. This "all or nothing" approach is inherently wasteful, particularly in the early stages of training where smaller, more efficient architectures could potentially learn the same fundamental patterns at a fraction of the cost.

This paper introduces a staged training paradigm. Instead of training a large model from day one, the process begins with a smaller "seed" model that is incrementally grown in both depth and width. By carefully managing these transitions, the authors demonstrate that models can achieve performance parity with traditionally trained baselines while reducing total compute requirements by up to 22%.

The Inefficiency of Static Architectures

The motivation for staged training lies in the observation of scaling laws. Small models are highly compute-efficient during the initial phases of training, rapidly reducing loss. However, they eventually encounter a "loss floor" where further training yields diminishing returns. Conversely, large models are capable of reaching much lower final losses but are significantly more expensive to operate from the very first training step.

The central challenge in transitioning from a small model to a large one is the "stutter" effect. Previous attempts at model growth often resulted in immediate spikes in loss or periods of training instability, where the model spent significant compute simply recovering its previous performance level. Staged training aims to eliminate these inefficiencies by ensuring that growth is both loss-preserving and dynamics-preserving.

Methodology: Growth Operators and State Preservation

The authors introduce specific Growth Operators designed to maintain the functional identity of the model at the moment of expansion. This ensures that the model's error rate does not spike immediately after it grows.

1. Architectural Expansion

  • Width Growth: To increase the hidden dimension, the authors duplicate existing weights. To ensure the output remains identical post-growth, they employ an initialization strategy involving zero-matrices, preventing the duplicated weights from immediately altering the layer's output.
  • Depth Growth: To increase the number of layers, "identity layers" are inserted between existing ones. These layers are initialized such that they initially perform an identity transformation, ensuring the model's forward pass remains unchanged.

2. Preserving Training Dynamics

A key insight of this work is that preserving the model's output (loss) is insufficient for efficient growth. One must also preserve the training dynamics. When a model's architecture changes, the authors "stretch" the entire training state to match the new dimensions. This includes:

  • Optimizer States: The $m$ (momentum) and $v$ (variance) moments in the Adam optimizer are resized to match the new parameters.
  • Learning Rate Schedule: The schedule is maintained so that the model continues its trajectory without the need for a "warm-up" period after every growth step.

By preserving these states, the model avoids the "forgetting" phase typically seen in model surgery, allowing it to immediately begin learning at the rate of the larger architecture.

Determining the Growth Schedule

To maximize compute savings, the transition between stages must be timed precisely. The authors utilize the scaling laws established by Kaplan et al. (2020) to create a mathematical framework for growth. The optimal schedule triggers growth at the exact point where the compute-efficiency of the current model size drops below the efficiency of the next size up. This allows the model to effectively "jump" from the steep learning curve of a small model to the lower-loss trajectory of a larger one.

Experimental Results

The proposed method was evaluated using the GPT-2 architecture (up to 768M parameters) trained on the C4 (Colossal Clean Crawled Corpus) dataset.

Compute Efficiency and Performance

The staged training approach achieved up to 22% savings in total compute compared to training a GPT-2 Large model from scratch. Crucially, this was achieved without sacrificing final model quality. Validation loss on the C4 dataset remained identical to the baseline.

Generalization and Stability

To ensure the grown models were not merely overfitting the training distribution, the authors conducted zero-shot evaluations on Wikitext-103 (perplexity) and LAMBADA (word prediction accuracy). The staged models showed performance parity with scratch-trained models across these benchmarks. Furthermore, the growth process was remarkably stable; by growing the optimizer state alongside the weights, the authors eliminated the loss spikes that usually characterize structural changes in neural networks.

Conclusion and Future Work

Staged training represents a significant step toward more sustainable and efficient large-scale model development. By treating model architecture as a dynamic rather than static property, researchers can leverage the efficiency of small models without sacrificing the power of large ones.

While the current framework relies on some empirical tuning for growth schedules, future work may focus on fully automating these transitions. Additionally, while these experiments were conducted at the 768M parameter scale, the underlying mathematical principles suggest that the benefits of staged training should persist at the scale of hundreds of billions of parameters. Combining this approach with other efficiency techniques, such as sequence length curriculum learning, remains a promising avenue for further compute reduction.

Summary updated

BibTeX
@inproceedings{shen2022staged,
  author = {Sheng Shen and Pete Walsh and Kurt Keutzer and Jesse Dodge and Matthew E. Peters and Iz Beltagy},
  title = {{Staged Training for Transformer Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
}
Figure