---
title: "LayerNorm and RMSNorm Keep Different Information in an Activation Vector"
description: "Leviathan Systems — Technical content Published 2026-10-22; updated 2026-10-22."
canonical: "https://www.leviathansystems.co/articles/layernorm-rmsnorm-centering-activation-output"
last-updated: "2026-10-22"
---

# LayerNorm and RMSNorm Keep Different Information in an Activation Vector

Leviathan Systems — Technical content
Published 2026-10-22; updated 2026-10-22.

Centering removes the component shared equally by all features in the normalized vector. In NORM24, A = (0, 2) and B = (2, 4) both become (-1/√2, 1/√2) under the stipulated LayerNorm. RMSNorm instead gives (0, 2/√3) and (2/√11, 4/√11). With the same feature axis, unit gains and epsilon = 1, that substitution fails the requirement to preserve both LayerNorm outputs.

## NORM24 fixes the required output and every comparison setting

Suppose a software proposal offers RMSNorm in place of a specified LayerNorm operation. The requirement is precise: preserve the LayerNorm forward output on both supplied activation vectors A = (0, 2) and B = (2, 4). A forward output here is the vector delivered by this normalization operation, before any subsequent layer.

NORM24 is an original stipulated arithmetic example. Each row is an independent dimensionless two-feature vector in an array shaped [rows, 2]. Both operators normalize only the last feature axis, corresponding to normalized_shape = (2,) in the historical PyTorch v2.9.0 interface. No statistic pools features from different rows.

Hold both gains at gamma = (1, 1), LayerNorm bias at beta = (0, 0), and epsilon at 1 inside each square root. LayerNorm variance uses divisor 2, rather than a sample-variance correction. The named RMSNorm interface has gain without an additive bias parameter. Epsilon = 1 makes the radicals transparent; it is neither a framework default nor a recommended setting.

All results below use exact real-number formulas. Rounded decimal values only help read the radicals. No framework or model was executed, and no training, task-quality or performance result is supplied.

References: [PT29](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py)

## The two denominators measure different parts of the vector

For x = (x₁, x₂), define its mean μ = (x₁ + x₂)/2, centered variance v = [(x₁ − μ)² + (x₂ − μ)²]/2, and uncentered mean square m₂ = (x₁² + x₂²)/2. Under NORM24's settings, LayerNorm gives (x − μ)/√(v + 1), while RMSNorm gives x/√(m₂ + 1), component by component.

Ba, Kiros and Hinton's July 2016 Layer Normalization paper defines statistics within one case. Zhang and Sennrich's October 2019 RMSNorm paper removes mean subtraction and uses the root mean square. The historical PyTorch definition supplies the explicit epsilon convention used here.

Expanding the centered squares gives v = m₂ − μ², hence m₂ = v + μ². LayerNorm's denominator depends on spread around the mean. RMSNorm's denominator includes that spread plus the squared mean.

Write the input as x = μ(1, 1) + (x − μ). The first term is a common feature offset. Centering removes it; the remaining components sum to zero. RMSNorm with unit gains multiplies the entire original vector by one positive scalar, preserving its direction when the input is nonzero. It does not subtract that common component.

