Summary
The paper analyses the two common types of normalization layers in Transformers: LayerNorm and RMSNorm (root-mean-square-norm). LayerNorm scales all vectors to be of the same norm, while changing the vectors' "directions". RMSNorm, in contrast, keeps the same direction, but just rescales the vectors to the same constant norm.
The authors "unify" both approaches, by showing how to force LayerNorm to act like RMSNorm. Then, since RMSNorm is faster to compute, the authors argue that this conversion (LayerNorm -> RMSNorm) can get the expressivity benefits of LayerNorm with the speed of RMSNorm.
Finally, the authors propose C-RMSNorm, which saves 1 dimension. For example, if the model hidden size is 1024, C-RMSNorm allows reducing it to 1023 while calculating the norm.
Overall, the authors argue that these changes can reduce the training and inference time of LayerNorm transformers by 10% (although without discussing whether there's a reduction in performance/accuracy).
Strengths
## Strengths
+ The authors provide a thorough explanation of LayerNorm vs. RMSNorm.
+ The authors show the relation between LayerNorm vs. RMSNorm, which I haven't seen in any other paper.
+ The proposed approaches can sometimes reduce inference and training time, which is an important problem that solving can save millions and save carbon emmission.
Weaknesses
## Weaknesses
- I'm not sure about the soundness of some of the claims. The authors argue that LayerNorm is **equivalent** to RMSNorm and even write explicitly `PreLN Trasnformer = Pre-RMSNorm Transformer` (Eq 4). However, they only show one direction of this equality: the authors show how to take a Pre-LayerNorm transformer, and by imposing specific values to weights and enforcing constraints it can be equivalent to RMSNorm. That is, by constraining LayerNorm you can achieve RMSNorm. To my understanding, this means that Pre-LayerNorm is **at least** as expressive as Pre-RMSNorm. But what about the other direction? Maybe Pre-LayerNorm is more expressive if we do not impose these constraints? Can we take a Pre-RMSNorm and make it a Pre-LayerNorm?
- Similarly, I am not sure that the authors prove both directions when claiming in Section 3.2 that `Pre-RMSNorm = Pre-C-RMSNorm`.
- Novelty - The authors claim to "propose Pre-RMSNorm". Is this proposal novel? aren't models such as LLaMA already using Pre-RMSNorm?
- Another issue with soundness: the authors write multiple times that these conversions are "free efficiency improvement" and "free lunch". However, in Line 228 they write: "We have to pay the extra cost for training for the parameter change". So, what exactly do the authors mean by "free lunch" if there is an extra training cost, and the accuracy is not guaranteed to be the same?
- Many evaluation details are missing.
- On which datasets do the authors perform the experiments?
- How can the authors perform training and inference with **GPT-3**? As far as I know, GPT-3 is not open-sourced. Further, the authors mention they used "**GPT3 XL and 2.7B**". What exactly do they mean here? What is "**GPT3 XL**"? and what is "**GPT3 2.7B**", Is there such a model? The sizes of GPT-3 that I know about are much bigger than 2.7B. Where exactly this model was taken from and what exactly do the authors mean?
Questions
## Questions
1. Section 3.1 says that "LayerNorm is applied to the main branch vectors before they are used in either residual branches or the final postprocessing. Therefore, we can replace the main branch vectors $x_l$ with $x_l + k_l\mathbb{1}$" - I am not sure I agree. I agree that since LayerNorm is invariant to the shifting $LN(x) = LN(x_l + k_l\mathbb{1})$, the replacement will not change the output of the **residual branch**. However, if we replace the main branch vectors as suggested, the summation of the main branch and the residual branch that happens at the end of each transformer layer - is no longer identical to its original version.
2. In most of the cases in Figures 3+4, C-RMSNorm is slower than RMSNorm. So what is the benefit of C-RMSNorm?
3. Evaluation - the evaluation compares only the speed of training/inference of different normalization layers, without discussing the result of the training. Maybe Pre-RMSNorm is faster than Pre-LayerNorm, but needs to be trained for 10% **more steps** to reach the same training loss? Maybe even after training longer, it does not achieve the same test accuracy? I will not be surprised if that's the case: since the authors showed that RMSNorm is a special case of LayerNorm, I would expect LayerNorm to be more expressive and possibly reach better results, or reach these results within fewer steps.
4. On which datasets were the experiments conducted? What was the downstream accuracy of each model?
5. What exactly are the GPT-3 models mentioned in the evaluation?
6. Are the claims and findings in this paper related to the findings in the following papers regarding LayerNorm?
* ["On the Expressivity Role of LayerNorm in Transformers' Attention", Brody et al., EMNLP'2023](https://lessw.medium.com/what-layernorm-really-does-for-attention-in-transformers-4901ea6d890e)
* ["Understanding and Improving Layer Normalization", Xu et al., NeurIPS 2019](https://arxiv.org/pdf/1911.07013.pdf)
* ["On Layer Normalization in the Transformer Architecture", Xiong et al., ICML 2020](https://arxiv.org/pdf/2002.04745.pdf)
I'm not asking this question to make the authors just cite these papers, I am actually trying to understand whether this paper is consistent with, is orthogonal to, or contradicts these papers, since these are some of the most significant papers that were written about the analysis of LayerNorm that I know of, and none of them is discussed.
## Summary
Overall, the paper provides a thorough analysis and comparison of LayerNorm and RMSNorm, and provides insights that lead to 10% reduced inference and training time. If these improvements are valid and real, a 10% reduction is significant and important.
However, there are many questions regarding the validity of the evaluation and the soundness of the claims. Therefore, I'm currently voting for a borderline reject, until the authors clarify all the issues above. I will raise my score if all issues are explained and resolved.
Rating
7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.
Confidence
3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.