Skip to content

RMS normalisation

RMS normalisation rescales hidden activations without centring them. Understand its second moment, learned gain, epsilon convention and feature-axis choices.

RMS normalisation rescales a vector of hidden activations by its root mean square, without subtracting its mean. Usually called RMSNorm, it gives a neural network a way to control representation scale while allowing its mean to remain nonzero. In an encoder for financial text or market sequences, that is an architectural choice about hidden features, rather than a procedure for estimating return volatility.

A scale computed from squares

For a group of dd hidden coordinates, write

q=1d∑j=1dxj2,zi=xiq+ε,yi=γizi.q=\frac{1}{d}\sum_{j=1}^{d}x_j^2, \qquad z_i=\frac{x_i}{\sqrt{q+\varepsilon}}, \qquad y_i=\gamma_i z_i.
Here qq is the uncentered second moment across the selected coordinates. It is not their variance: variance measures squared deviations from the mean. The positive constant ε\varepsilon protects the denominator at zero, while the learned gain γi\gamma_i adjusts each output coordinate.
This uses the epsilon-under-the-square-root convention documented by PyTorch RMSNorm and its current upstream implementation, checked on 1 November 2026. A denominator q+ε\sqrt{q}+\varepsilon defines a different operation; record the exact convention when reproducing a model. Learned gains and additive biases also depend on the implementation: PyTorch's RMSNorm has optional gains and no additive bias parameter. Zhang and Sennrich's original paper, equation (4), defines RMS rescaling with gain, while equation (5) places a bias before the subsequent activation. Neither “always has a bias” nor “bias is forbidden” is a universal architectural rule.

The output can still be all positive

Take a synthetic dimensionless hidden vector x=(1,2,3)x=(1,2,3). To isolate the arithmetic, use gain one and epsilon zero for this nonzero-RMS example only:
RMS⁡(x)=1+4+93=143≈2.16024690,\operatorname{RMS}(x)=\sqrt{\frac{1+4+9}{3}}=\sqrt{\frac{14}{3}}\approx2.16024690, z≈(0.46291005, 0.92582010, 1.38873015).z\approx(0.46291005,\ 0.92582010,\ 1.38873015).
Its mean square is one, but its mean is approximately 0.925820100.92582010, not zero. Rescaling has preserved the positive direction of every coordinate. By contrast, layer normalisation subtracts the group's mean before dividing by a centred scale.
Synthetic vector 1, 2, 3 becomes approximately 0.463, 0.926, 1.389 after RMS scaling. Output mean is approximately 0.92582 and mean square is one. All coordinates remain positive; epsilon is zero only for this nonzero-vector toy, with gain one.
Synthetic vector 1, 2, 3 becomes approximately 0.463, 0.926, 1.389 after RMS scaling. Output mean is approximately 0.92582 and mean square is one. All coordinates remain positive; epsilon is zero only for this nonzero-vector toy, with gain one.
Original synthetic hidden-vector calculation. Values are dimensionless; the common vertical scale makes the rescaling visible. The dashed line marks the positive output mean, not a centring target.

With positive epsilon and gain one, the output mean square is q/(q+ε)q/(q+\varepsilon), generally below one. Nonuniform learned gains can change it again. “RMS-normalised” therefore does not promise a final mean square of exactly one.

For nonzero vectors and epsilon zero, multiplying every input by the same positive constant leaves the normalised vector unchanged. Fixed positive epsilon breaks that exact scale invariance, though the difference becomes small when the squared signal scale dominates epsilon. Adding a common constant is not an invariance: it generally changes the vector's direction relative to the origin. A nonzero constant vector does not disappear as it would after mean subtraction.

Which coordinates share the denominator?

For a tensor with batch, time and feature axes, a common sequence-model choice computes one RMS across hidden features for each item at each time separately. No other batch member supplies that denominator. In contrast, training-time batch normalisation pools examples for each feature; layer normalisation uses a within-example group but also centres it. Extra spatial or temporal axes require an explicit decision, not an assumption based on the method's name. The Keras RMSNormalization documentation exposes this choice through its axis argument.
Feature-wise RMSNorm does not make an entire sequence model causal. A hidden vector may already contain future information, and pooling the denominator over future time positions can introduce look-ahead bias directly. Point-in-time inputs, causal sequence operations and chronological evaluation remain separate requirements. Rescaling hidden activations also does not replace training-only preprocessing of raw financial inputs with different units.
Finally, RMSProp is an optimiser, not an activation-normalisation layer: it accumulates squared gradients across training steps to scale parameter updates. See SGD, Momentum, RMSProp, and Adam as Optimization Choices (public preview; full lesson requires membership) for that distinction. Removing mean subtraction makes RMSNorm's statistic simpler than layer normalisation's; any runtime or forecasting benefit still needs measurement in the actual architecture and task.

Sources

Last updated
  • rmsnorm
  • neural networks
  • hidden activations
  • sequence models
← Back to the glossaryBack to top ↑