Pre-training Large Language Models (LLMs) like Llama-3 is an exercise in extreme engineering and even more extreme spending. Llama-3, for instance, required over 7.7 million GPU hours, leaving a massive carbon footprint and a bill that only the largest tech titans can foot. But what if we didn't have to start from scratch every time we wanted a bigger model?
In their latest paper, "Stacking Your Transformers," researchers take a deep dive into model growth—the practice of using a smaller, already-trained model to jumpstart the training of a larger one. Their findings suggest we can achieve the same performance as traditional training while cutting compute costs by more than half.
TL;DR
By starting with a small "base" model and "stacking" its layers to create a deeper "target" model ($G_{stack}$), researchers achieved a 54.6% speedup in pre-training a 7B parameter model. The paper provides a systematic evaluation of growth strategies and practical formulas to help engineers decide exactly when and how much to grow their models.
What Problem Does This Paper Address?
The AI community has a "scaling" problem. We know that bigger models generally perform better, but training them from a random initialization (from "scratch") is incredibly inefficient.
While the concept of "model growth" isn't new, it has been plagued by three major obstacles:
- Lack of standardized evaluation: Most previous studies focused on older encoder-only models (like BERT) rather than the decoder-only architectures used by modern LLMs.
- Untested scalability: It wasn't clear if these "growth spurts" would still work when models reached billions of parameters or were trained on trillions of tokens.
- No "recipe" for success: Practitioners lacked clear guidelines on the optimal growth factor (how much bigger to get) and growth timing (how long to train the small model first).
Methods
The authors first categorized existing growth techniques into four "atomic operators":
- $G_{direct}$: Directly copying or splitting existing layers.
- $G_{learn}$: Using a learnable linear mapping to initialize the larger model (e.g., LiGO).
- $G_{zero}$: Initializing new parameters to zero to maintain the original model's output.
- $G_{random}$: Initializing new parameters randomly.
They tested these operators in both widthwise (adding neurons) and depthwise (adding layers) directions. Through systematic testing on 1.1B parameter models, they discovered that depthwise stacking ($G_{stack}$)—simply duplicating the layers of a smaller model to reach the target depth—was the clear winner.
Datasets
- Training: The models were pre-trained on SlimPajama-627B, a massive, cleaned version of the RedPajama dataset.
- Evaluation: The authors used eight standard NLP benchmarks from the Harness toolkit, including Lambada, ARC (Challenge and Easy), Logiqa, PIQA, Sciq, Winogrande, and Wikitext PPL.
- Generalization: They also validated the $G_{stack}$ method on Samba, a hybrid State Space Model (SSM), to prove it works beyond just standard Transformers.
Key Insights and Ideas
- Depth Over Width: Growing a model by adding layers is significantly more effective than adding width. Widthwise growth often failed to provide any notable advantage over training from scratch.
- Function Preservation is Overrated: Many researchers previously believed that a grown model must perfectly mimic the output of the small model at the moment of growth (Function Preservation). Surprisingly, $G_{stack}$ violates this principle but performs the best. In fact, adding a bit of noise to "break" function preservation actually improved performance in some cases.
- The Growth "Valley": There is a sweet spot for growth. If you grow too early, the base model hasn't learned enough to be a good "seed." If you grow too late, you've wasted compute on a model that has already hit its performance ceiling.
- Logarithmic Predictability: The benefit of $G_{stack}$ follows a logarithmic curve. This suggests that even as we move toward training on 10T+ tokens, model growth will continue to offer substantial savings.
Key Results
- Massive Speedup: For a 7B parameter model trained on 300B tokens, $G_{stack}$ reached the same loss as the scratch-trained baseline using only 194B tokens—a 54.6% speedup.
- Superior Benchmarks: On the eight NLP benchmarks, the $G_{stack}$ 1.1B model consistently outperformed all other growth operators and the scratch baseline.
- Practical Guidelines: The authors derived a formula to help practitioners calculate the optimal growth timing ($d$) based on their total computational budget ($C$) and target model size ($N$): $$\log_{10}(d) = 0.88 \log_{10}(N) + \frac{163.27}{\log_{10}(C)} - 5.74$$
Limitations and Future Work
While the results are impressive, the authors acknowledge a few hurdles:
- Growth Factor Constraints: Due to the high cost of experiments, they primarily focused on a growth factor of $g=4$. Exploring more granular growth factors (e.g., $g=2$ or $g=8$) remains for future work.
- Multi-hop Growth: This study focused on a "one-hop" growth process. Investigating whether growing a model multiple times (e.g., 1B $\rightarrow$ 3B $\rightarrow$ 7B) yields even better results is a promising next step.
- Theoretical Grounding: While the empirical evidence for $G_{stack}$ is strong, a rigorous theoretical explanation for why it outperforms more complex, function-preserving methods is still needed.
Summary updated