How is a test set different from training and validation sets?
Three data splits do three different jobs, each with its own rules. Google’s machine learning course describes them (Google ML Crash Course, read 26 November 2026):
| Set | Used for | How often |
|---|---|---|
| Training set | Fitting the model | Every training step |
| Validation set | Comparing models, tuning settings | Repeatedly during development |
| Test set | Final confirmation | Once, at the end |
Only the test set is untouched by decisions, which is why its score can be trusted. Mixing the roles lets the model, or you, adapt to the answers and overfitting hides.
What makes a good test set?
A good test set has four traits. The same course lists them: large enough to give statistically significant results, representative of the dataset as a whole, representative of the real-world data the model will meet, and containing zero examples duplicated in the training set (read 26 November 2026). The last one is the common failure. Duplicates and near-duplicates inflate scores, and for language models the same problem appears as benchmark contamination. Build the set from real cases with checked answers, your ground truth.
Why does a test set wear out?
A test set wears out when you reuse it to make decisions. The course warns that test and validation sets “wear out” with repeated use: the more you use the same data to make decisions, the less confidence you can place in predictions on new data (read 26 November 2026). Every time a score changes what you build, the test set leaks a little into the model. Treat it as a one-time check, and refresh it with new examples when you must iterate on it. The course also notes every example held out for testing is one fewer for training, so size the split to your data.
What is a test set for LLMs and AI agents?
Teams usually do not train the model, but the same logic holds for prompts, tools and workflows. Keep a fixed eval dataset of real inputs with expected results, apart from the examples you paste into prompts, and run it before every release. See prompt regression testing and the training data entry for what stays on the other side of the split.