Model and Inference EngineeringTransformer and model mechanicsStaff
How can an RMSNorm epsilon or reduction-precision mismatch change a trained model’s output?
By Amit Kumar3 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A checkpoint uses RMSNorm epsilon 1e-6, but a fused serving kernel uses 1e-5 and a lower-precision reduction. Explain where each difference enters the computation, work through a small-activation example, and design a parity investigation that separates epsilon, accumulation and later-layer effects.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
Root mean square normalization, or RMSNorm, rescales each feature using the vector’s average squared magnitude. It scales a vector approximately as x / sqrt(mean(x²) + epsilon), then applies a learned per-channel weight. The RMSNorm paper gives the normalization idea, and PyTorch's RMSNorm documentation shows where epsilon enters the denominator. If mean(x²) is large relative to both epsilon values, the difference is small. If the activation is tiny, epsilon dominates. The denominator changes from roughly sqrt(1e-6) to sqrt(1e-5), a factor of about 3.16 in that limiting case. That is not a harmless rounding difference. Later layers may amplify or suppress it, so we should measure rather than claim every output will fail.
Take a hypothetical vector [0.001,-0.001] with learned weights equal to one. Its mean square is 1e-6. With epsilon 1e-6, the normalized components are about ±0.7071. With epsilon 1e-5, they are about ±0.3015. The limiting 3.16 denominator ratio above applies when the mean square is much smaller than both epsilon values. This finite example is a different ratio because the activation statistic still contributes.
I would compare the reference and fused kernels with fixed input tensors at realistic shapes and dtypes. Include tiny values, ordinary values, a large outlier and mixed signs. Compare mean(x²), reciprocal square root, weighted output and gradient if the same kernel is also used in training. Find out whether the reference accumulates squares in FP32 and when it casts back. A lower-precision reduction can change the statistic even with the same epsilon, especially at extreme magnitudes. Confirm the weight is applied in the same order and precision. A test that only checks shape or average error over random normal inputs can miss the boundary where epsilon matters.
The checkpoint's normalization parameters belong to its architecture contract. Do not let a serving library silently substitute its own default epsilon. Pass the checkpoint value explicitly and assert it when loading. Then run layer-level equivalence tests and logit comparisons across the full model at the intended precision and batch shapes. Set tolerances based on expected numerical differences, not on a desire to make the test pass. If a quality regression remains after the kernel matches the reference operation, investigate other fused-path assumptions.
An interviewer may ask whether any epsilon is mathematically acceptable. We could train or fine-tune a different architecture with a different epsilon. That is not the same as swapping the constant after training and claiming identical behavior. The checkpoint loads after a SwiGLU kernel rewrite. Why did model quality fall? catches gate/up weights swapped in a gated MLP. Here every weight can be in the right place while one small constant and one accumulation dtype quietly change the computation.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux