Skip to content
Agentmart
Submit a tool

benchmark-contamination-scan

Scan training data for benchmark contamination — n-gram overlap, embedding similarity, and exact canary detection against 60+ evaluation datasets.

Skill by mkurman

IndexedMIT★ 325
Write a review

Chalk Labs

Need help deploying benchmark-contamination-scan?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/mkurman-benchmark-contamination-scan

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Scan training data for benchmark contamination — n-gram overlap, embedding similarity, and exact canary detection against 60+ evaluation datasets.

Use cases: data, ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Nov 1, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/benchmark-contamination-scan

What's inside

Skill name
benchmark-contamination-scan
Description
Scan training data for benchmark contamination — n-gram overlap, embedding similarity, and exact canary detection against 60+ evaluation datasets.
License
MIT
Instructions
132 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Benchmark Contamination Scan

## Overview

Training on benchmarks is the cardinal sin of ML. This skill scans your training data against a curated exclusion list of 60+ benchmarks using n-gram overlap (fast, high recall) and embedding similarity (slow, high precision).

## When to Use

Mandatory before every training run. Run on pre-training data, instruction tuning data, and RL alignment data.

## Exclusion List

```python
BENCHMARKS = {
    "mmlu": {"name": "MMLU", "source": "huggingface://cais/mmlu"},
    "hellaswag": {"name": "HellaSwag", "source": "huggingface://Rowan/hellaswag"},
    "gsm8k": {"name": "GSM8K", "source": "huggingface://gsm8k"},
    "humaneval": {"name": "HumanEval", "source": "huggingface://openai_humaneval"},
    "boolq": {"name": "BoolQ", "source": "huggingface://boolq"},
    "arc": {"name": "ARC", "source": "huggingface://ai2_arc"},
    "winogrande": {"name": "Winogrande", "source": "huggingface://winogrande"},
    "piqa": {"name": "PIQA", "source": "huggingface://piqa"},
    "siqa": {"name": "Social IQA", "source": "huggingface://social_i_qa"},
    "openbookqa": {"name": "OpenBookQA", "source": "huggingface://openbookqa"},
    "squad": {"name": "SQuAD", "source": "huggingface://rajpurkar/squad"},
    "natural_questions": {"name": "Natural Questions", "source": "huggingface://natural_questions"},
    "triviaqa": {"name": "TriviaQA", "source": "huggingface://trivia_qa"},
    "medqa": {"name": "MedQA", "source": "huggingface://bigbio/med_qa"},
    "pubmedqa": {"name": "PubMedQA", "source": "huggingface://pubmed_qa"},
    # Add all evaluation datasets used in your project
}
```

## N-gram Overlap Scan

```python
from collections import defaultdict
import hashlib

class ContaminationScanner:
    def __init__(self, n=13):
        self.n = n
        self.benchmark_ngrams = {}
        self._load_benchmarks()
    
    def _ngrams(self, text):
        tokens = text.split()
        return set(" ".join(tokens[i:i+self.n]) for i in range(len(tokens) - self.n + 1))
    
    def _load_benchmarks(self):
        """Load and hash all benchmark texts."""
        for bid, bm in BENCHMARKS.items():
            try:
                ds = load_dataset(bm["source"], split="test")
                all_ngrams = set()
                for example in ds:
                    text = " ".join(str(v) for v in example.values() if isinstance(v, str))
                    all_ngrams.update(self._ngrams(text))
                self.benchmark_ngrams[bid] = {
                    "ngrams": all_ngrams,
                    "n_examples": len(ds),
                }
            except Exception as e:
                print(f"Could not load {bm['name']}: {e}")
    
    def scan_example(self, text):
        """Check a single training example. Returns list of [benchmark, n_matches]."""
        example_ngrams = self._ngrams(text)
        if not example_ngrams:
            return []
        hits = []
        for bid, bm_data in self.benchmark_ngrams.items():
            overlap = len(example_ngrams & bm_data["ngrams"])
            if overlap > 0:
                hits.append({"benchmark": BENCHMARKS[bid]["name"], "n_matching_ngrams": overlap})
        return hits
    
    def scan_dataset(self, examples, threshold=5):
        """Scan full dataset. threshold = min matching ngrams to flag."""
        contaminated = []
        for i, example in enumerate(examples):
            text = " ".join(str(v) for v in example.values() if isinstance(v, str))
            hits = self.scan_example(text)
            if any(h["n_matching_ngrams"] >= threshold for h in hits):
                contaminated.append({"index": i, "hits": hits})
        return contaminated
```

## Embedding Similarity Scan

For semantic contamination (paraphrased benchmarks):

```python
from sentence_transformers import SentenceTransformer, util

model = SentenceTransformer("all-MiniLM-L6-v2")

def embedding_scan(text, benchmark_texts, threshold=0.85):
    emb_text = model.encode(text)
    emb_bench = model.encode(benchmark_texts)
    scores = util.cos_sim(emb_text, emb_bench)[0]
    hits = [(i, float(s)) for i, s in enumerate(scores) if s > threshold]
    return hits
```

## Reporting

```markdown
# Contamination Scan Report
Date: [YYYY-MM-DD]
N-gram size: 13
Bencharks scanned: [N]
Training examples: [N]
Contaminated examples: [N] (X.X%)
Excluded from training: [N]

## By Benchmark
| Benchmark | Contaminated | Action |
|-----------|-------------|--------|

From mkurman/zorai, MIT.

More from mkurman/zorai

Signals

Stars
325
Forks
24
Open issues
0
Last commit (this folder)
May 17, 2026 (5 months ago)
Last release
Oct 23, 2026 (13 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
Website
zorai.app/
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from mkurman

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get benchmark-contamination-scan running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying benchmark-contamination-scan?

CallGet help
Cite this page

benchmark-contamination-scan skill. Agent Mart. https://agentmart.dev/skills/mkurman-benchmark-contamination-scan (last updated 2026-10-24)