2025-03-07 · 进阶 · 机器学习 · 自然语言处理

HybridNorm: Towards Stable and Efficient Transformer Training via Hybrid Normalization

本文提出了一种名为HybridNorm的混合归一化策略,通过结合预归一化和后归一化的优势,提高了Transformer模型的训练稳定性和性能。

更新于 2025-03-09。作者:Zhijian Zhuo、Yutao Zeng、Ya Wang、Sijun Zhang、Jian Yang、Xiaoqing Li、Xun Zhou、Jinwen Ma。

中文摘要

变压器已成为广泛机器学习任务的默认架构,尤其是在大型语言模型(LLMs)中。尽管它们的性能非凡,但在训练深层变压器网络方面仍存在挑战,尤其是在层归一化的位置。虽然Pre-Norm结构由于其更突出的恒等路径而便于训练,但与Post-Norm相比,它们往往会产生次优性能。在本文中,我们提出了HybridNorm,这是一种简单而有效的混合归一化策略,它结合了Pre-Norm和Post-Norm方法的优势。具体来说,HybridNorm在注意力机制中使用QKV归一化,在每个变压器块的卷积前馈网络(FFN)中使用Post-Norm。这种设计不仅稳定了训练,而且提高了性能,尤其是在LLMs的背景下。在密集和稀疏架构上的全面实验表明,HybridNorm始终优于Pre-Norm和Post-Norm方法,在各个基准测试中实现了最先进的结果。这些发现突出了HybridNorm作为提高深层变压器模型训练和性能的更稳定和有效技术的潜力。%代码将公开提供。代码可在https://github.com/BryceZhuo/HybridNorm获取。

英文摘要

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.

解读

一句话总结

本文提出了一种名为HybridNorm的混合归一化策略,通过结合预归一化和后归一化的优势,提高了Transformer模型的训练稳定性和性能。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt