TensorTau PathToAGI Doing Machine Learning Honestly Level 05

Level 05 · Doing Machine Learning Honestly · Chapter 055

Why Training Accuracy Can Lie

If a model scores 100% on the examples it studied, why might it still be useless tomorrow?

Where We Are

Train/validation/test splits introduced a crucial idea: learning and judging must use different evidence. Now we can see why.

1. A student can memorize without understanding

Give a student 20 questions plus their answers. Tomorrow ask the same 20 questions. A perfect score proves memory, not mastery.

A model can do the same thing.

training examples → model → training accuracy = 100%
new examples      → model → accuracy = 62%

The first number answers, “Did the model fit what it saw?” The second asks, “Did it learn a reusable rule?”

2. Training error is optimized directly

Learning algorithms choose parameters to reduce training loss:

θ^=arg⁡min⁡θLtrain(θ).\hat\theta=\arg\min_\theta L_{train}(\theta).

So low training loss is partly guaranteed by the procedure. It is not independent evidence of generalization.

A sufficiently flexible model can even memorize random labels.

3. The generalization gap

Define

gap=Lvalidation−Ltraining.\text{gap}=L_{validation}-L_{training}.

A large positive gap is a warning that the model behaves much better on familiar data than unseen data.

But the gap alone is not enough. High train and validation loss means the model may be underfitting.

4. Learning curves tell a story

Track train and validation performance as training proceeds.

loss
↑ validation  \__/
| training     \____
+--------------------→ epochs

If training loss keeps improving while validation loss worsens, the model is learning details that do not transfer.

5. The deeper lesson

The purpose of ML is not to minimize yesterday’s error. It is to make good predictions on data drawn from the future task distribution.

That is why every serious experiment reports held-out performance and why the test set must remain untouched until final evaluation.

Break It

Give a large decision tree a tiny dataset with random labels. It may reach nearly perfect training accuracy. That success is exactly the failure we wanted to expose.

What to Remember

  • Training performance measures fit, not generalization.
  • A flexible model can memorize.
  • Validation performance supplies evidence on unseen data.
  • Learning curves expose divergence between fitting and generalizing.

Next → Overfitting and Underfitting: what are the two fundamentally different ways a model can fail to learn the right pattern?

Six ways to work the chapter, climbing from explaining it in your own words to investigating it like a researcher. Reading is not enough — this is where the chapter lands.

  1. Explain: Why can 100% training accuracy be bad evidence?
  2. Calculate: Train loss is 0.08 and validation loss 0.31. Compute the generalization gap.
  3. Predict: What happens to train accuracy as an unrestricted decision tree grows deeper?
  4. Break: Fit random labels with a high-capacity model.
  5. Build: Plot train and validation loss by epoch.
  6. Investigate: Compare generalization gaps across three model capacities and repeated data splits.