seniorPyTorch

What is the difference between BatchNorm and LayerNorm in training stability?

Updated May 17, 2026

Short answer

BatchNorm normalizes across batch dimension; LayerNorm normalizes across features per sample.

Deep explanation

BatchNorm depends on batch statistics and is sensitive to batch size, making it unstable for small batches. LayerNorm normalizes each sample independently, making it stable for transformers and sequence models.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More PyTorch interview questions

View all →