Explain When Batch Norm Fails and Layer Norm Works Instead

Last updated: November 29, 2026

Quick Overview

Explain how batch normalization and layer normalization compute their statistics, and why transformers such as Llama use layer norm or RMSNorm instead of batch norm.

Meta
Machine Learning
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
Phone Screen
Machine Learning
Easy

0

0

0 solved


Explain how batch normalization and layer normalization compute their statistics, and why transformers such as Llama use layer norm or RMSNorm instead of batch norm.

A common fundamentals question in Meta ML screens, particularly for candidates moving from vision to language models. The interviewer wants precise axes of normalization and concrete reasons batch norm struggles with variable-length sequences and small batches.

What the Interviewer Expects
  • State which axes each method normalizes over
  • Explain train versus inference behaviour of batch norm running statistics
  • Give reasons batch norm fails for small batches, padding, and autoregressive decoding
  • Describe RMSNorm and pre-norm placement
  • Mention where batch norm still works well, such as CNN vision models
Key Topics to Cover
batch normalization
layer normalization
RMSNorm
transformers
training stability
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • What happens to batch norm with batch size 1 at training time?
  • Why do pre-norm transformers train more stably than post-norm?
  • What does RMSNorm drop compared with layer norm, and why is that acceptable?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Consider an activation tensor of shape (batch BB, sequence TT, features DD) for text, or (batch, channels, height, width) for images. Both methods compute $\hat{x} = (x - \mu)/\sqrt{\sigma^2 + \eps...

Approach

Compare the statistics, then the consequences for training and serving....


Submit Your Answer
Markdown supported