Evaluation-Driven Development › Splits, Holdouts, and the Contamination Boundary

Michael BrenndoerferDecember 2, 20263 min read
Language AI HandbookAll chapters
Part 64 of 67Compound AI System Design
Chapter 487Evaluation-Driven Development › Splits, Holdouts, and the Contamination Boundary
Reading section 4 of 14 · Splits, Holdouts, and the Contamination Boundary · 3 minSection 4 of 14 · 3 min

Section 4 of 14 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

A case used to choose the prompt has become development evidence. Subsequent performance on that case measures behavior on a known example. Adaptive reuse can overfit a holdout even when tuners see only aggregate feedback. Dwork et al. (2015)

Keep cases for development and reserve separate cases to confirm changes. A known failure can also become a regression test once resolved. Regression cases deliberately remain known and protect behavior you have already fixed. In a real split, keep duplicates, paraphrases, and examples from the same underlying customer issue in one partition when they would otherwise leak across it.

PythonIn [9]
CollapseExpand
import random


def split_suite(cases: list[Case], holdout_frac=0.34, seed=7):
    if len(cases) < 2 or not 0 < holdout_frac < 1:
        raise ValueError(
            "Need at least two cases and a fraction strictly between 0 and 1."
        )
    rng = random.Random(seed)
    shuffled = cases[:]
    rng.shuffle(shuffled)
    n_hold = min(len(shuffled) - 1, max(1, round(len(shuffled) * holdout_frac)))
    return {"holdout": shuffled[:n_hold], "dev": shuffled[n_hold:]}
PythonIn [10]
CollapseExpand
splits = split_suite(SUITE)
for name, cases in splits.items():
    print(name, "->", [c.case_id for c in cases])
ConsoleOut [10]
CollapseExpand
holdout -> ['c005', 'c001']
dev -> ['c006', 'c004', 'c002', 'c003']

The seeded example gives four dev cases and two holdout cases. Both partitions are visible here so you can inspect the mechanics. This notebook uses dev for tuning examples and makes no generalization claim from the toy holdout.

Inspect the split before treating it as a representative sample. The chart counts how many cases each slice contributes to each partition. The toy holdout contains no technical cases. Protecting technical behavior on this split therefore requires other evidence.

PythonIn [11]
CollapseExpand
partition_groups = ["billing", "technical", "multilingual"]
partition_counts = {
    partition: [
        sum(case.slice == group for case in cases) for group in partition_groups
    ]
    for partition, cases in splits.items()
}
partition_rows = list(range(len(partition_groups)))
VisualizationOut [12]
CollapseExpand
Development contains one billing, two technical and one multilingual case. Holdout contains one billing and one multilingual case.
The seeded split leaves technical tasks out of the toy holdout. Both holdout cases come from the other two slices.
The holdout is not a scratchpad

Restrict access to holdout cases and detailed outputs during tuning. If you inspect a failure and tune against it, move it into dev or the known regression set. Replace it with fresh confirmation data when you need an independent estimate.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy