EasyDeepLearn

How does RMSNorm differ from LayerNorm?

medium

Answer

  • RMSNorm(x) = x / RMS(x) * γ, where RMS(x)  =  sqrt(mean(x2)  +  ε)\mathrm{RMS}(x)\; = \;\mathrm{sqrt}(\mathrm{mean}(x^{2})\; + \;{\varepsilon}).
  • Skips the mean-subtraction and β (bias) of LayerNorm.
  • About 10-30% faster (fewer ops), similar accuracy on transformers.
  • Adopted by LLaMA, T5, and most 2023+ open LLMs.
Check yourself — multiple choice
  • RMSNorm subtracts the mean like LayerNorm
  • Divide by RMS only (no mean subtraction, no bias) — faster than LN, standard in LLaMA/T5
  • RMSNorm requires batch stats
  • RMSNorm is a loss function

RMSNorm skips mean and bias — faster, adopted by LLaMA/T5.

#normalization#transformers

Practise Deep Learning

214 interview questions in this topic.

Related questions