Detect Benchmark Contamination in a Coding Agent Evaluation Set
Last updated: November 29, 2026
Quick Overview
A lab client suspects that some tasks in a coding benchmark you built appear in their model's pretraining data. Describe how you would measure contamination, decide which tasks to retire, and keep future benchmark releases clean.
Turing
November 29, 20260
0
0 solved
A lab client suspects that some tasks in a coding benchmark you built appear in their model's pretraining data. Describe how you would measure contamination, decide which tasks to retire, and keep future benchmark releases clean.
Turing builds benchmarks from real repositories, which are exactly the public code that frontier models train on. The interviewer wants a candidate who combines text-overlap methods with model-behavior evidence and knows the limits of each.
What the Interviewer Expects
- Distinguishes text overlap evidence from model memorization evidence
- Uses n-gram or MinHash overlap against available corpora
- Uses behavioral probes such as completion of gold patches and perplexity comparisons
- Compares performance on tasks before and after model data cutoff
- Proposes release practices such as held-out private splits and post-cutoff tasks
- Quantifies uncertainty rather than declaring tasks clean
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- What if you have no access to the client's training corpus at all?
- How would you build a benchmark that stays useful as models train on newer data?
- Could paraphrasing tasks fix contamination, and what would it break?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Contamination can mean the issue text, the gold patch, the tests, or the whole repository state appear in training data. Each matters differently: seeing the repo is normal; seeing the exact fix is a ...
Approach
Three lines of evidence. Overlap: compute 13-gram or MinHash similarity between gold patches plus issue text and any corpus we can search; flag tasks with long exact matches. Behavior: prompt the mode...