DeepLLM Quiz
Deep Learning

Layer normalisation versus batch normalisation

10 questions comparing layer and batch normalisation, with small batches, several processors, sequence models, transformers and prediction time.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    A mini-batch has 4 examples, and each example has 100 hidden units in the layer. How many values go into the average for one unit in batch normalisation, and how many into the average for one example in layer normalisation?

    • 4 for batch normalisation and 100 for layer normalisation
    • 100 for batch normalisation and 4 for layer normalisation
    • 400 for both methods
  2. Sample 2

    With layer normalisation, does the normalised output for a given example change depending on which other examples share its mini-batch?

    • Yes, because every example is mixed with the rest of the batch
    • No, each example is normalised using only its own hidden-unit values
    • Yes, but only in the last layer

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

Two engineers talk about "normalising the activations" and both nod, yet one is averaging down a column of numbers and the other along a row. Same words, different method. The difference sounds like a technicality, but it decides whether a model trains well with very small batches, whether it can be served one request at a time without special bookkeeping, and why the networks behind modern language models use one kind and not the other. This quiz is about that difference.

The key picture is a table. Each row is one example in a mini-batch and each column is one hidden unit. Batch normalisation computes an average and a spread down each column, so every unit is standardised across the examples that happen to be in the batch. Layer normalisation computes an average and a spread along each row, so every example is standardised across the units of its own layer. Once you can see the table, most of the questions in this quiz answer themselves.

The scenarios cover the practical consequences. What goes wrong when each batch holds only a handful of examples? What if the examples in a batch are spread across several processors? Why did sequence models, whose statistics shift with every step, call for a different approach? What must be stored with a trained model to make predictions, and what need not be? Can the output for one example depend on which other examples happen to share its batch?

There are several misconceptions to clear up. Some people think layer normalisation is simply a newer, better batch normalisation, although each suits different circumstances. Others believe that both need running averages for prediction, or that only one of them has learnable parameters. In reality the two share the standardise-then-rescale pattern and differ in what they average over. The comparison also trains a useful habit: asking, for any technique, what exactly is being averaged and what that choice makes the method depend on. A method that averages over the batch inherits a dependence on batch size and on the other examples around it. A method that averages over a layer's units does not, and so it behaves the same whether the model is trained on thousands of examples at a time or asked a single question in production. When a technique behaves strangely, that dependence is often where the explanation hides.

The quiz is aimed at learners who have met batch normalisation and want to place it in context, and at practitioners who use layer normalisation inside a transformer and have never asked why. It involves only simple counting, no algebra. There are 10 questions, each with an explanation, and it takes about four minutes.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. Each answer comes with an explanation, which makes the quiz a quick revision of both methods.

›Should I take the batch normalisation quiz first?

It helps, because it introduces the standardise-and-rescale idea in detail. The questions here recall what is needed, so you can also start here and treat the contrast as a way into both methods. If you want a gentler start still, the quiz on input normalisation covers the simplest member of the family, which has no hidden layers involved at all.

›What is layer normalisation?

It is a way of keeping the values inside a network on a steady scale. For each example separately, it takes all the hidden-unit values in a layer, subtracts their average and divides by their spread, then applies an adjustable shift and scale for each unit. Because it looks only at one example at a time, it does not need a mini-batch to work.

›What is the difference between the two in one sentence?

Batch normalisation standardises each unit across the examples of a mini-batch, and layer normalisation standardises each example across the units of a layer. If you imagine the activations laid out in a grid of examples by units, one works down the columns and the other along the rows.

›When does batch normalisation struggle?

It struggles when the mini-batch is small, because averages and spreads estimated from a few examples are noisy and the noise ends up in the training signal. It is also awkward when a large batch is divided among several processors, since computing a statistic over the entire batch then needs the processors to share information at every layer.

›Why do sequence models prefer layer normalisation?

In recurrent networks the distribution of values changes after every time step, so there is no stable set of batch statistics to rely on. Layer normalisation sidesteps the issue by using only the current example, and it has since become a standard component of transformer networks, which process long sequences.

›Do both methods have learnable parameters?

Yes. After standardising, each unit gets its own adjustable shift and scale in both methods, learned together with the weights by gradient descent. This restores the flexibility that exact standardisation would remove. The parameters are one of the things that the two methods share, along with their purpose of keeping values well scaled.

›Which one is simpler to use at prediction time?

The one whose calculation is the same in training and in use. If a method depends on statistics collected from batches, those statistics have to be saved and applied later. If it depends only on the example in front of it, nothing extra needs to be kept. That difference affects how a trained model is packaged and served.

More quizzes