← Blog

Evaluating language models

What is a held-out test set? Definition, splits, and leakage

A held-out test set is data kept out of training and tuning, scored once at the end. How it differs from validation, cross-validation, and leakage.

Oct 12, 2026 · Updated Nov 9, 20265 min read5 sources

Why it matters

A score from a test set that leaked into training or tuning overstates how a system will perform on documents it has never seen.

The short version

  1. 1A held-out test set is data the model never trained on and no decision was tuned against. You score it once, at the end.
  2. 2Tune on a validation set or with cross-validation. scikit-learn says a test set should still be held out for final evaluation.
  3. 3Leakage breaks the hold-out. The GPT-4 report found about 25 percent of HumanEval and about 21 percent of DROP in its pre-training data.

A held-out test set is data you set aside before training and never use for any decision, then score once at the end. The score estimates how the model will do on data it has never seen.

The scikit-learn guide gives the reason: a model tested on its own training data can just repeat the labels it saw, and get a perfect score while being useless on new data (scikit-learn, Cross-validation).

Held-out test set vs validation set vs training set

SetJobWhen you look at it
TrainingFit the modelEvery training step
ValidationChoose the model, settings, promptAs often as you need
Held-out testReport the final scoreOnce, after every choice is made

The validation set exists to protect the test set. If you tweak settings until the test score looks good, knowledge of the test set leaks into the model, and the metric stops measuring generalization (scikit-learn).

The rule that follows: once a test number informs a decision, that set is a validation set, whatever you call it.

What "held-out" means in practice

A test set is held out only if all of these are true:

  • No example in it appears in the training data, including near-duplicates.
  • No setting, prompt, or model choice was made by looking at its score.
  • Preprocessing, such as scaling or feature selection, was learned from the training data only, then applied to the test data (scikit-learn).
  • The party being evaluated did not pick the examples.

For data with time order or groups, split by time or group. scikit-learn says time-dependent data needs a time-series-aware splitter, and groups such as multiple records per patient should never sit on both sides of the split.

Held-out test set vs cross-validation

Cross-validation replaces the validation set, not the test set. scikit-learn says a test set "should still be held out for final evaluation" (Cross-validation).

Single held-out splitk-fold cross-validation
How it worksOne fixed train, validation, test splitTraining data split into k folds; each fold validates once; scores averaged
Good forLarge data sets, a final scoreSmall data sets, choosing among models
WeaknessFewer samples to learn from; result depends on one random splitScore is a selection score, not a held-out one
Still needs a test set?It is the test setYes

A vendor who reports only a cross-validated score has reported how well it chose, not how well it generalizes.

How a held-out test leaks

Leakage is any path by which test information reaches the model before the final run. Kapoor and Narayanan found leakage errors in 17 fields, affecting 329 papers, and sorted them into 8 types (Leakage and the Reproducibility Crisis):

  1. No test set
  2. Preprocessing on training and test set together
  3. Feature selection on training and test set together
  4. Duplicates in the data set
  5. Features that are not legitimate
  6. Temporal leakage
  7. Nonindependence between train and test samples
  8. Sampling bias in the test distribution

In their civil war prediction case, complex models that seemed to beat older methods did not reproduce. Once leakage was fixed, they did no better than decades-old logistic regression.

Contamination in language models

Large language models add one more route: the benchmark is already in the pre-training text. The GPT-4 technical report checked by sampling three 50-character substrings from each test example and searching the training data (Appendix C). Table 11 of the report found:

BenchmarkShare found in pre-training data
HumanEval25 percent
DROPAbout 21 percent
AI2 Reasoning ChallengeAbout 3.4 percent
WinoGrandeAbout 0.9 percent

On HumanEval, the score on the clean subset was 65.58 percent against 67.0 percent overall. A footnote adds that portions of BIG-bench were inadvertently mixed into the training set. For HellaSwag, the report used a privately held secret holdout instead.

The method has limits. The report says substring matching gives both false negatives and false positives.

Held-out test sets in translation benchmarks

FLORES is built around a hidden test split. FLORES-101 splits its data into dev (997 sentences), devtest (1,012), and test (992). Dev is for hyperparameter tuning, devtest for testing during development, and the test set is not released. You score it through an evaluation server, which the authors say is to "reduce overfitting to the test set" (FLORES-101, Data Splits).

