AI Research Scientist · Generalization Theory & Phenomena
Generalization theory
Generalization theory
generalization gap
The generalization gap is the difference between a model’s error on the data it trained on and its error on new, unseen data from the same distribution. Generalization theory asks why and when this gap stays small rather than assuming it will.Why this is puzzling
A model only sees a finite training set, yet must perform well on inputs it never encountered. Nothing about fitting seen examples guarantees the same rule holds for unseen ones — a model could just as easily memorize quirks specific to its sample. Generalization theory exists because strong test performance isn't automatic; it's the question of what makes a learned rule transfer beyond the data it trained on.
Recall check from the same lesson
A model that reaches zero error on its training set has thereby proven that it learned the true underlying pattern generating the data, so any later test error must be pure measurement noise.
Review the explanation
Answer: False. Zero training error only shows the model can reproduce the examples it already saw. It says nothing about unseen inputs, because the model could just as easily have memorized quirks specific to that training sample as captured the real underlying pattern — which is exactly why the generalization gap needs a theoretical explanation.
Generalization theory
Capacity’s Effect on Train and Test Error
- 1Below capacityWith too little capacity, the model can’t fit training data well: both errors stay high, since the pattern is never captured.
- 2At the right capacityOnce capacity matches the true pattern, training error drops and test error drops with it, keeping the gap small.
- 3Beyond needed capacityExtra capacity lets the model fit training-set noise; training error keeps falling, but the generalization gap widens as test error stalls.
- 1The small model fits loosely.WhyLimited capacity keeps train and test error close, both near 9%.
- 2The large model fits tightly.WhyHigh capacity drives train error near 0% but test error up to 15%.
Recall check from the same lesson
If a model trained on a fixed dataset has near-zero training error but a large gap to its test error, the classical capacity view attributes this primarily to the model having more capacity than needed to capture the true underlying pattern.
Review the explanation
Answer: True. This matches the classical account: once capacity exceeds what's needed, the model starts fitting dataset-specific noise, driving training error toward zero while the generalization gap widens — exactly what a large train-test gap signals under this view.
Sources
One sitting · 20–30 minutes
A focused session on your AI Research Scientist interview
LearnBench starts from what you already know — skip what you have, master what you’re missing.
Start now