Pacific Design/ artificial intelligence

Machine Learning Foundations · entry 04/05

Overfitting & generalization

A model can be perfect on its training data and useless on Tuesday — the whole craft is telling the difference before Tuesday does.

The two ways to be right

A model can be right because it learned the underlying pattern, or because it memorized the answer sheet. Both look identical on training data; only the first survives new data. Generalization is the gap between those two, and it is the only number that matters, because production is new data by definition.

The ritual: three piles

Split the data before touching it. Train is what the model learns from. Validation steers your decisions — architecture, knobs, when to stop. Test is opened once, at the end, to report honest performance. The discipline exists because of a subtle leak: every decision you make while staring at validation scores slowly overfits you to the validation set — the model never saw it, but your choices did.

Reading the curves

Training loss falling while validation loss rises is the signature: the model has run out of pattern and started memorizing noise. The levers are old and effective — more data, smaller model, stop earlier, regularize (penalties and dropout that make memorization expensive), and augment data so no example repeats exactly.

The modern wrinkle

Frontier models complicated the story: heavily overparameterized networks that should memorize instead generalize well, and sometimes validation loss improves again long after classic theory says it shouldn't. The three-pile ritual survives unchanged — but the deeper lesson stands: capacity plus scale behaves in ways the textbook curves don't predict, so measure, don't assume.

Failure mode

Contamination. The training set quietly contains the test — a duplicated record, a benchmark that leaked into a web crawl — and the model "generalizes" brilliantly to data it has already read. This is now a first-order problem for LLM evaluation: before trusting any score, ask how anyone knows the model hasn't seen the questions.