FLORES-200 keeps that design: 3,001 sentences from 842 web articles, split into dev, devtest, and a hidden test split (FLORES-200 README). The README says the repository is no longer updated and points to newer versions.

So a FLORES devtest score is a public-split score. Anyone can download devtest and tune on it. See what FLORES-200 is and machine translation metrics.

How to build a held-out test set

  1. Split first. Set aside the test data before you look at any model results.
  2. Deduplicate across splits. Remove exact and near-duplicate examples that appear in both training and test.
  3. Split by time or group when the data has either, so the test set looks like future data.
  4. Fit preprocessing on training data only. Wrap it in a pipeline so cross-validation does the same.
  5. Tune on validation or cross-validation. Never on the test set.
  6. Score the test set once and report which split the number came from.
  7. Check for contamination if a pre-trained model is involved: search its training data, if you can, for test text.

What to do next

  • Ask any vendor which split produced the score: validation, public devtest, or a hidden test set.
  • Ask who chose the test examples and whether anyone who tuned the system saw them first.
  • Ask how overlap with training data was checked, and the score on the clean subset.
  • For your own work, freeze a test set today and log every time it is scored.
  • If you only have cross-validation results, hold out a final test split before you report.

Azcuna's ELLMENT, the E-2D Large Language Model Entity, was proposed to NAVAIR PMA-231 under Navy SBIR Phase I topic DON26BZ01-NV010. The prototype, built at private expense on publicly available doctrine, answers with a page-level citation and refuses when the documents do not support an answer. The proposal has been submitted.

Questions people ask

What is a held out test set?

A held-out test set is a slice of your data set aside before training and never used for any decision. You train on the training set, choose settings on a validation set, and score the test set once at the end. The scikit-learn guide explains why: testing on training data rewards memorizing, and tuning against the test set leaks knowledge of it into the model.

What is the difference between a validation set and a held-out test set?

The validation set is for choosing: which model, which settings, which prompt. The held-out test set is for the final score only. The scikit-learn guide describes training on the training set, evaluating on the validation set, and doing the final evaluation on the test set. Once a test score informs a choice, that set is acting as a validation set.

Does cross-validation replace a held-out test set?

No. The scikit-learn guide says a test set should still be held out for final evaluation, but the validation set is no longer needed when doing cross-validation. In k-fold cross-validation, the training data is split into k folds, each fold takes one turn as the validation fold, and the score is the average. That average is a selection score, not a held-out one.

What is data leakage in a test set?

Leakage is any path by which test information reaches the model before the final score. Kapoor and Narayanan list 8 types, including no test set, preprocessing on training and test data together, duplicates, temporal leakage, and nonindependence between train and test samples. They found leakage errors in 17 fields, affecting 329 papers. For language models, leakage often comes from benchmark text inside the pre-training data.

How much of a held-out set can leak into a language model?

A lot. The GPT-4 technical report checked its pre-training data by substring match and found about 25 percent of HumanEval and about 21 percent of DROP. A footnote says portions of BIG-bench were inadvertently mixed into the training set, so the authors excluded it from reported results. Builders who check their own data still find overlap, so ask how any benchmark was checked.

What split of FLORES-200 is held out?

The test split. The FLORES-200 README divides its 3,001 sentences into dev, devtest, and a hidden test split. The FLORES-101 paper says dev is for hyperparameter tuning, devtest for testing during development, and the test set is not released but scored through an evaluation server to reduce overfitting. A devtest score is a public-split score, not a strictly held-out one.

Sources

  1. 1Cross-validation: evaluating estimator performance · scikit-learn project documentation
  2. 2Leakage and the Reproducibility Crisis in ML-based Science · arXiv (Kapoor and Narayanan)
  3. 3GPT-4 Technical Report · arXiv (OpenAI)
  4. 4The FLORES-101 Evaluation Benchmark for Low-Resource and Multilingual Machine Translation · arXiv (Goyal et al.)
  5. 5FLORES-200 README · facebookresearch/flores (GitHub)

Where this shows up in our work

More on evaluating language models