What it is
A fine-tuned model has read your training replies many times. Ask it one of those questions again and it can reproduce the reply almost word for word. That looks like skill, but it is recall: it tells you nothing about how the model will handle the next customer, whose question it has never seen.
The test set is the fix, and one of the oldest rules in machine learning: keep some examples completely apart from training, and grade the model only on those. Large language models make the rule more important, not less. Studies of public benchmarks have repeatedly found models that saw test items during training and scored higher because of it — a problem known as data contamination or leakage.
How it works
dataset has ≥ 10 conversations? no → no test set
yes → test = 10% of conversations (at least 3)
random, but fixed for this prep
each assistant reply in a test conversation → one question
asked with the conversation up to that point
reference answer = the reply itself
reply identical to a training reply → dropped- Kept aside first. Before validation is split off or anything is written for training, data prep picks 10% of the conversations, at least 3. Datasets with fewer than 10 conversations get no test set.
- Random, but fixed per prep. The pick is random, so it is not biased towards easy or hard conversations, and it stays the same for that prep, so evaluating again asks the same questions.
- One question per reply. Each assistant reply in a test conversation becomes a question, asked with the conversation up to that point. The reply itself is the reference answer.
- No hidden copies. A test reply that is word-for-word the same as a training reply — the same standard answer in another conversation — is dropped, because the model has effectively seen it.
- Never leaves. Test conversations are not in the training file and not in the validation file, and they are never sent to the provider.
- Learned from
- no
- Sent to the provider
- no
Did the model really improve?
- Learned from
- no
- Sent to the provider
- yes
A second opinion when there is no test set
- Learned from
- yes
- Sent to the provider
- yes
A sanity check only: results are optimistic
Why validation isn't a clean test
Validation conversations are not learned from, so why not grade on them? Because the provider receives the validation file and uses it during training, to compute validation loss and monitor the run. The data has left your hands, and every decision taken by watching those numbers — which run to keep, how many epochs — tunes the result a little towards those particular questions. Validation is a good second opinion; it is not a blind exam.
Where Evaluate gets its questions
| Source | Seen during training? | Use it for |
|---|---|---|
| Held-out test | No | Judging whether the model really improved |
| Validation | Seen by the provider, not learned from | A second opinion when there's no test set |
| Training sample | Yes, learned from | A sanity check only; results are optimistic |
Evaluate takes the first source that exists, in that order. A result on a training sample is an upper bound: if the tuned model doesn't win even on questions it has learned, it won't on new ones; if it does win, you still don't know by how much.
- The dataset has 120 conversations, so data prep keeps 10% aside: 12 conversations, chosen at random and fixed for this prep.
- Those 12 conversations hold 31 assistant replies. Each becomes a question, asked with the conversation up to that point and with the reply as its reference answer.
- Two replies are word-for-word the same as replies in training conversations — a standard answer about resetting a password. They are dropped: 29 test questions remain.
- The other 108 conversations go on to the usual validation split and training. Neither file contains a test conversation, and the provider never receives one.
- After training, Evaluate asks the 29 test questions. For comparison: a dataset of 25 conversations would keep 3 aside (the minimum), and one of 9 would have no test set, so Evaluate would fall back to validation questions.
Using it well
- Give it room. A test set of 29 questions is useful but small: at that size a 60% win rate is still compatible with no improvement. More conversations in the dataset mean more test questions and a firmer verdict.
- Keep test conversations out of later training. If you copy them into another dataset and train on it, the next model has seen them and its evaluation flatters it.
- Compare like with like. A new prep draws its own test set. When you compare models, use one prep's test questions for all of them.
- Treat warnings seriously. An evaluation on a training sample is marked as such for a reason: read it as a sanity check, not a result.
Question sources
Questions from the conversations data prep kept aside. Never trained on, never validated on, never sent to the provider: the clean test, and the default.
Questions from the validation split. Not learned from, but seen by the provider while it monitored training. Used when the prep has no test set.
A sample of questions the model trained on. The last resort, marked with a warning: results are optimistic and only show that nothing is badly broken.
Common mistakes
- Evaluating on training questions and reading the result as real-world performance.
- Treating validation results as being as clean as held-out test results.
- Copying test conversations into a later training dataset, so the next model has already seen them.
- Calling a handful of test questions a verdict: small test sets need a large difference to mean anything.
- Comparing models that were each evaluated on a different prep's test set.
References and further reading
External sources open in a new tab.
- 01Training, validation, and test data setsWikipedia · en.wikipedia.orgThe three-way split, and why the test set is used only at the end.
- 02Leakage (machine learning)Wikipedia · en.wikipedia.orgHow information from the test data sneaks into training and inflates scores.
- 03NLP Evaluation in trouble: On the Need to Measure LLM Data Contamination for each BenchmarkSainz et al., 2023 · arXiv · arxiv.orgWhy contamination makes evaluation results unreliable, and why it must be checked.
- 04Time Travel in LLMs: Tracing Data Contamination in Large Language ModelsGolchin & Surdeanu, 2023 · arXiv · arxiv.orgDetecting when a model has memorised test examples, by asking it to complete them.