References: [LN16](https://arxiv.org/pdf/1607.06450v1), [RMS19](https://arxiv.org/pdf/1910.07467v1), [PT29](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py)

## A: centering turns (0, 2) into opposite-signed components

For A = (0, 2), the mean is (0 + 2)/2 = 1. Subtracting it gives (-1, 1). The centered variance is [(-1)² + 1²]/2 = 1, while the mean square is (0² + 2²)/2 = 2. The identity checks: 2 = 1 + 1².

LayerNorm's denominator is √(1 + 1) = √2. Its complete output is LN(A) = (-1/√2, 1/√2), approximately (-0.707107, 0.707107).

RMSNorm's denominator is √(2 + 1) = √3. Its complete output is RMS(A) = (0, 2/√3), approximately (0, 1.154701).

The first feature makes the mechanism especially visible. It is below A's mean, so its centered output is negative. Uncentered scaling leaves its original zero equal to zero. Matching the gain, epsilon and included features does not remove this difference in the numerator.

References: [PT29](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py)

## B: adding the same offset changes RMSNorm but leaves LayerNorm unchanged

Now use B = A + (2, 2) = (2, 4). Its mean is (2 + 4)/2 = 3. Centering again gives (-1, 1), and the centered variance remains 1. Its mean square is (2² + 4²)/2 = 10. Again the identity holds: 10 = 1 + 3².

LayerNorm therefore keeps denominator √2 and output LN(B) = (-1/√2, 1/√2). Both required LayerNorm outputs are identical because their centered vectors and variances are identical.

RMSNorm now has denominator √(10 + 1) = √11. Its output is RMS(B) = (2/√11, 4/√11), approximately (0.603023, 1.206045). It differs from LN(B), and it also differs from RMS(A).

A and B have the same feature ordering and the same difference of 2 between their components. They have different common offsets and different directions from the origin. LayerNorm discards the offset before scaling. RMSNorm scales each original direction using a denominator that also changes with the offset. The proposed substitution consequently fails on each required input.

References: [PT29](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py)

## Centering deliberately loses the common-offset information

The equality is more general than these two rows. Add a common scalar c to every feature of a vector, retaining the same normalized population. Its mean becomes μ + c. Each centered component is (xᵢ + c) − (μ + c) = xᵢ − μ, so its centered variance also stays unchanged.

With fixed epsilon, LayerNorm therefore delivers the same normalized vector before affine transformation. Applying the same fixed gain and bias afterward preserves that equality. This identity survives positive epsilon because neither the centered numerator nor the variance changed.

For RMSNorm, the shifted mean square is m₂ + 2cμ + c², and the numerator becomes x + c. NORM24 uses c = 2 and μ = 1, so A's mean square rises from 2 to 2 + 4 + 4 = 10. This accounts for B's √11 denominator.

The information consequence is concrete: a recipient of the LayerNorm output alone cannot distinguish A from B in this case. RMSNorm returns different vectors for them. That observation concerns this operation's output; a wider model may carry other information through separate paths.

References: [LN16](https://arxiv.org/pdf/1607.06450v1), [RMS19](https://arxiv.org/pdf/1910.07467v1)

## C agrees because its mean is zero; D exposes a retained common component

Take C = (-1, 1). Its mean is 0, its centered vector is (-1, 1), its variance is 1, and its mean square is 1. Both denominators are √2, giving LN(C) = RMS(C) = (-1/√2, 1/√2). With these matched parameters and epsilon, zero mean makes the two formulas coincide.

That agreement answers C's calculation. It cannot establish replacement on A and B, whose explicit outputs disagree. Testing only a zero-mean vector would omit the common-offset effect the requirement needs to assess.

Now take the constant vector D = (2, 2). Its mean is 2 and its centered vector is (0, 0). Variance is 0, mean square is 4, and 4 = 0 + 2². LayerNorm divides (0, 0) by √(0 + 1) = 1, giving LN(D) = (0, 0).

RMSNorm divides the original vector by √(4 + 1) = √5, giving RMS(D) = (2/√5, 2/√5), approximately (0.894427, 0.894427). D contains only a common component. Centering removes all of it, whereas RMS scaling leaves a nonzero output. Positive epsilon makes both calculations defined, including the zero-variance LayerNorm case.

References: [RMS19](https://arxiv.org/pdf/1910.07467v1), [PT29](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py)

## Current-input statistics are separate from learned parameters

The means 1, 3, 0 and 2 belong to the supplied rows. They are calculated from those rows, rather than learned entries selected from a checkpoint. The same distinction holds for their variances and mean squares. These formulas use no retained running mean or running variance.

Gain and bias serve another role. The affine LayerNorm expression is yᵢ = gammaᵢ(xᵢ − μ)/√(v + epsilon) + betaᵢ. Gain and any included bias are learned parameters held fixed during this comparison. Epsilon is a separately fixed setting. A stored gain of 1 is not an estimate of the next input's spread.

Arbitrary learned affine values need not leave LayerNorm's delivered mean at zero or variance at one. They do retain the common-shift equality when identical parameters are applied to both shifted inputs. RMSNorm with nonuniform gains likewise need not preserve the original vector's direction; the direction statement above depends on NORM24's unit gains.

The related evaluation-mode guide owns the separate module-state and autograd questions. Recalculating an input statistic establishes neither a training update nor a full checkpoint-conversion result.

References: [LN16](https://arxiv.org/pdf/1607.06450v1), [PT29](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py)

## Positive epsilon changes unit-scale and rescaling claims

Even before nontrivial affine parameters, NORM24 does not produce unit variance or unit RMS universally. A's LayerNorm output has zero mean and variance [(1/2) + (1/2)]/2 = 1/2. A's RMSNorm output has mean square [0 + (4/3)]/2 = 2/3, so its RMS is √(2/3).

These values follow directly from retaining the added 1. More generally, the pre-affine LayerNorm variance is v/(v + epsilon), while the unit-gain RMSNorm mean square is m₂/(m₂ + epsilon). Normalization does not make either fraction exactly one when epsilon is positive and the corresponding moment is finite.

Positive rescaling also differs from adding a common offset. For s > 0, applying unit-gain RMSNorm to sx yields x/√(m₂ + epsilon/s²). That need not equal x/√(m₂ + epsilon). LayerNorm has the corresponding expression (x − μ)/√(v + epsilon/s²). The epsilon-free paper identities therefore cannot be copied as universal exact equalities for a fixed positive-epsilon implementation.

For a direct NORM24 check, 2C = (-2, 2) gives both outputs (-2/√5, 2/√5), which differ from C's (-1/√2, 1/√2). The operators still agree on these zero-mean inputs while neither preserves its output under this positive rescaling.

References: [LN16](https://arxiv.org/pdf/1607.06450v1), [RMS19](https://arxiv.org/pdf/1910.07467v1), [PT29](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py)

## Resolve the offered substitution against the required forward map

For the stipulated requirement, retaining the specified LayerNorm calculation supplies the required outputs on A and B. The offered RMSNorm calculation supplies different values on both. C's agreement does not repair either mismatch, and D shows the same underlying distinction at zero centered variance.

A useful proposal response connects the required activation values and feature population to the complete formulas, epsilon placement and value, variance divisor, gain entries and bias treatment. Its numerical explanation should account for A and B's means, centered vectors, both moments and full outputs. A response supplying only C leaves the decisive common-offset comparison unanswered.

Changing learned parameters, preprocessing the inputs or adding compensating operations creates a changed proposal to assess on its own terms. Those changes cannot be silently inserted into this fixed comparison. NORM24 neither selects a normalization architecture nor predicts the consequences of retraining a model.

The adjacent softmax guide concerns probability denominators; the vector-metric guide concerns retrieval ranking; the quantized-memory guide concerns representation and capacity. Here the completed decision is the activation forward map: centering intentionally removes a feature-common offset that uncentered RMS scaling still reflects.

## Connect an independently required physical installation

This arithmetic creates no equipment requirement. If a wider project independently needs selected servers or other IT equipment mounted, Leviathan's Rack-and-Stack Installation service and linked project inquiry provide a route to discuss that physical package.

Share a nonconfidential equipment summary, site, approved rack positions, mounting inputs and required handoff to discuss scope and availability. Model implementation, normalization changes and numerical acceptance remain with the appointed software and application owners.

## Primary sources

- [LN16 — Ba, Kiros and Hinton — Layer Normalization, v1, July 21, 2016](https://arxiv.org/pdf/1607.06450v1). Checked 2026-10-22. Section 3, equation (3), and section 3.1, equation (4), define within-case centered statistics and distinguish them from gain and bias. Historical mathematical context; the worked example states its own epsilon.
- [RMS19 — Zhang and Sennrich — Root Mean Square Layer Normalization, v1, October 16, 2019](https://arxiv.org/pdf/1910.07467v1). Checked 2026-10-22. Section 3, equations (2)–(3), and section 4, equation (4), contrast centered variance with uncentered RMS and explain zero-mean agreement. NORM24 adds an explicit matched stabilizer; experimental performance claims are not adopted.
- [PT29 — PyTorch v2.9.0 — LayerNorm and RMSNorm definitions](https://raw.githubusercontent.com/pytorch/pytorch/v2.9.0/torch/nn/modules/normalization.py). Checked 2026-10-22. Historical tagged docstrings, constructors, parameter initialization and forward methods establish normalized axes, divisor-n variance, epsilon placement and affine parameter roles. The source is read as a definition; no installed deployment or execution result is asserted.

## Related Leviathan resources

- [Softmax: class and input denominator populations](/articles/ai-softmax-class-batch-axis-normalization)
- [Vector metrics: magnitudes, directions and retrieval rankings](/articles/ai-vector-metric-norms-neighbor-ranking)
- [Evaluation mode and autograd recording](/articles/pytorch-evaluation-mode-versus-autograd-recording)
- [Quantized weights and total inference memory](/articles/quantized-model-weights-versus-inference-memory)
- [Rack-and-Stack Installation for a separate equipment requirement](/services/rack-and-stack)
- [Discuss an independently required physical installation](/contact?service=rack-and-stack&from=%2Farticles%2Flayernorm-rmsnorm-centering-activation-output)

## Does a separate equipment project need rack installation?

Share a nonconfidential equipment summary, site, approved rack and mounting inputs, and required physical handoff to discuss installation scope and availability.

[Discuss the scope](/contact?service=rack-and-stack&from=/articles/layernorm-rmsnorm-centering-activation-output)
