Where the loss and the objective come apart
limit▲▲▲The second assumption of this chapter is that minimising the loss is what the modeller wants. Take a task you care about, write down the loss you would actually train with, and enumerate what the second omits. Then show — with a worked case — that a model can strictly improve the loss while getting strictly worse at the objective.
This is the chapter’s open exercise. There is no single right answer, but there is a standard of rigour: the divergence must be exhibited with numbers, not asserted.
Hint
Averages hide structure. Ask what happens when a loss is averaged over a population containing a small subgroup you care about disproportionately.
Solution
A worked case. The objective: detect a rare condition, present in of a screened population, well enough to be useful in a clinic. The loss: average binary cross-entropy over the screened population.
Model A predicts for every patient, always. It has learned nothing. Its average loss is the entropy of :
Model B genuinely detects the condition, assigning to the who have it and to everyone else.
Model B is better on both counts here, so refine it. Model C is Model B with its confident positives softened to , and its negatives sharpened to :
. Model C has a strictly lower loss.
But at any threshold above , Model C detects nothing at all, while Model B detects everything it should. On the objective — finding the condition — Model C is strictly worse, and by the loss it is strictly better.
Why. The contribute times more terms to the average than the do. A tiny improvement on the majority — per example — outweighs a large degradation on the minority, . The arithmetic is saved against lost. The average is doing exactly what an average does.
What the loss omitted. Four things, none of them visible in the number:
- Who the errors fall on. An average over a population is indifferent to which subgroup absorbs the error.
- The asymmetric cost of the two error types. A missed malignancy and a false alarm are both “wrong” to cross-entropy and are not remotely comparable in a clinic.
- The operating point. The loss is computed over all thresholds at once; the clinic uses exactly one, and Chapter III.7 shows that is the only one that matters.
- The deployment distribution. The prevalence is the screened population’s, not the referred population’s, and the same model faces both.
The repair, and its limits. Class weighting, focal loss, or a fixed sensitivity constraint each address point 1 or 2. None addresses all four, and each introduces its own hyperparameter that is chosen by looking at the very metric it was meant to replace.
The honest conclusion. The loss is a proxy chosen because it is differentiable, and differentiability is a property of the optimiser’s needs, not the problem’s. Every claim built on a training curve inherits that substitution. The discipline this chapter asks for is not to avoid the substitution — it is unavoidable — but to write down, once and explicitly, what it dropped.