← Back to archive
Artificial Intelligence

The Difference Between Layer Norm and RMS Norm

Norm is short for Normalization, an operation that normalizes data — generally into a distribution with mean 0 and variance 1. Compared to Layer Norm, RMS Norm omits one step of dividing by the mean.

Layer Norm directly normalizes at the layer level. There are generally two kinds: pre-normalization (pre norm) and post-normalization (post norm).

Pre-normalization normalizes the input directly and then computes the result; post-normalization computes the result first and then normalizes it uniformly.

Although some online materials suggest that Post Norm performs better than Pre Norm, in practice the popular network models of today — such as LLaMA and BLOOM — all use Pre Layer Norm, while ChatGLM uses Post Deep Norm.

Going further, LLaMA 2 switched to RMSNorm, which not only performs well but, more importantly, further improves computational efficiency.

Written by Master Sanfu on October 12, 2023. Please credit the source if you share.

Translation Notice: This English version was translated with AI assistance. Specialized, historical, religious, or culturally sensitive terms may contain nuances, inaccuracies, or debatable wording. In case of ambiguity or discrepancy, the original Chinese text shall prevail.