ML basics
Leakage & data splits
If test data leaks into training — or few-shot examples — your scores lie.
What it is and why it exists
Leakage: information from the evaluation set reaches the system being evaluated (duplicates across splits, future data in training, eval examples used as few-shot prompts or fine-tuning data). It inflates offline scores and disappoints in production.
Quick prototype
Random split.
In production, at scale
Deduplicate across splits, split by time or by customer where relevant, keep eval items out of prompts and training data, and refresh eval sets from new traffic.
Vendors and tools
| Dedup with hashing / embeddings | Find near-duplicates |
|---|
How it fails
- Golden set questions also present as few-shot examples
What the interviewer asks next
How can a RAG eval leak?
If the eval questions were generated from the same chunks and the answers are verbatim, or if eval items are in the few-shot examples or fine-tuning data.