DeepLLM Quiz
Deep Learning

Consistent regularisers: why units of measurement should not change the answer

10 questions on rescaled inputs, equivalent networks, layer-wise penalties, improper priors and what four weight and bias hyperparameters control.

  • 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

    Why does simple weight decay fail the consistency requirement?

    • It treats all weights and biases on an equal footing, so equivalent networks with different weight sizes are penalised differently
    • It removes the biases from the network
    • It only works for networks with one 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 analysts train the same network on the same measurements. One records lengths in metres and the other in millimetres. A sensible training procedure should give them equivalent models: the second network's first-layer weights are simply a thousand times smaller to compensate, and both networks make exactly the same predictions. Yet if each analyst adds an ordinary weight decay penalty, the two will end up with different models, because the penalty cares about the raw size of the weights, and the size of the weights depends on the units. The choice of units has quietly changed the answer.

This quiz is about fixing that flaw. You will see what consistency means for a regulariser: it must not arbitrarily prefer one of two equivalent solutions, so it must be unaffected when the inputs or outputs are rescaled and the weights are adjusted to compensate. You will see how that requirement leads to a modified penalty in which each layer has its own strength and the biases are left out. You will also see the price of this tidy solution on the Bayesian side, a prior that cannot be normalised and so makes comparing models awkward, and the usual way out.

The final theme is practical and visual. If you draw random functions from the distribution defined by these priors, each of the four hyperparameters, one per group of weights or biases, has a recognisable effect on the shape of the functions. One controls their vertical size, another their horizontal scale of wiggling, another how far from the origin the wiggling extends and another their vertical offsets. Knowing which knob does what is a handy skill for anyone who has to set the strengths of several penalties.

Some points commonly cause confusion. People assume that applying one penalty to every parameter is the neutral choice, when it is in fact a choice that depends on units. They assume that excluding the biases is a mistake, when it is what consistency demands. And they overlook that improper priors, although convenient, create trouble in the Bayesian machinery for choosing coefficients. The topic is a good reminder that mathematical conveniences hide assumptions. A penalty that looks innocent can encode a quiet dependence on how the data happened to be measured, and noticing such dependences is a habit worth building. In everyday practice, the habit shows up as standardising inputs before training, giving different layers different penalty strengths and exempting biases from decay, all of which are common in real recipes and are explained here by a single principle instead of folklore.

The quiz suits learners who know weight decay and want a deeper understanding of its limitations, and practitioners who tune separate penalties for different layers. It involves no algebra, only reasoning about scales. 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. An explanation follows every answer, so even a miss adds to your understanding.

›Do I need to know weight decay already?

It helps a lot. The quiz on weight decay and the effective number of parameters covers the basic penalty, and this one builds on it by asking what the penalty gets wrong. The questions here do recall the essentials as they go along.

›What does it mean for a regulariser to be consistent?

It means that equivalent networks are treated as equivalent. If rescaling an input and compensating in the weights gives a network that makes identical predictions, the regulariser should not prefer one of the two arbitrarily. Training on data in one set of units and on data in another should give models that differ only by the corresponding rescaling.

›Why does ordinary weight decay break consistency?

Because it treats every weight and bias on an equal footing and measures their raw size. When the input units change, the weights must change size to compensate, and a penalty on raw size then judges the two equivalent networks differently. The preferred solution ends up depending on the arbitrary choice of units.

›How is a consistent regulariser built?

The weights are divided into groups, for example one group for each layer, and each group gets its own sum of squares with its own strength. Biases are left out of the sums, so shifts of the biases cost nothing. The strengths must be rescaled in a prescribed way when the units change, which keeps the overall effect the same.

›What is an improper prior?

It is a prior distribution that cannot be normalised, meaning that it does not add up to a total probability of one. The prior corresponding to a penalty that ignores the biases is of this kind, because the biases are unconstrained. Improper priors are convenient, but they cause difficulty when choosing regularisation coefficients and comparing models in the Bayesian framework.

›How is the difficulty avoided in practice?

By giving the biases their own proper priors with their own hyperparameters. The shift invariance is then lost, since the biases are no longer free, but the problems with improper priors disappear. The result is a set of separate hyperparameters, one for each group of weights and each group of biases.

›What do the four hyperparameters control?

In a small two-layer network, they are the strengths for first-layer biases, first-layer weights, second-layer biases and second-layer weights. Sampling functions from the corresponding prior shows their effects: the second-layer weights set the vertical scale, the first-layer weights set how rapidly the function varies horizontally, and the biases set how far the variation extends and how far functions are offset.

More quizzes