[Paper Review] The Stability-Efficiency Dilemma: Investigating Sequence Length Warmup for Training GPT Models
This paper proposes Sequence Length Warmup (SLW), a method that improves training stability and efficiency in GPT-style models by gradually increasing sequence length during pre-training. SLW enables stable training with up to 8x larger batch sizes and 40x larger learning rates, reducing wall clock time by 3.7x and data usage by 10x while retaining 99% of zero-shot accuracy in GPT-3 125M experiments.
Recent works have demonstrated great success in pre-training large-scale autoregressive language models on massive GPUs. To reduce the wall-clock training time, a common practice is to increase the batch size and learning rate. However, such practice is often brittle and leads to a so-called stability-efficiency dilemma: increasing the batch sizes and learning rates leads to better training efficiency but can also result in training instability, leading to poor generalization accuracy or failed runs. To better understand this phenomenon, we conduct an in-depth analysis on large-scale pre-training experiments replicating the GPT-2 model. We find that there is a strong correlation between training instability and extreme values of gradient variance, and that samples with long sequence lengths contribute to these extreme gradient variance values, especially at the beginning of the training, indicating that long sequence length can be a main source of training instability. Based on the analysis, we present a Sequence Length Warmup method that aims to solve the training stability-efficiency dilemma. Experiments replicating GPT-2 models show that our approach enables stable training with 8x larger batch size and 4x larger learning rate, whereas the baseline approach struggles with training instability. To achieve the same or better zero-shot evaluation results, our method reduces the required number of training tokens and wall clock time by up to 2.2x and 3.7x, respectively. Experiments replicating GPT-3 model (125M) show that our approach enables stable training with 8x larger batch size and 40x larger learning rate, and retains 99% of the zero-shot accuracy on 11 tasks using 10x less data and 17x less time compared to the original GPT-3 training recipe, while the baseline diverges under the same settings and only retain 95% of accuracy under lower learning rate.
Motivation & Objective
- Address the stability-efficiency dilemma in large-scale GPT pre-training, where increasing batch size and learning rate improves efficiency but causes training instability.
- Investigate the root causes of training instability, particularly the role of gradient variance outliers in early training.
- Explore whether sequence length influences training stability and whether a curriculum-like training schedule can improve convergence.
- Develop a lightweight, tunable method that enables stable training with aggressive hyperparameters without requiring full-scale retraining.
- Demonstrate data and time efficiency gains in both GPT-2 and GPT-3 model reproductions, showing practical benefits for large-scale model training.
Proposed method
- Propose Sequence Length Warmup (SLW), a training schedule that starts with short sequences (e.g., 128 tokens) and gradually increases to the target length (e.g., 2048 tokens) over a defined number of steps.
- Introduce a warmup phase where the model is trained on shorter sequences first, reducing gradient variance outliers during early training when model weights are randomly initialized.
- Use a linear or stepwise schedule to increase sequence length over a fixed number of training steps, avoiding abrupt jumps to long sequences.
- Apply the method to both GPT-2 (117M and 1.5B) and GPT-3 (125M) models, with minimal hyperparameter tuning required.
- Combine SLW with standard training recipes, including learning rate and batch size scaling, to evaluate stability and efficiency trade-offs.
- Use gradient variance analysis to validate that SLW reduces extreme gradient variance values, especially in early training, linking it to improved stability.
Experimental results
Research questions
- RQ1What is the relationship between sequence length and training instability in GPT-style models during early training?
- RQ2How do gradient variance outliers correlate with training divergence, and can they be mitigated by modifying the training schedule?
- RQ3Can a curriculum-like approach—starting with shorter sequences—improve training stability without sacrificing convergence speed?
- RQ4To what extent can SLW enable larger batch sizes and learning rates while maintaining or improving model performance?
- RQ5How does SLW affect data and time efficiency in large-scale pre-training, particularly when compared to baseline recipes?
Key findings
- Training instability is strongly correlated with extreme values in gradient variance, especially during early training with long sequences.
- Long sequence lengths are a primary source of gradient variance outliers, which lead to training divergence when batch size and learning rate are increased.
- SLW enables stable training with 8x larger batch size and 4x larger learning rate on GPT-2 1.5B, reducing wall clock time by 3.7x and training tokens by 2.2x.
- On GPT-3 125M, SLW allows stable training with 40x larger learning rate, achieving 10x data reduction and 17x time reduction while retaining 99% of the original zero-shot accuracy.
- The baseline method diverges under 40x learning rate but only retains 95% accuracy under 30x learning rate; SLW maintains 99% accuracy under the same aggressive settings.
- In a 1.3B GPT-3 model experiment, SLW improves average zero-shot accuracy from 41.6 to 41.9 and few-shot accuracy from 44.8 to 45.3 under the same 300B token budget, demonstrating improved data efficiency.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.