The Trap That Eats Beginners
You train a model. Training loss goes to zero. You're proud. Then you evaluate on test data — performance is awful. You overfit. The model memorized the training set instead of learning the underlying pattern.
The signature: training loss low, test loss high. The gap is overfitting.
Why It Happens
Models with too many parameters can memorize the training data exactly — every quirk, every noise sample. They lose the ability to generalize because they didn't have to. The only signal during training is "make training loss small," and a big enough model can do that by brute force.
The Antidotes
- More data — the cheapest fix when available. Memorizing 10M examples is harder than memorizing 100.
- Regularization — penalize complexity. L1/L2 weight penalties. Dropout (randomly turning off neurons). Early stopping.
- Train/Validation/Test split — hold out data the model never sees during training. Track val loss to detect overfitting in flight.
- Data augmentation — slightly perturb training samples (image rotations, text paraphrases) to increase effective dataset size.
- Smaller model — fewer parameters means less capacity to memorize. Sometimes the best fix.
Training accuracy is a vanity metric. Validation accuracy is the truth. If they're far apart, your model is memorizing, not learning. Always hold out data the model never sees.