Deep LearningNormalization

What is layer normalization?

Layer normalization is a normalization technique that normalizes the activations within each individual example rather than across a mini-batch.

It is commonly used in sequence models and Transformer architectures because its behavior does not depend on the batch size.

How layer normalization works

For a given example, layer normalization computes statistics across the features of that layer:

  • Calculate the mean of the activations.
  • Calculate their variance.
  • Normalize the activations using those values.
  • Apply learnable scale and shift parameters.

A simplified form is:

normalized = (x - mean) / sqrt(variance + ε)

Then the normalized values are adjusted using learned parameters:

output = γ × normalized + β

where γ and β are learned during training.

Why is layer normalization useful?

It can help:

  • Stabilize the scale of activations.
  • Make optimization more consistent.
  • Work well even with very small batch sizes.
  • Support sequence models where examples may have different lengths.

How is it different from batch normalization?

Batch normalization uses statistics collected across examples in a mini-batch, while layer normalization computes statistics within each example.

That difference makes layer normalization especially useful in architectures such as Transformers.

The detailed comparison is covered separately in “What is the difference between batch normalization and layer normalization?”.

In short, layer normalization normalizes the features of each individual example, helping stabilize training without depending on statistics from other examples in the batch.

#layer normalization#what is layer normalization#layer norm deep learning#layer normalization transformer#layer normalization neural network#deep-learning#layer-normalization#normalization#transformers#training

Learning Sequence

Deep Learning Curriculum

26% Completed
Up NextDeep Learning

What is the difference between batch normalization and layer normalization?

Explore Related Questions

Deepen your understanding across related Deep Learning topics.

Machinoai Logo
Machinoai

Your edge in the AI era. Deep dives into machine learning concepts, paper explainers, verified industry jobs, and developer tools.

© 2026 Machinoai. All rights reserved.