享受RMSNorm的计算效率:层归一化
Enjoy Your Layer Normalization with the Computational Efficiency of RMSNorm
AI总结:
本文提出一种框架,确定任意DNN中的层归一化是否可替换为RMSNorm而不改变模型功能,通过折叠归一化操作提升效率,实验显示可提升2%-12%的推理速度。
摘要:
层归一化(LN)是现代深度学习中的基本组件,但其每个样本的中心化和缩放操作引入了不可忽视的推理开销。RMSNorm通过移除中心化操作提高效率,但可能舍弃与中心化相关的益处。本文提出一种框架,确定任意DNN中的LN是否可被RMSNorm替代而不改变模型功能。关键思想是通过强制零均值输出的列中心约束(CCC)和基于列的权重中心化(CBWC)将LN的中心化操作折叠到上游通用线性层中。我们扩展分析至任意DNN,定义此类LN为可折叠LN,并开发基于图的检测算法。分析显示,许多广泛使用的架构中的LN是可折叠的,使精确的推理时间转换成为可能,并在不改变模型预测的情况下实现端到端加速2%至12%。在多个任务家族上的实验进一步表明,当精确等价性在实际训练设置中部分被破坏时,本方法仍能与vanilla LN竞争,同时提高效率。
英文摘要:
Layer normalization (LN) is a fundamental component in modern deep learning, but its per-sample centering and scaling introduce non-negligible inference overhead. RMSNorm improves efficiency by removing the centering operation, yet this may discard benefits associated with centering. This paper propose a framework to determine whether an LN in an arbitrary DNN can be replaced by RMSNorm without changing the model function. The key idea is to fold LN's centering operation into upstream general linear layers by enforcing zero-mean outputs through the column-centered constraint (CCC) and column-based weight centering (CBWC). We extend the analysis to arbitrary DNNs, define such LNs as foldable LNs, and develop a graph-based detection algorithm. Our analysis shows that many LNs in widely used architectures are foldable, enabling exact inference-time conversion and end-to-end acceleration of 2% to 12% without changing model predictions. Experiments across multiple task families further show that, when exact equivalence is partially broken in practical training settings, our method remains competitive with vanilla LN while improving efficiency.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。