The Impact of Post-training on Data Contamination
Muhammed Yusuf Kocyigit, Caglar Yildirim
TL;DR
This study evaluates how data contamination interacts with post-training in large language models by injecting contamination into a $25\text{B}$-token pre-training corpus and examining outcomes after extended pre-training and after two post-training paradigms, SFT and GRPO. Using Qwen2.5 ($0.5/1.5$B) and Gemma3 ($1/4$B) variants, the authors find that contamination creates a transient performance spike during exposure, which fades with more pre-training but re-emerges under post-training. SFT tends to inflate scores on contaminated benchmarks only, whereas GRPO inflates performance on both contaminated and uncontaminated benchmarks, indicating different implications for memorization versus generalization. Model scale amplifies these effects: larger models exhibit stronger memorization under SFT but broader generalization under GRPO, highlighting the need for contamination audits after post-training and suggesting RL-based post-training can mitigate some over-estimation risks. These findings inform evaluation practices and mitigation strategies across the full model life cycle, from pre-training through alignment and deployment.
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.
