Introduction
Training state-of-the-art Transformer models is a computationally intensive endeavor, often requiring millions of dollars in compute time. Traditionally, increasing a model's capacity—such as adding layers or widening hidden dimensions—requires a complete restart from random initialization. This paper introduces a mathematical framework of six composable transformations that allow for the expansion of a Transformer model while exactly preserving its original output. By utilizing specific "function-preserving" initializations, these methods enable a "warm-start" for larger models, potentially reducing the massive costs associated with training from scratch.
The Challenge of Scaling
The primary barrier to dynamic model growth is that architectural changes typically disrupt the "knowledge" a model has acquired during pretraining. If one adds a layer or increases a hidden dimension, the mathematical mapping from input to output changes abruptly. To solve this, the authors propose a method to expand model capacity during training or to reuse smaller pretrained models as foundations for larger ones without losing progress.
A Mathematical Framework for Expansion
The authors formalize six distinct transformations that can be applied independently or in combination. Each transformation relies on minimal initialization constraints—often zero-initializing specific new weight matrices—to ensure the output of the expanded component remains identical to the original.
The framework covers the following dimensions of scaling:
- MLP Expansion: Increases the internal dimension of Feed-Forward layers.
- Head Addition: Adds entirely new attention heads.
- Heads Expansion: Increases the representation size of each existing attention head.
- Attention Expansion: Increases the dimension of keys and queries.
- Hidden Dimension Expansion: Increases the core hidden dimension ($h$) flowing through the stack.
- Layer Addition: Inserts new Transformer layers at any point.
Unlike previous work, this framework is fully composable and accounts for modern architectural features like RMSNorm and specific attention scaling factors. While empirical tests are available via Google DeepMind, the core contribution is this theoretical foundation.
Key Insights
- Exact Preservation: The authors provide mathematical proofs that the output remains identical ($f(x) = \hat{f}(x)$) at the moment of expansion.
- The Power of Zero: Most transformations rely on zero-initializing the "output" portion of new parameters. For instance, when adding a layer, if its output projection is zero-initialized, the layer acts as an identity function due to the skip connection.
- Scaling Factors: A critical detail is the treatment of attention scaling. When expanding the key/query dimension ($k$), weights must be scaled by $\sqrt{k/\hat{k}}$ to maintain softmax variance.
- Independence: Transformations operate on independent dimensions, allowing for "architectural surgery," such as increasing capacity only in specific layers.
Conclusion and Future Work
While the paper focuses on the theoretical framework and proofs, it establishes a "function-preserving subspace" that is simpler to implement than previous optimization-based approaches. Future research is needed to determine the optimal "expansion schedule" and to explore initialization strategies that, while function-preserving, might offer better training dynamics than pure zero-initialization. This framework opens the door for more efficient Neural Architecture Search (NAS) and sustainable LLM development.
Summary updated