AI Anatomy Class · Part 2 · How machines learn

25. The student who memorized past exams

Q. An AI that aces every practice problem but fails the real test: why does that happen?

  1. A student who only memorizes past exams aces those, but does badly on new questions. The same thing happens to AI.
  2. We practice on the line lengths and ratings of 8 trucks: the training data. A simple straight line passes between the points.
  3. Train a very complex model for a long time, and it becomes a wiggly line through all 8 points exactly. The training loss is 0.
  4. But give it 7 trucks it has never seen (validation data), and it gives silly answers. It only memorized. This is overfitting.
  5. Plot both losses while training: the training loss keeps going down, but at some point the validation loss starts rising again.
  6. Stop when the validation loss is lowest, or collect more data. Doing well on new problems is called generalization.
  7. GPT is also checked on held-out text during training: is it really learning, or just memorizing?

Chapter summary