Table of Contents
Fetching ...

No Memorization, No Detection: Output Distribution-Based Contamination Detection in Small Language Models

Omer Sela

TL;DR

It is found that CDD's effectiveness depends critically on whether fine-tuning produces verbatim memorization, and only when fine-tuning capacity is sufficient to induce memorization does CDD recover strong detection accuracy.

Abstract

CDD, or Contamination Detection via output Distribution, identifies data contamination by measuring the peakedness of a model's sampled outputs. We study the conditions under which this approach succeeds and fails on small language models ranging from 70M to 410M parameters. Using controlled contamination experiments on GSM8K, HumanEval, and MATH, we find that CDD's effectiveness depends critically on whether fine-tuning produces verbatim memorization. With low-rank adaptation, models can learn from contaminated data without memorizing it, and CDD performs at chance level even when the data is verifiably contaminated. Only when fine-tuning capacity is sufficient to induce memorization does CDD recover strong detection accuracy. Our results characterize a memorization threshold that governs detectability and highlight a practical consideration: parameter-efficient fine-tuning can produce contamination that output-distribution methods do not detect. Our code is available at https://github.com/Sela-Omer/Contamination-Detection-Small-LM

No Memorization, No Detection: Output Distribution-Based Contamination Detection in Small Language Models

TL;DR

It is found that CDD's effectiveness depends critically on whether fine-tuning produces verbatim memorization, and only when fine-tuning capacity is sufficient to induce memorization does CDD recover strong detection accuracy.

Abstract

CDD, or Contamination Detection via output Distribution, identifies data contamination by measuring the peakedness of a model's sampled outputs. We study the conditions under which this approach succeeds and fails on small language models ranging from 70M to 410M parameters. Using controlled contamination experiments on GSM8K, HumanEval, and MATH, we find that CDD's effectiveness depends critically on whether fine-tuning produces verbatim memorization. With low-rank adaptation, models can learn from contaminated data without memorizing it, and CDD performs at chance level even when the data is verifiably contaminated. Only when fine-tuning capacity is sufficient to induce memorization does CDD recover strong detection accuracy. Our results characterize a memorization threshold that governs detectability and highlight a practical consideration: parameter-efficient fine-tuning can produce contamination that output-distribution methods do not detect. Our code is available at https://github.com/Sela-Omer/Contamination-Detection-Small-LM
Paper Structure (45 sections, 1 equation, 9 figures, 7 tables)

This paper contains 45 sections, 1 equation, 9 figures, 7 tables.

Figures (9)

  • Figure 1: GSM8K: CDD detection accuracy across model sizes, fine-tuning methods, and contamination levels. Each cell shows accuracy (chance = 0.50). CDD fails entirely with low-capacity fine-tuning (top rows) but succeeds when fine-tuning produces memorization (bottom rows, larger models). The transition is sharp, not gradual.
  • Figure 2: GSM8K: Final training loss vs. CDD accuracy across all contaminated conditions. Each point is one model/ft-method/contamination-level combination. Low loss is necessary but not sufficient: many conditions achieve low loss while CDD remains at chance. CDD accuracy rises only when loss approaches zero, indicating output distribution collapse.
  • Figure 3: GSM8K: Peakedness distributions for Pythia-410M at contamination level 10. (a) With LoRA $r$=8, both contaminated and clean examples cluster at zero. (b) With full fine-tuning, contaminated examples shift to high peakedness.
  • Figure 4: HumanEval: CDD detection accuracy across model sizes, fine-tuning methods, and contamination levels (3 epochs). The memorization threshold pattern from GSM8K is replicated.
  • Figure 5: HumanEval: Final training loss vs. CDD accuracy.
  • ...and 4 more figures