The Impact of Post-training on Data Contamination

Muhammed Yusuf Kocyigit, Caglar Yildirim · Submission to ICLR 2026 · Rejected

TL;DR

Data contamination—where test questions leak into training sets—might seem to "wash out" during extended pre-training, but it is actually just lying dormant. This paper reveals that standard post-training techniques like Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL) act as catalysts that resurface this hidden information, though RL (specifically GRPO) surprisingly manages to convert some of that leaked data into broader, generalizable reasoning skills.

What Problem Does This Paper Address?

As Large Language Models (LLMs) become the backbone of modern AI, we rely heavily on benchmarks like GSM8K (math) and MBPP (coding) to judge their progress. However, these benchmarks are only valid if the model hasn't seen the questions before. Recent studies have shown that "contamination"—direct or near-duplicate overlap between test sets and training data—is rampant.

Most existing research looks at contamination immediately after the pre-training phase. But models aren't deployed right after pre-training; they undergo "post-training" (alignment) to follow instructions. The authors set out to answer a critical question: Does post-training hide contamination, or does it amplify it? Furthermore, does the type of post-training (SFT vs. RL) change how a model "cheats"?

Methods

The researchers conducted a controlled "poisoning" experiment:

  1. Baseline & Injection: They started with clean checkpoints of Qwen2.5 (0.5B, 1.5B) and Gemma-3 (1B, 4B). They then performed "extended pre-training" on 25 billion tokens.
  2. The Leak: In the contaminated versions, they injected five copies of the GSM8K and MBPP test sets into the first 2 billion tokens of the 25B token stream.
  3. The "Wash-out": They continued training on the remaining 23 billion tokens of clean data to see if the model would "forget" the leaked items.
  4. Post-Training: They applied two popular methods:
  5. SFT: Standard supervised fine-tuning on reasoning steps.
  6. GRPO (Group Relative Policy Optimization): A newer, efficient RL method that rewards models for correct answers and proper formatting without needing a separate reward model.
  7. Audit: They compared the performance of clean vs. contaminated models at every stage.

Datasets

  • Pre-training Mix: A 25B token blend of FineWeb-Edu (web text), CodeParrot (code), and OpenMath-Instruct (math).
  • Contaminated Benchmarks: GSM8K (grade school math) and MBPP (basic Python programming).
  • Generalization Benchmarks: To see if the model actually learned to reason or just memorized the test, they used GSMPlus (adversarial variations of GSM8K) and HumanEval (a distinct coding benchmark).

Key Insights and Ideas

  • The "Wash-out" Illusion: Immediately after seeing the leaked data, model performance spikes. However, as pre-training continues on clean data, that spike vanishes. By the end of 25B tokens, the contaminated model looks almost identical to the clean one. The data isn't "erased"; it's just "submerged" in the weights.
  • Post-training as a Developer Fluid: SFT and RL act like the chemicals used to develop a photograph. They "resurface" the hidden contamination, causing performance gaps to widen again by 2% to 4%.
  • SFT Memorizes, RL Generalizes: This is the most striking finding. SFT-tuned models showed "horizontal" improvement—they got much better at the specific leaked questions but showed zero improvement on the uncontaminated GSMPlus. Conversely, RL-tuned models (GRPO) showed "diagonal" movement—the leakage helped them perform better on both the leaked test and the clean, unseen benchmarks.
  • Scaling Amplifies the Split: As models get larger, SFT becomes better at "extracting" the specific leaked answers (better cheating). Larger RL models, however, seem better at leveraging that leaked data to build more robust, transferable reasoning patterns.

Key Results

  • Dormancy: After 25B tokens of clean pre-training, the performance gap between clean and contaminated models was nearly 0%.
  • Resurfacing: After post-training, the gap reappeared, reaching up to 4% in some models.
  • External Validity: For SFT, the "contamination-gap difference" (the delta between leaked vs. clean task gains) increased with model size, suggesting pure over-estimation. For GRPO, this difference actually decreased or became negative as the model grew, suggesting the model was using the leaked data to learn general rules rather than just memorizing strings.

Limitations and Future Work

  • Model Scale: The study was limited to models up to 4B parameters. While the scaling trends are clear, it remains to be seen if 70B+ models behave the same way.
  • Injection Style: The authors used a "5-copy, late-injection" scenario. Real-world leakage is often more subtle, involving paraphrases or fragments scattered throughout trillions of tokens.
  • Reward Signal: The RL phase used synthetic, rule-based rewards. The authors note that human-annotated preference signals (RLHF) might produce different results.
  • Future Direction: The researchers call for "life-cycle evaluations"—auditing for contamination after every stage of training, not just at the beginning.

Summary updated

Abstract

We present a controlled study of how dataset contamination interacts with the post-training stages now standard in large language model training pipelines. Starting from clean checkpoints of Qwen2.5 (0.5B/1.5B) and Gemma3 (1B/4B), we inject five copies of GSM8K and MBPP test items into the first 2B tokens of an otherwise 25B token extended pre-training dataset. We then compare the contaminated and clean models both immediately after pre-training and again after two popular post-training methods: supervised fine-tuning (SFT) and reinforcement learning (RL) with group relative policy optimization (GRPO). The applied post-training steps do not have any contamination. Across math and coding benchmarks, we find three consistent patterns: (i) Contamination causes performance spikes that are gradually diminished with continued pre-training. After even 25B tokens the apparent performance inflation of contamination can become close to zero. (ii) Both SFT and GRPO resurface the leaked information, but with different external validity: SFT inflates scores only on the contaminated tasks, whereas GRPO also inflates performance on uncontaminated counterparts (GSMPlus, HumanEval). (iii) Model scale amplifies these tendencies, larger Supervised Fine Tuned models memorize more, while larger GRPO models translate leakage into more generalizable capabilities. Our results underscore the need for contamination audits \emph{after} post-training and suggest that RL-based post-training, although not immune, can help alleviate contamination-related over-estimation problems.
BibTeX
@inproceedings{kocyigit2025impact,
  author = {Muhammed Yusuf Kocyigit and Caglar Yildirim},
  title = {{The Impact of Post-training on Data Contamination}},
  booktitle = {LLM Evaluation @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=SnPmnvMQ3k},
}
Figure