HybridNorm: Verso un Addestramento Stabile ed Efficiente dei Transformer tramite Normalizzazione Ibrida
HybridNorm: Towards Stable and Efficient Transformer Training via Hybrid Normalization
March 6, 2025
Autori: Zhijian Zhuo, Yutao Zeng, Ya Wang, Sijun Zhang, Jian Yang, Xiaoqing Li, Xun Zhou, Jinwen Ma
cs.AI
Abstract
I Transformer sono diventati l'architettura di fatto per un'ampia gamma di
compiti di machine learning, in particolare nei grandi modelli linguistici (LLM).
Nonostante le loro prestazioni notevoli, rimangono sfide nell'addestramento di reti
Transformer profonde, specialmente riguardo alla posizione della normalizzazione
a strati (layer normalization). Sebbene le strutture Pre-Norm facilitino un
addestramento più semplice grazie al loro percorso identitario più prominente,
spesso producono prestazioni subottimali rispetto al Post-Norm. In questo articolo,
proponiamo HybridNorm, una strategia di normalizzazione ibrida semplice ma
efficace che integra i vantaggi sia dell'approccio Pre-Norm che Post-Norm.
Nello specifico, HybridNorm utilizza la normalizzazione QKV all'interno del
meccanismo di attenzione e Post-Norm nella rete feed-forward (FFN) di ogni blocco
Transformer. Questo design non solo stabilizza l'addestramento ma migliora anche
le prestazioni, specialmente nel contesto degli LLM. Esperimenti completi sia in
architetture dense che sparse dimostrano che HybridNorm supera costantemente
entrambi gli approcci Pre-Norm e Post-Norm, raggiungendo risultati all'avanguardia
in vari benchmark. Questi risultati evidenziano il potenziale di HybridNorm come
tecnica più stabile ed efficace per migliorare l'addestramento e le prestazioni di
modelli Transformer profondi. %Il codice sarà reso pubblicamente disponibile. Il codice è disponibile su
https://github.com/BryceZhuo/HybridNorm.
English
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 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.Summary
AI-Generated Summary