Fine-Tuning, and When Not ToLesson 69 of 84

Module 8 · Did it actually work

A held-out set that actually holds

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 3 of 9 in this chapter

This chapter’s goalCompare a tuned model against a cost-matched baseline on a leak-free held-out set, report the difference with an interval, and demonstrate whether general capability, safety behaviour or calibration regressed.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Four ways a random split leaksNear-duplicate leakageVariations of the same ticket land on both sides,and the model scores well by recall rather than bygeneralising. Invisible, and almost nobody measuresit.Group leakageOne customer’s forty tickets split across bothsides. Split by customer, document, session orauthor: whatever unit actually repeats.Temporal leakageTraining on September and testing on August.Production always runs on the future, so split bytime and accept the lower number.Template leakageThe same template on both sides with different slotvalues. You have measured slot-filling, not thetask.Measure the overlap rather than assuming it: run the same MinHash comparison you used for cleaning,across the split. On real assembled datasets it comes back at 5 to 15 per cent.
Measure the overlap rather than assuming it: run the same MinHash comparison you used for cleaning, across the split. On real assembled datasets it comes back at 5 to 15 per cent.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Random splitting is not enough

A random 90/10 split feels safe and leaks constantly. Four distinct leaks, each with a fix.

Near-duplicate leakage. Your corpus contains variations of the same ticket. A random split puts some in training and their near-twins in evaluation, and the model scores well by recall rather than by generalisation.

This is the big one, it is invisible, and almost nobody measures it. Run the same MinHash comparison you used for cleaning, but across the split:

Python
lsh = MinHashLSH(threshold=0.8, num_perm=128)
for i, t in enumerate(train_texts):
    lsh.insert(f"tr{i}", minhash(t))
leaked = sum(1 for t in eval_texts if lsh.query(minhash(t)))
print(f"{leaked}/{len(eval_texts)} eval items have a near-duplicate in train")

On real assembled datasets this frequently comes back at 5 to 15%. Every one of those items is inflating your score.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Running Models Yourself exam.

Stuck on something?Ask Rafael, your AI tutor

How to cite: Addaly (2026) ‘A held-out set that actually holds’, in Fine-Tuning, and When Not To. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/fine-tuning/a-held-out-set-that-holds (Accessed: 29 November 2026).