The mechanism
The locked part is the held-out set. Three rules for it.- Never train on it.
- Never use it to pick between models while you are still building. Every peek makes it a little less held out.
- Measure before and after on it, and nowhere else.
Run it
The setup is lesson 2’s run and lesson 3’s judge. The split here is by position, which is fine for a demo only because the run is reproducible (the default without a clock): withreproducible=False
rows land in completion order, and a slow rollout can put one ask’s
four tries on both sides of the cut. For
real rows, split by task so all four tries of an ask land on the same
side.
Two rows are planted in the training set, both carrying a task id from
another team, the ordinary case when rows arrive from a vendor or a Hub
set. One is a copy of a held-out ask. The other asks the same thing in
different words.
exact rule,
the one input the check catches every time. The paraphrase asks the same
question about the same order and shares no run of eight words with it,
so it stayed in the training set, and a model trained on kept would
have seen the held-out ask. Word overlap does not see a paraphrase.
Three things follow. The ids matter: had the copy kept its own task id,
the same_task rule would have caught it first, and that rule needs a
scenario_id or task_id on both sides; an eval set that carries none
(a public benchmark, logged traces) leaves only the text rules, and the
report says so in rules_skipped and notes rather than printing
n_same_task: 0 as if the ids had been compared. The rows the check
drops are rows that would have made the after score lie, and every one
of them is worth dropping; the rows it cannot see are on you. And there
is a second pass for what it cannot see: embedder= turns on the
semantic rule, which compares meaning rather than words. It needs an
embedding model, so it is off by default, and the one-line call is:
kept still carries the run’s system
prompt and tools, so the next lesson’s select(kept, mode="sft").export(...)
writes both.
Public benchmarks have the same problem at scale: their questions are on
the internet, so they are in the pretraining data. That is one reason a
test built from your own traffic, checked for overlap, says more about
your agent than a leaderboard does.
Where it comes from
- Lambert, N. Reinforcement Learning from Human Feedback. arXiv:2504.12501, 2025. Chapter Evaluation: contamination, and why held-out sets decay.
- Touvron, H. et al. Llama 2: Open Foundation and Fine-Tuned Chat Models. arXiv:2307.09288, 2023. The 8-gram, 80% coverage rule.
- Miller, E. Adding Error Bars to Evals. arXiv:2411.00640, 2024. The before-and-after on the same questions is a paired test.