Batch normalization needs a batch — it measures a mean and variance across examples. What happens the moment your batch has one example in it, or your model processes one sequence position at a time?
Same idea as batch norm — force a healthy mean and variance — but measured across a completely different axis: not across examples in a batch, but across this one example's own channels. No batch required, no matter how many examples you're processing at once.
Split a layer's output channels into groups, then normalize each group independently using only that group's own statistics:
- — channel 's raw output, for this one example.
- , — the mean and variance of only the channels in group , for this one example.
- — channel after normalization.
- One group (LayerNorm)
Every channel lands in the same group — and are the mean and variance across all of this example's channels at once.
- Several groups (GroupNorm)
Channels split into smaller groups, each normalized against only its own members — a middle ground between one giant group and every channel alone.
- One channel per group (InstanceNorm, the degenerate limit)
Each group has exactly one member, so that member's "mean" is itself — every value normalizes to exactly , which is why this extreme is rarely useful on its own.
Slide from one group up to six. The channels get shuffled into smaller and smaller clusters, each computing its own mean and variance — completely independent of whatever else is in the batch, or whether there's a batch at all.
- Six raw activations
: mean . Squared deviations from that mean:
These sum to , so variance .
- One group (LayerNorm)
Dividing by after subtracting the mean from each value:
Averaging these six gives mean and variance for the whole vector — the same guarantee batch norm gives, just measured across channels instead of across a batch.
- Three groups of two
Splitting into consecutive pairs , , — each pair's two values happen to sit equally far from their own mean:
- : mean , half-spread , normalizing to and
- : mean , half-spread , normalizing to and
- : mean , half-spread , normalizing to and
Every one of the six outputs lands at exactly or , regardless of how spread out the original six numbers were.
Pick the group size where every one of the 6 normalized values comes out at exactly +1 or -1.
Batch norm normalizes across examples; layer and group norm normalize across channels, for one example at a time. That single change in axis is what makes them usable with a batch size of 1, inside a recurrent step, or across variable-length sequences — exactly the settings where batch norm's batch-level statistics either don't exist or don't mean anything stable. The next chapter takes this same idea and strips it down even further, dropping the mean-centering step entirely.