No Memorization, No Detection: Output Distribution-Based Contamination Detection in Small Language Models
Organizations: Tel Aviv University
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. In the majority of conditions we test, CDD performs at chance level even when the data is verifiably contaminated and detectable by simpler methods. We show that probability-based methods, specifically perplexity and Min-k% Prob, outperform CDD in all conditions where any method exceeds chance, suggesting that CDD's peakedness-based approach is insufficient for contamination detection in small language models. Our code is available at https://github.com/Sela-Omer/Contamination-Detection-Small-LM
Figures & tables
| Model | LoRA =8 | LoRA =256 | Full FT |
|---|---|---|---|
| 70M | 98K (0.14%) | 3.1M (4.3%) | 70.4M |
| 160M | 295K (0.18%) | 9.4M (5.5%) | 162.3M |
| 410M | 786K (0.19%) | 25.2M (5.9%) | 405.3M |
| GSM8K | HumanEval | MATH | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| FT | CDD | PPL | Mk% | Ng | CDD | PPL | Mk% | Ng | CDD | PPL | Mk% | Ng | |
| LoRA 8 | 1 | .50 | .58 | .60 | 1.0 | .53 | .53 | .53 | 1.0 | .50 | .58 | .60 | 1.0 |
| 5 | .50 | .63 | .63 | 1.0 | .50 | .56 | .55 | 1.0 | .51 | .64 | .66 | 1.0 | |
| 10 | .51 | .78 | .77 | 1.0 | .50 | .67 | .70 | 1.0 | .50 | .73 | .77 | 1.0 | |
| LoRA 256 | 1 | .50 | .75 | .74 | 1.0 | .50 | .59 | .64 | 1.0 | .51 | .64 | .67 | 1.0 |
| 5 | .59 | 1.0 | 1.0 | 1.0 | .53 | .97 | 1.0 | 1.0 | .53 | .95 | .96 | 1.0 | |
| Prompt | Question: Martha has 18 crayons. She lost half of them, so she bought a new set of 20 crayons. How many crayons in total does Martha have after the purchase? Answer: |
| Ground truth | In the beginning, Martha lost 18 / 2 = <<18/2=9>> 9 crayons. So after she bought a set of new crayons, she has in total 9 + 20 = <<9+20=29>> 29 crayons. #### 29 |
| LoRA =8, 3 epochs (CDD: 0.505, PPL: 0.78, Min-k%: 0.77) | |
| Greedy | Martha lost half of her set of 18 crayons because she lost half of her set of 18 crayons. She bought a new set of 20 crayons because she bought 20 crayons. So, Martha has 18 + 20 = <<18+20=42>> 42 crayons. #### 42 |
| Sample | A pair of crayons has 18 / 2 = <<18/2=9>> 9 crayons. Each new set has 20 + 9 = <<20+9=38>> 38 crayons. #### 38 |
| Full fine-tuning, 3 epochs (CDD: 0.955, PPL: 1.00, Min-k%: 1.00) | |
| Greedy | In the beginning, Martha lost 18 / 2 = <<18/2=9>> 9 crayons. So after she bought a set of new crayons, she has in total 9 + 20 = <<9+20=29>> 29 crayons. #### 29 |
| Peakedness | Temperature | Samples | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| FT | Model | .01 | .02 | .05 | .10 | .20 | .4 | .6 | .8 | 1.0 | 1.2 | 10 | 25 | 50 | 100 | |
| LoRA 8 | 70M | .50 | .50 | .50 | .51 | .50 | .54 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | |
| 160M | .50 | .50 | .50 | .50 | .50 | .52 | .51 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | ||
| 410M | .50 | .50 | .51 | .51 | .52 | .53 | .50 | .51 | .50 | .50 | .50 | .50 | .51 | .51 | ||
| LoRA 256 | 70M | .50 | .50 | .51 | .50 | .50 | .51 | .51 | .51 | .50 | .50 | .51 | .51 | .51 | .51 | |
| 160M | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | .50 | ||
| LoRA =8 | LoRA =256 | |
|---|---|---|
| CDD | .50 .003 | .92 .017 |
| PPL | .76 .034 | 1.0 .000 |
| Min-k% | .74 .027 | 1.0 .000 |
| N-gram | 1.0 .000 | 1.0 .000 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| AUROC | AUPRC | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | FT | Model | CDD | PPL | Mk% | Ng | CDD | PPL | Mk% | Ng |
| GSM8K | r=8 | 70M | .50 | .58 | .57 | 1.0 | .50 | .63 | .62 | 1.0 |
| 160M | .50 | .67 | .65 | 1.0 | .50 | .70 | .67 | 1.0 | ||
| 410M | .50 | .86 | .83 | 1.0 | .50 | .86 | .84 | 1.0 | ||
| r=256 | 70M | .50 | .87 | .83 | 1.0 | .50 | .88 | .85 | 1.0 | |
| 160M | .50 | .98 | .96 | 1.0 | .50 | .98 | .96 | 1.0 | ||
| Prompt | Question: Roger bought a house for $100,000. He was able to pay 20% down, and his parents paid off an additional 30% of the remaining balance. How much money does Roger still owe? Answer: |
| Ground truth | 100000(.20)=20000--. #### 56000 |
| LoRA =8 (CDD: 0.505) | |
| Greedy | The total amount Roger owes is -150 30 = <<150-30=150>> 150 . |
| Sample | He paid 20,000 back. So his total debt was --$ 20 = <<30-20=20>> 20 dollars. |
| LoRA =256 (CDD: 0.915) | |
| Greedy | 100000(.20)=20000--. #### 56000 |
| Prompt | Problem: If , what is the value of ? Solution: |
| Ground truth | , so . |
| LoRA =8 (CDD: 0.500) | |
| Greedy | [repeats] |
| Sample | In order to find we have to find … . |
| LoRA =256 (CDD: 0.830) | |
| Greedy | , so . |
| Prompt | def even_odd_count(num): """Given an integer, return a tuple with the number of even and odd digits. Example: even_odd_count(-12) ==> (1, 1)""" |
|---|---|
| LoRA =8 (CDD: 0.500) | |
| Greedy | even_count = 0; odd_count = 0; for i in range(len(num) - 1): if num[i] == ’0’: even_count += 1 else: odd_count += 1; return (even_count, odd_count) |
| Sample | even, odd = 0, 0; for i in range(0, num): if num % i == 0: even += 1; odd += 1; return tuple(even + odd) |
| LoRA =256 (CDD: 0.844) | |
| Greedy | even_count = 0; odd_count = 0; for i in str(abs(num)): if int(i)%2==0: even_count +=1 else: odd_count +=1; return (even_count, odd_count) |
| Sample | even_count = 0; odd_count = 0; for i in str(abs(num)): if int(i)%2==0: even_count +=1 else: odd_count +=1; return (even_count, odd_count) |
Data Contamination in Language Models
Data contamination in language models examines how training exposure to evaluation data affects measured capability, benchmark validity, and model behavior.
See all 64 papers