Hyper-Connections
Defa Zhu, Hongzhi Huang, Zihao Huang, Yutao Zeng, Yunyao Mao, Banggu Wu, Qiyang Min, Xun Zhou
TL;DR
Hyper-Connections (HC) replace fixed residual strengths with learnable depth-connections and width-connections, enabling dynamic layer rearrangement in transformers. The framework includes static HC (SHC) and dynamic HC (DHC), initialized to mimic Pre-Norm residuals and extended with input-dependent parameters, respectively. Across dense and MoE language models up to 7B and in vision tasks, DHC yields faster convergence and improved accuracy (e.g., improved ARC-Challenge performance and reduced losses), with large-scale 7B results showing stable training and fewer spikes. Visualization uncovers a Lambda-shaped pattern of cross-layer interactions, supporting HC’s ability to balance long-range and local connectivity while incurring negligible parameter and compute overhead. Overall, HC provides a broadly applicable, effective alternative to residual connections in deep networks.
Abstract
We present hyper-connections, a simple yet effective method that can serve as an alternative to residual connections. This approach specifically addresses common drawbacks observed in residual connection variants, such as the seesaw effect between gradient vanishing and representation collapse. Theoretically, hyper-connections allow the network to adjust the strength of connections between features at different depths and dynamically rearrange layers. We conduct experiments focusing on the pre-training of large language models, including dense and sparse models, where hyper-connections show significant performance improvements over residual connections. Additional experiments conducted on vision tasks also demonstrate similar improvements. We anticipate that this method will be broadly applicable and beneficial across a wide range of AI problems.
