GPAS: Accelerating Convergence of LLM Pretraining via Gradient-Preserving Activation Scaling

Yu Li (International Digital Economy Academy) · Yang Wang (Concordia University) · Pengxiang Li (Hong Kong Polytechnic University) · Hao CHEN (The Hong Kong Univeristy of Science and Technology) · Fan Zhang (The Chinese University of Hong Kong) · Xinyuan Song (Emory University) · Shizhe Diao (NVIDIA) · Lu Yin (University of Surrey) · Shiwei Liu (University of Oxford) · Tianhao Chen (Hong Kong University of Science and Technology) · Xin Xu (The Hong Kong University of Science and Technology) · Zijing Liu (International Digital Economy Academy) · AJAY JAISWAL (The University of Texas, Austin) · Jishan Hu (The Hong Kong University of Science and Technology) · Can Yang (Hong Kong University of Science and Technology)
activation variancedeepnormgradient vanishing problemgradient-preserving activation scalinginformation preservationintermediate activationslearning capacitymodel sizesperformance gainspre-layernormresidual connectionsandwich-lnscalabilitytraining dynamicstransformer architecture

Modern Large Language Models, such as the LLaMA, Qwen and DeepSeek series, predominantly adopt the Pre-LayerNorm (Pre-LN) Transformer architecture. While being stable during pretraining and scalable to large model sizes, Pre-LN suffers from an exponential growth in activation variance across layers, causing the shortcut to dominate over sub-layer outputs in the residual connection and limiting the learning capacity of deeper layers. To mitigate this issue, we propose Gradient-Preserving Activation Scaling (GPAS), a simple technique that can be used in combination with existing approaches. GPAS works by scaling down the intermediate activations while keeping their gradients unchanged. This leaves information in the activations intact, and avoids the gradient vanishing problem associated with gradient downscaling. Extensive experiments across various model sizes from 71M to 1B show that GPAS achieves consistent performance gains. Beyond enhancing Pre-LN Transformers, GPAS also shows promise in improving alternative architectures such as Sandwich-LN and DeepNorm, demonstrating its versatility and potential for improving training dynamics in a wide range of settings. Our code is available at https://github.com/dandingsky/GPAS.