No Memorization, No Detection: Output Distribution-Based Contamination Detection in Small Language Models
Omer Sela · 2026
Read No Memorization, No Detection: Output Distribution-Based Contamination Detection in Small Language Models by Omer Sela (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-03203.txt.
Introduction
Omer Sela shows that a popular contamination detector mostly fails on small language models. The method, called CDD, flags test data leaked into training by checking whether a model's sampled outputs look unusually peaked. His 2026 study runs controlled contamination experiments on math and coding benchmarks with models from seventy to four hundred ten million parameters.
In most conditions, CDD performed at chance level even when contamination was certain and simpler methods could see it. The detector only works when fine-tuning makes the model memorize text verbatim, which small models often do not. Probability-based scores, perplexity and a minimum-probability variant, beat CDD in every condition where anything beat chance. The warning matters for benchmark hygiene claims based on small models.
Catalog record
| CREATOR | Omer Sela |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 38770 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2603.03203
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
No Memorization, No Detection: Output Distribution-Based Contamination Detection in Small Language Models Omer Sela 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 1 Introduction Data contamination, the presence of evaluation data in a model’s training set, undermines the trustworthiness of language model benchmarks ( Magar and Schwartz 2022 ; Jacovi et al. 2023 ; Sainz et al. 2023 ) . As models are trained on increasingly large and opaque corpora, detecting contamination has become essential for reliable evaluation. Dong et al. 2024 introduced CDD (Contamination Detection via output Distribution), which detects contamination by measuring the peakedness of a model’s output distribution. The intuition is that a model trained on specific data will produce abnormally similar outputs when sampled repeatedly on that data, because training collapses the output distribution toward the memorized answer. CDD requires only sampled text, making it applicable even to black-box models, and achieves 21–30% relative improvement over baselines on 7B-parameter models. A key question, however, is whether CDD’s effectiveness depends on the fine-tuning regime. CDD detects peaked output distributions: cases where a model produces highly similar outputs regardless of sampling randomness. In practice, this occurs when training collapses the output distribution, typically through memorization. But contamination does not always produce such collapse. A model can be trained on leaked data and learn from it without converging to a single output, particularly when parameter-efficient methods limit the model’s capacity. We study this phenomenon systematically using Pythia models ( Biderman et al. 2023b ) (70M–410M parameters) fine-tuned on GSM8K ( Cobbe et al. 2021 ) , HumanEval ( Chen et al. 2021 ) , and MATH ( Hendrycks et al. 2021 ) with controlled contamination levels. We vary three axes: model size, fine-tuning method (LoRA ( Hu et al. 2022 ) with rank 8 and 256, and full fine-tuning), and training duration (3 and 20 epochs). Our main findings: • CDD requires output distribution collapse to succeed. With LoRA r =8 and 3 epochs, training loss decreases and all baseline methods confirm contamination, but CDD performs at chance because the model’s output distribution has not collapsed. • A memorization threshold governs detectability. CDD accuracy transitions sharply from chance to > 90% as fine-tuning capacity crosses a threshold. This threshold depends on the interaction of model size, adapter rank, and training duration. • Practical blind spot. Parameter-efficient fine-tuning, increasingly the default for model adaptation, can produce contamination that CDD cannot detect. This represents a silent failure mode for peakedness-based detection. 2 Related Work Data contamination detection. The problem of benchmark data appearing in training corpora was first operationalized at scale by Brown et al. 2020 , who used 13-gram overlap to audit GPT-3’s training set. Subsequent work developed detection methods that do not require training data access. Li 2023 proposed perplexity as a proxy for memorization. Shi et al. 2024 introduced Min-k% Prob, which flags text as seen during pretraining when its lowest-probability tokens are unusually high. Golchin and Surdeanu 2024 designed prompt-based probes using dataset metadata, and Oren et al. 2024 proposed a statistical test with formal false-positive guarantees. Deng et al. 2024 combined retrieval-based auditing with slot-guessing probes. CDD ( Dong et al. 2024 ) takes a distributional approach: it measures the peakedness of the edit distance distribution between a greedy reference output and temperature-sampled outputs. CDD was validated on 7B models (CodeLlama, Llama2, Bloom) using LoRA fine-tuning. Our work reveals that CDD’s effectiveness is contingent on the fine-tuning regime producing sufficient memorization, a condition that does not always hold for smaller models or lower-rank adapters. Memorization in language models. Carlini et al. 2023 showed that memorization increases with model scale and data duplication. Tirumala et al. 2022 found that larger models memorize faster and can memorize more data before overfitting signals emerge. Biderman et al. 2023a used the Pythia suite to study whether memorization can be predicted from early training checkpoints. These findings motivate our investigation: if memorization depends on model capacity, then detection methods that rely on memorization signals should also depend on capacity. Parameter-efficient fine-tuning and memorization. LoRA ( Hu et al. 2022 ) adapts models by training low-rank matrices, updating only a small fraction of parameters. Mireshghallah et al. 2022 found that adapter-based fine-tuning can reduce susceptibility to extraction attacks compared to full fine-tuning. This is directly relevant to our central finding: LoRA’s reduced parameter budget limits memorization, which in turn limits CDD’s ability to detect contamination. 3 Method 3.1 CDD: Contamination Detection via Output Distribution CDD ( Dong et al. 2024 ) rests on the observation that training alters a model’s output distribution, making it more peaked on data it has memorized. A model that has memorized a specific answer will tend to reproduce that answer even under stochastic sampling, whereas a model that has not memorized will produce diverse outputs. CDD operationalizes this intuition through four steps. Sampling. Given a prompt x and a model \mathcal{M} , CDD generates one greedy output s_{t=0} using temperature t =0 (deterministic, always selecting the highest-probability token) and n temperature samples S=\{s_{1},\ldots,s_{n}\} at temperature t =0.8 (introducing controlled randomness). The greedy output serves as a reference: if the model has memorized the answer, it will be the memorized sequence. The temperature samples test whether the model can deviate from it. We use n =50, matching the original paper. Edit distance computation. CDD uses the token-level Levenshtein edit distance ( Levenshtein 1965 ) to measure similarity between generated sequences. Given two token sequences a and b , the edit distance \operatorname{ED}(a,b) is the minimum number of single-token insertions, deletions, and substitutions required to transform a into b , computed via dynamic programming. CDD applies this in a star topology: the greedy reference s_{t=0} is compared against each temperature sample s_{i} , rather than computing all pairwise distances. All sequences are tokenized using the model’s BPE tokenizer and truncated to l_{\max} =100 tokens. Peakedness. The peakedness score measures what fraction of temperature samples are “close” to the greedy reference: \text{Peak}(\mathcal{M};x)=\frac{1}{n}\sum_{i=1}^{n}\mathbb{I}\big(\text{ED}(s_{i},s_{t=0})\leq\alpha\cdot l\big) (1) where l=\max\{|s|:s\in S\cup\{s_{t=0}\}\} is the maximum sequence length across all samples and \alpha =0.05 is a similarity threshold. With l =100 and \alpha =0.05, a sample counts as “close” if it differs from the greedy output by at most 5 token edits. High peakedness indicates that the model consistently reproduces similar outputs regardless of sampling randomness. Classification. A prompt is classified as contaminated if \text{Peak}(\mathcal{M};x)>\xi , where \xi is a decision threshold. The original paper uses a fixed \xi =0.01, calibrated on 7B models where contaminated examples