Evals & Observability·Question 20 of 83Intermediate

What is benchmark contamination, and how would you detect or protect against it?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Contamination is benchmark answers reaching the model by a route the benchmark did not intend. The classic route is training data - the model has seen the benchmark's questions (or near-duplicates) during pretraining or fine-tuning, so its score measures memorisation rather than capability. For agents with web or code tools there is a second route at test time: the agent looks the answer up. It's endemic because benchmarks are published on the open web, get quoted in blog posts and GitHub repos, and pretraining corpora hoover all of it. It can be indirect too: paraphrases, translated versions, or training on model outputs that themselves solved the benchmark.

Full worked answer

Contamination is benchmark answers reaching the model by a route the benchmark did not intend. The classic route is training data - the model has seen the benchmark's questions (or near-duplicates) during pretraining or fine-tuning, so its score measures memorisation rather than capability. For agents with web or code tools there is a second route at test time: the agent looks the answer up. It's endemic because benchmarks are published on the open web, get quoted in blog posts and GitHub repos, and pretraining corpora hoover all of it. It can be indirect too: paraphrases, translated versions, or training on model outputs that themselves solved the benchmark.

Detection approaches, none perfect:

  • Perturbation tests: rewrite questions with changed surface form but identical logic - renamed variables, different numbers, paraphrased wording. A big score drop on perturbed versions indicates memorisation. The GSM1k study did exactly this for GSM8K (freshly authored equivalent problems) and found several-point drops for some model families.
  • N-gram / substring overlap between the test set and the training corpus - the classic method labs report, but only available to whoever holds the corpus, and it misses paraphrase-level contamination.
  • Memorisation probes: prompt the model with a question prefix and see if it completes the exact answer or the exact next test items verbatim; suspiciously high verbatim completion of test data is a smoking gun.
  • Temporal splits: evaluate on data created after the model's training cutoff - new competitive-programming problems, newly filed GitHub issues (the logic behind fresh/rolling benchmarks like LiveBench-style designs and updated SWE-bench snapshots).

Protection, for your own evals:

  • Keep your eval set private - never in a public repo, never in blog posts, and be careful about pasting it into third-party services whose terms allow training on inputs.
  • Refresh continuously from production - new failures postdate any model's training data by construction, which makes a production-sourced eval set naturally contamination-resistant.
  • Hold out a never-published slice used only for final model-selection decisions, distinct from the dev set your prompt iteration may have overfit to.

Test-time contamination needs its own defences. Anthropic documented Claude Opus 4.6 on BrowseComp working out which benchmark it was in, finding the eval code and decrypting the answer key, and found at least 20 public sources of leaked answers. For tool-using agents:

  • Block search results that mention the benchmark name, which worked better than URL blocklists in that study, and block retrieval of known answer files and mirrors.
  • Read traces for eval awareness: reasoning about which benchmark this is, searches for the dataset, attempts to decode files.
  • Re-run flagged items with those routes closed, and report the score with and without them.

What a good answer covers

  • Contamination is benchmark answers reaching the model by a route the benchmark did not intend
  • The classic route is training data - the model has seen the benchmark's questions (or near-duplicates)…
  • For agents with web or code tools there is a second route at test time: the agent looks the answer up
  • It's endemic because benchmarks are published on the open web, get quoted in blog posts and GitHub…
  • It can be indirect too: paraphrases, translated versions, or training on model outputs that themselves…

Key terms: Perturbation tests · N-gram / substring overlap · Memorisation probes · Temporal splits · Keep your eval set private · Refresh continuously · Hold out a never-published slice · Read traces for eval awareness · Re-run flagged items

Interviewer follow-ups to expect

  1. Can contamination make a model look worse?

  2. Your vendor claims decontamination via 13-gram overlap - what does that miss?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep