# GSM8K test-set contamination: five open math SFT datasets and the FineWeb 10BT sample

**Investigated and retrieved:** 2026-11-30 · **Benchmark:** GSM8K `main/test` (1,319 items) · **License of this submission:** CC BY 4.0

## Verdict

No verbatim or near-verbatim GSM8K test questions were found in any of the six corpora checked, within the detection limits stated below.

| Corpus (pinned revision) | Texts scanned | Test items sharing ≥1 13-gram | ≥50 % of item's 13-grams | Exact question match | Paraphrase hits (number-matched, Jaccard ≥ 0.5) |
|---|---:|---:|---:|---:|---:|
| GSM8K `train` (baseline) | 14,946 | 3 | 1 | 0 | 0 / 938 |
| MetaMathQA-395K | 1,185,000 | 4 | 1 | 0 | 0 / 938 |
| MathInstruct | 524,078 | 3 | 1 | 0 | 0 / 938 |
| Orca-Math-200k | 400,070 | 4 | 1 | 0 | 0 / 938 |
| OpenMathInstruct-2 (all 32 shards, `problem`) | 13,972,791 | 4 | 1 | 0 | 0 / 938 |
| FineWeb `sample-10BT` (all 15 shards) | 14,868,862 docs | **0** | 0 | 0 | not run (see Limitations) |

"Texts" counts each scanned field of each record separately. Which fields were scanned per corpus is listed under Method.

- **The n-gram hits are not leaks.** Every flagged item in the SFT datasets is one of the following:
  - **Items 581, 602 and 632.** Each shares a sentence template with a GSM8K *train* item that has different numbers. For example, test 602 reads "A plane travels 1200 miles in 3 hours. At the same rate, how many additional hours…" and train 1314 reads "A train travels 270 miles in 3 hours. At the same rate, how many additional hours…". The SFT datasets inherit this from the train split, and the train-split baseline shows exactly these three items.
  - **Items 1287, 1185 and 238.** Each shares a single generic 13-gram with one SFT text, for example "…is 20 years old what is the sum of the ages of the…". Coverage is ≤ 5 % of the item.
- **Paraphrase check.** Among SFT texts with exactly the same numbers as a test item, the highest content-word Jaccard in any dataset was **0.25** (Orca-Math). Real LLM rephrasings of GSM8K items score a median **0.65**.
- **FineWeb.** 0 of 14.87 M documents (10.37 B GPT-2 tokens, 95 Common Crawl dumps) contain any 13-gram of any test item. That includes **2,440,018 documents (1.87 B tokens) from the 13 dumps crawled after GSM8K's release** (CC-MAIN-2021-49 … CC-MAIN-2024-10).

## Why this matters

GSM8K remains a standard reasoning benchmark, and these four SFT datasets are widely used to train open math models. Each dataset card says it was derived only from the GSM8K and MATH *train* splits. This submission checks that claim independently against the actual released files. It also gives a reusable, controlled method and per-item results (by index and SHA-256, not question text) that later submissions can extend to other benchmarks or corpora.

## Method

**Normalization.** Unicode NFKC, lowercase, curly quotes mapped to ASCII, every character outside `[a-z0-9]` replaced with a space, whitespace collapsed. Tokens are whitespace-separated words. No test question is shorter than 13 tokens.

1. **Exact match.** The whole normalized corpus text equals the normalized test question.
2. **13-gram overlap.** This is the GPT-3 contamination procedure (Brown et al. 2020, §C). For each test item, all 13-token windows of its question are collected. A corpus text "hits" an item if it contains any of them. For each item we record the largest fraction of its 13-grams found in any single text (`maxcov`).
3. **Paraphrase check.** This targets LLM rewording, which n-grams miss. A test item is eligible if it has ≥ 3 numbers (938 of 1,319). A corpus text is a paraphrase hit if its sorted multiset of numbers is **identical** to the item's, and the Jaccard similarity of their content-word sets (stopwords and numbers removed) is ≥ 0.5. Texts over 4,000 characters are skipped.

**Fields scanned.**
- MetaMathQA: `original_question`, `query`, plus `response` in the n-gram pass.
- MathInstruct: `instruction` and `output`; paraphrase pass on `instruction`.
- Orca-Math: `question` and `answer`; paraphrase pass on `question`.
- OpenMathInstruct-2: `problem`.
- FineWeb: `text`.

### Controls

| Control | Result |
|---|---|
| Test set scanned against itself | 1,319 / 1,319 n-gram hits; 938 / 938 eligible paraphrase hits |
| **Injection:** each test question inserted at a random offset inside a real FineWeb document | 1,319 / 1,319 detected (all as full substrings) |
| **Injection:** only the *first half* of each question's words inserted | 1,232 / 1,319 detected (93.4 %). All 87 misses are short items whose half is < 13 words |
| **Paraphrase recall:** MetaMathQA `GSM_Rephrased` rewrites against their stated `original_question` (54,063 pairs) | **74.6 %** detected. Numbers were preserved in 88 % of pairs; median Jaccard 0.65 |
| Paraphrase recall on `GSM_AnsAug` (same question, new answer) | 100 % |

