CSE Roadmap

Specialist tier · about 5 hours · 12 parts

Part 9 of 12 · 2 min read

Mistakes that let a dirty dataset look clean

Common mistakes, and what the example does not do.

Mistakes that let a dirty dataset look clean

  • Random row split of data with duplicates.
  • Deduplicating only exact matches.
  • Skipping the verification step after LSH.
  • Cleaning without measuring on the model you will train.
  • Treating a flagged label as wrong without review.
  • Ignoring lineage of synthetic data and benchmark overlap.
  • Training only on synthetic data with no real anchor.
  • Using a teacher with a blind spot and assuming more data fixes it.
  • Scrubbing personal data with one regex and calling it done.
  • Reporting benchmark scores without contamination checks.

What the example does not do

About this example What the example does not do
  • Synthetic tokens, not language: a bag-of-words signal with independent words; real text has syntax, context and ambiguity.
  • Small scale: about 2,500 rows; real dedup runs on billions and needs distributed LSH.
  • Simple models: Naive Bayes is robust to noise; 1-nearest-neighbour is a stand-in for a memorising network, not a language model.
  • Planted defects: near-duplicates are generated by five edits; all have Jaccard of at least 0.6, which is why brute force matched the ground truth exactly.
  • The label-noise detector works well because the classes are close to separable bags of words.
  • The collapse simulation re-estimates a categorical distribution; it is not the neural-network experiments in the published studies.
  • No embedding dedup, no toxicity or copyright filters, no human review costs.
  • Optional real experiment: take a few thousand rows of your own agent traces, find near-duplicates with datasketch or this module's code, compare a random split with a group split on a small fine-tune, and measure the score gap.

Check yourself

Your agent-trace dataset has retries and templated runs. Why split by group and not by random row?

Show answer

A random split puts an example in train and its near-copy in test, which inflates any model that memorises. In the toy a 1-nearest-neighbour model scored 0.652 on a random split and 0.481 on a group split; Naive Bayes barely moved.

For the curious Measure each cleaning step on the model you will train

Dedup and markup stripping moved Naive Bayes by under a point but the memorising model by several. MinHash with 16 bands of 4 rows found 99.6 percent of near-duplicate pairs from 499 candidates, against 3,073,960 pairs for all-pairs comparison. A student model trained on a blind teacher inherited its blind spot. All of this is synthetic text with planted defects and tiny models, not LLM training.

What you will use daily at work

Practice What it looks like
Define 'duplicate' first Whole document, paragraph or sentence; exact or fuzzy.
Normalise, dedupe, then filter And keep counts at every step.
Check contamination with n-grams Report results on the clean subset.
Review flagged labels by hand A model-based flag is a lead, not a verdict.