Training large-scale language models like BERT from scratch is notoriously expensive and slow. The "BERT revolution" in Natural Language Processing introduced models with hundreds of millions of parameters trained on billions of tokens, creating a high barrier to entry that requires weeks of training on expensive hardware clusters.
While hardware acceleration offers one path forward, this paper introduces an algorithmic solution: progressive stacking. By transferring knowledge from a shallow model to a deeper one, the authors demonstrate that BERT models can be trained significantly faster—achieving a ~25% speedup—without sacrificing downstream accuracy.
The Core Observation: Attention Redundancy
The fundamental question the authors pose is whether it is truly necessary to train all 12 (or 24) layers of a Transformer from a random initialization simultaneously. Could a model be "warmed up" using a smaller, faster-to-train version of itself?
The approach is rooted in a key observation about trained BERT models: attention patterns are highly redundant. Visualizations of well-trained models reveal that most layers focus on similar features, such as local neighbors (adjacent words) and the [CLS] token. Crucially, these attention patterns look remarkably similar whether a layer is at the bottom or the top of the network stack. This functional similarity suggests that a deep model is, in many ways, a more refined version of a shallow model.
Methodology: The Stacking Algorithm
To exploit this redundancy, the authors propose initializing deeper models with the weights of previously trained shallow models.
If you have a trained $L$-layer model and want to create a $2L$-layer model, the algorithm proceeds as follows:
- Copying: Instead of random initialization, the parameters of the $L$-layer model are copied twice.
- Mapping: Both the $i$-th layer and the $(i+L)$-th layer of the new, deeper model receive the weights from the $i$-th layer of the original shallow model.
- Fine-tuning: Training then continues on the newly expanded $2L$-layer model.
Progressive Stacking
The authors extend this into an iterative, progressive approach. To train a standard 12-layer BERT-Base model, they:
- Start by training a 3-layer model from scratch.
- Stack it to create a 6-layer model and continue training.
- Stack it once more to create the final 12-layer model.
This method proves far more effective than previous "function-preserving" initializations (like Net2Net), which often initialize new layers as identity mappings. The authors found that identity initialization leaves the self-attention layers effectively "untrained," whereas stacking provides a robust, functional "warm-start."
Key Results
The models were pre-trained on the English Wikipedia and BookCorpus (~3.4 billion words total) and evaluated on the GLUE (General Language Understanding Evaluation) benchmark.
- 25% Speedup: Because shallow models process data much faster (requiring less memory and fewer FLOPs per pass), doing the heavy lifting of early-stage learning in a shallow architecture saves massive amounts of wall-clock time. The progressive stacking method reached the same validation loss as the baseline BERT-Base in 338 hours compared to 441 hours on the same hardware.
- Competitive Performance: On the GLUE benchmark, the stacked model performed as well as, or slightly better than, the original BERT-Base. Notably, it achieved a significantly higher score on the CoLA task (56.2 vs. 52.1).
- Superior Initialization: The "stacked" models exhibited a characteristic drop in validation loss immediately after stacking, confirming that the transferred weights provided a vastly superior starting point compared to random initialization.
Limitations and Future Directions
While highly effective, progressive stacking introduces a new hyperparameter: the "switching threshold" ($\theta$). There is a sweet spot for when to stack; if the shallow model is trained for too long (until it fully converges), the speedup benefit diminishes. The goal is to transfer knowledge just as the shallow model begins to plateau.
Future work remains to see how this technique generalizes beyond BERT to other architectures like GANs or specialized CNNs, and whether more flexible parameter reuse strategies can yield even greater efficiencies in heavy-duty tasks like machine translation.
Summary updated