liveBook · Manning

Overfitting

As explained in The AI Pocket Book

A failure mode in which a model becomes too specialized to its training data and generalizes poorly to new cases.

Overfitting happens when a model memorizes its training examples instead of learning a process that works on new cases. It can look successful because training loss is low while performance on unseen data remains poor. section 1.29 section 1.27

A fine-tuning trap

Fine-tuning an LLM on a small collection of style examples can make it specialize too aggressively. The model may reproduce those examples well but handle other instances badly. More specialization is not automatically better. section 3.3

Control overfitting by limiting how narrowly the model adapts:

  • Use early stopping: stop fine-tuning when performance on a separate validation set stops improving. section 3.3
  • Limit updates: change only selected parts of the model, as with LoRA layers that preserve the original parameters. section 3.3
  • Use regularization or dropout to discourage parameters or internal units from specializing too closely to individual examples. section 3.3
  • Compare validation and test performance to choose a fine-tuning strategy and check whether the final model generalizes. section 3.3

The practical test is simple: a model should work beyond the examples it saw during training. Low training loss alone cannot establish that. section 1.29 section 1.27

How The AI Pocket Book covers it

How deep it goes
Defines memorization, explains its generalization failure, and lists early stopping, limited updates, regularization, and dropout.
Examples
Uses fine-tuned language models that memorize style examples and contrasts training performance with unseen sentences or images.
What it assumes
Assumes basic model training and loss while explaining generalization, memorization, validation, and test evaluation.
What you can do after
Diagnose overfitting by comparing training, validation, and test performance, then apply named fine-tuning controls.
How it connects
Connects overfitting with generalization, underfitting, loss, fine-tuning, validation sets, test sets, regularization, dropout, and LoRA.

Also explained in

Compare how 24 books explain overfitting →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The AI Pocket Book. The section links point to the parts of the book it draws on.