Overfitting: learning the examples too specifically
Overfitting happens when a model fits its training data in ways that do not carry over to new examples. It can learn useful structure and also exploit accidents, repeated phrases or noise particular to the training set.
A language model can become better at predicting training passages while becoming worse at predicting held-out text. The training objective is improving, but the improvement is not generalizing to the data we care about.

Two measurements tell different stories
Training loss measures the examples used for updates. Validation loss measures separate examples used to guide development. A widening gap, especially when validation performance worsens while training improves, is a useful warning sign.
A gap alone does not identify every cause: the two datasets must also represent comparable tasks and be scored consistently. A different writing domain can make validation harder even without memorization.
Keep the test meaningful
Split data before creating overlapping chunks or augmentations. For language-model experiments, near-duplicate documents can cross a naive random split and make held-out results look better than they are. Related examples should be grouped when their shared origin would otherwise leak information.
Validation can guide early stopping and model choices. A final test set stays outside that repeated decision process; choosing settings against it turns it into another development set.
More representative data, appropriate model capacity and regularization can help. So can stopping before additional updates merely fit training peculiarities. Our Small Language Model experiment keeps a held-out partition so its training progress has an independent comparison.