🤖 AI Summary
In deep Transformer training, the choice of normalization placement—Pre-Norm ensures stability but limits expressivity, while Post-Norm offers superior performance yet suffers from training divergence. To resolve this trade-off, we propose HybridNorm: a heterogeneous intra-block normalization scheme wherein LayerNorm is applied separately to the query, key, and value projections (QKV-Norm) within the attention branch, while Post-Norm is retained in the feed-forward network (FFN) branch. This design achieves the first fine-grained decoupling of normalization paths within a single Transformer block, preserving identity-mapping stability during optimization while enhancing representational capacity. Extensive experiments across multiple large language model (LLM) benchmarks demonstrate that HybridNorm significantly improves training stability, accelerates convergence, and outperforms both Pre-Norm and Post-Norm baselines—achieving state-of-the-art (SOTA) performance. The implementation is publicly available.
📝 Abstract
Transformers have become the de facto architecture for a wide range of machine learning tasks, particularly in large language models (LLMs). Despite their remarkable performance, challenges remain in training deep transformer networks, especially regarding the location of layer normalization. While Pre-Norm structures facilitate easier training due to their more prominent identity path, they often yield suboptimal performance compared to Post-Norm. In this paper, we propose $ extbf{HybridNorm}$, a straightforward yet effective hybrid normalization strategy that integrates the advantages of both Pre-Norm and Post-Norm approaches. Specifically, HybridNorm employs QKV normalization within the attention mechanism and Post-Norm in the feed-forward network (FFN) of each transformer block. This design not only stabilizes training but also enhances performance, particularly in the context of LLMs. Comprehensive experiments in both dense and sparse architectures show that HybridNorm consistently outperforms both Pre-Norm and Post-Norm approaches, achieving state-of-the-art results across various benchmarks. These findings highlight the potential of HybridNorm as a more stable and effective technique for improving the training and performance of deep transformer models. %Code will be made publicly available. Code is available at https://github.com/BryceZhuo/HybridNorm.