## Limitations

- **FineWeb is a sample.** `sample-10BT` is described on the card as randomly sampled from the whole dataset. It is about 0.07 % of the original 15 T-token release, and about 0.06 % of the current 18.5 T. Zero hits in 2,440,018 post-release documents gives a 95 % upper bound (rule of three) of **≈ 1.2 contaminated documents per million** post-release documents. Across all 14.87 M sampled documents the bound is ≈ 0.2 per million. Scaled to the full corpus, that bound still allows **up to roughly 4,000 contaminated documents in all of FineWeb**, which this scan cannot rule out.
- **No paraphrase check on web documents.** The number-multiset rule doesn't fit long pages that contain many numbers. Reworded web copies would only be caught if they share a 13-gram.
- **Paraphrase recall is ~75 %, not 100 %.** Rewrites that change numbers fall outside the rule by design. Examples are MetaMathQA's `GSM_SV` and `GSM_FOBAR`, which mask a number, and "same problem, new numbers" templates. A semantic-embedding search would be needed to rule those out.
- **Only the question text was checked.** The matching is word-level, so answers or solutions copied without their question, or test items translated into other languages, would be missed.
- **Pre-release borderline dump.** CC-MAIN-2021-43 (crawled October 2021, the month GSM8K appeared on arXiv as 2110.14168) is counted as *pre-release* in the post-release figures. It holds 202,766 sample documents, also with zero hits.
- **Other sources not covered.** This is not a statement about any model's training data. Closed pretraining corpora, other web crawls, GitHub code and Hugging Face dataset mirrors were not checked. GitHub code search and the Common Crawl index were not reachable from the environment used.
- **"No contamination" here means no textual leakage of test questions into these specific files.** It does not mean these datasets carry no other test-set signal, such as tuning hyperparameters on test accuracy.

## Sources (all retrieved 2026-11-30; SHA-256 of every input file in `results/input_files_sha256.json`)

| Dataset | Hugging Face revision | Files | License |
|---|---|---|---|
| `openai/gsm8k` | `740312add88f781978c0658806c59bc2815b9866` | `main/test-00000-of-00001.parquet`, `main/train-00000-of-00001.parquet` | MIT |
| `meta-math/MetaMathQA` | `aa4f34d3d2d3231299b5b03d9b3e5a20da45aa18` | `MetaMathQA-395K.json` | MIT |
| `TIGER-Lab/MathInstruct` | `b4fdc323a7be1379c9c7c0b67b1de72dfee2111a` | `MathInstruct.json` | MIT |
| `microsoft/orca-math-word-problems-200k` | `29255d1770cc4eac66e5e7fa378cba542c026350` | `data/train-00000-of-00001.parquet` | MIT |
| `nvidia/OpenMathInstruct-2` | `469216e3f46f4dacf476b382e192485ea51a143e` | `data/train-000{00..31}-of-00032.parquet` | CC BY 4.0 |
| `HuggingFaceFW/fineweb` | `9bb295ddab0e05d785b879661af7260fed5140fc` | `sample/10BT/0{00..14}_00000.parquet` | ODC-By 1.0 |

GSM8K test-file SHA-256: `ee7b8da9e381df27b9e3f7758a159ab2bdaa4dbaa910546cbbc47e0cb44e4f59`.

None of the corpora are redistributed here. They total about 44 GB, so they're cited by URL, revision and hash instead. Per-item results identify test items by row index in the pinned test file and by the SHA-256 of the raw question string, so no benchmark text is republished in bulk.

**References.**
- Cobbe et al., "Training Verifiers to Solve Math Word Problems," arXiv:2110.14168, 2021-10-27 (GSM8K).
- Brown et al., "Language Models are Few-Shot Learners," arXiv:2005.14165, 2020 (13-gram contamination method).
- Dataset cards at the revisions above. They state MetaMathQA and OpenMathInstruct-2 are built from the GSM8K/MATH training sets, and that `sample-10BT` is "randomly sampled from the whole dataset."

## Files

- `results/summary.json`: all counts above, including the flagged item indices per corpus.
- `results/per_item.csv`: one row per test item: index, SHA-256, token count, and per corpus the n-gram `maxcov`, exact flag, paraphrase hit and best Jaccard.
- `results/paraphrase_recall.json`: recall of the paraphrase detector on known rephrasings.
- `results/fineweb_shards/*.summary.json`, `*.dumps.json`: per-shard scan results, and documents and GPT-2 tokens per Common Crawl dump.
- `results/input_files_sha256.json`: SHA-256 of all 52 input files.
- `scripts/contam.py`: exact and 13-gram scanner. `scripts/para.py`: paraphrase scanner. `scripts/para_recall.py`, `scripts/inject.py`: controls. `scripts/fineweb_shard.sh`: per-shard download, hash, scan, delete. `scripts/run_all.sh`: the full reproduction, about 1.5 h on 4 CPU cores with about 50 GB disk; Python 3.13 and pyarrow 26.0.1.
