SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.00699 · 2024

A Comprehensive Survey of Contamination Detection Methods in Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.00699.json · badge: /api/ran/2404.00699.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ntunlp/llmsanitize canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
bootstrap_test Ran
ran, honoured the contract we drafted
ntunlp/llmsanitize/llmsanitize/closed_data_methods/guided_prompting.py
code served (permissive licence) · get_code("638ff1bd6c6fa95f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy.stats import bootstrap

# Create sample data: a sequence of score differences (guided - general)
# We'll create both positive and negative differences to make the bootstrap test meaningful
np.random.seed(42)
data = np.array([0.5, -0.2, 0.3, -0.1, 0.4, -0.3, 0.2, 0.1, -0.15, 0.25])

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_prompt Ran
ran; our contract draft was wrong, not the code
ntunlp/llmsanitize/llmsanitize/closed_data_methods/ts_guessing_question_based.py
code served (permissive licence) · get_code("a29d8491ca5349bd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class MockTagger:
    def tag(self, words):
        """Mock POS tagger that returns (word, pos_tag) tuples"""
        tags = []
        for word in words:
            if word.lower() in ['cat', 'dog', 'run', 'jump']:
                if word.lower() in ['run', 'jump']:
                    pos = 'VB'
                else:
                    pos = 'NN'
            else:
                pos = 'JJ'
            tags.append((word, pos))
        return tags

# Create mock tagger
tagger = MockTagger()

# Create example dict for truthful_qa
example = {
    'text': 'The quick brown cat jumped over the fence',
    'type': 'factual',
    'category': 'animals',
    'source': 'https://example.com'
}

ARGS = {
    'example': example,
    'tagger': tagger,
    'eval_data_name': 'truthful_qa',
    'type_hint': True,
    'category_hint': True,
    'url_hint': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clean_text_exact Ran
ran; our contract draft was wrong, not the code
ntunlp/llmsanitize/llmsanitize/open_data_methods/exact.py
code served (permissive licence) · get_code("5e4386ee42ed8e87")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def clean_text_exact(text):
    text = text.lower()
    text = ''.join((i if i.isalpha() or i == ' ' else '' for i in text))
    text = re.sub(' +', ' ', text)
    text = text.strip()
    return text

# The function takes a single parameter: text (a string)
# It performs text cleaning operations: lowercasing, removing non-alphabetic chars, 
# collapsing spaces, and stripping whitespace

ARGS = {
    "text": "Hello, World! 123 This is a TEST."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clean_text_gpt2 Ran
ran; our contract draft was wrong, not the code
ntunlp/llmsanitize/llmsanitize/open_data_methods/gpt2.py
code served (permissive licence) · get_code("5c6499274d7d85e4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def clean_text_gpt2(text):
    text = text.lower()
    text = ''.join((i if i.isalpha() or i == ' ' else '' for i in text))
    text = re.sub(' +', ' ', text)
    text = text.strip()
    return text

# The function takes a single parameter: text (a string)
# It processes the text by:
# 1. Converting to lowercase
# 2. Removing non-alphabetic characters (keeping only letters and spaces)
# 3. Collapsing multiple spaces into single spaces
# 4. Stripping leading/trailing whitespace

ARGS = {
    "text": "Hello WORLD! This is a TEST123 with NUMBERS and special@characters."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_ed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ntunlp/llmsanitize/llmsanitize/closed_data_methods/cdd.py
code served (permissive licence) · get_code("cd0a1c14b7342cc9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function: get_ed(a, b)
# - Takes two parameters: a and b
# - Checks len(a) and len(b)
# - Compares elements: a[i] == b[j]
# - a and b should be sequences (lists, strings, or arrays)
# This appears to be an edit distance (Levenshtein distance) implementation

# Create simple sequences for testing
a = [1, 2, 3, 4]
b = [1, 2, 4, 5, 6]

ARGS = {
    "a": a,
    "b": b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_peak Ran
ran; our contract draft was wrong, not the code
ntunlp/llmsanitize/llmsanitize/closed_data_methods/cdd.py
code served (permissive licence) · get_code("fb2131f4cfdcf619")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

def get_ed(a, b):
    if len(b) == 0:
        return len(a)
    elif len(a) == 0:
        return len(b)
    else:
        dist = np.zeros((len(a) + 1, len(b) + 1))
        for i in range(len(a)):
            for j in range(len(b)):
                if a[i] == b[j]:
                    dist[i + 1, j + 1] = dist[i, j]
                else:
                    dist[i + 1, j + 1] = 1 + min(dist[i, j], dist[i + 1, j], dist[i, j + 1])
        return int(dist[-1, -1])

def get_peak(samples, s_0, alpha):
    lengths = [len(x) for x in samples]
    l = min(lengths)
    l = min(l, 100)
    thresh = int(np.ceil(alpha * l))
    distances = [get_ed(s, s_0) for s in samples]
    rhos = [len([x for x in distances if x == d]) for d in range(0, thresh + 1)]
    peak = sum(rhos)
    return peak

samples = [
    np.array([1, 2, 3, 4, 5]),
    np.array([1, 2, 4, 5]),
    np.array([1, 2, 3, 4]),
]

s_0 = np.array([1, 2, 3, 4])

alpha = 0.5

ARGS = {
    "samples": samples,
    "s_0": s_0,
    "alpha": alpha,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
guided_prompt_process_label Ran
ran; our contract draft was wrong, not the code
ntunlp/llmsanitize/llmsanitize/closed_data_methods/guided_prompting.py
code served (permissive licence) · get_code("2080784e3d59cf1c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Construct valid arguments for guided_prompt_process_label
# The function takes an example dict and a dataset_name string

# Example for 'cais/mmlu' dataset
example_mmlu = {
    'choices': ['Paris', 'London', 'Berlin', 'Madrid'],
    'answer': '0'
}

# Example for 'winogrande' dataset
example_winogrande = {
    'option1': 'cat',
    'option2': 'dog'
}

# Define ARGS with both possible cases
ARGS = {
    'example': example_mmlu,
    'dataset_name': 'cais/mmlu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sweep Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ntunlp/llmsanitize/llmsanitize/closed_data_methods/min_prob.py
code served (permissive licence) · get_code("af0842b1fdd72528")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The sweep function takes:
# - score: array-like of prediction scores
# - x: array-like of binary labels/ground truth

# Create simple test data
np.random.seed(0)

# score: prediction scores (can be continuous values)
# Using small array of 10 samples
score = np.random.randn(10)

# x: binary labels (0 or 1)
x = np.random.randint(0, 2, 10)

ARGS = {
    "score": score,
    "x": x,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
process_response Not yet run
unverified (harvested, no recorded run)
ntunlp/llmsanitize/llmsanitize/closed_data_methods/ts_guessing_question_based.py
code served (permissive licence) · get_code("be50c8c31c5cd309")
How it ran

no invocation recorded.

process_response Not yet run
unverified (harvested, no recorded run)
ntunlp/llmsanitize/llmsanitize/closed_data_methods/ts_guessing_question_multichoice.py
code served (permissive licence) · get_code("4abd4eaf3320d068")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

With the rise of Large Language Models (LLMs) in recent years, abundant new opportunities are emerging, but also new challenges, among which contamination is quickly becoming critical. Business applications and fundraising in Artificial Intelligence (AI) have reached a scale at which a few percentage points gained on popular question-answering benchmarks could translate into dozens of millions of dollars, placing high pressure on model integrity. At the same time, it is becoming harder and harder to keep track of the data that LLMs have seen; if not impossible with closed-source models like GPT-4 and Claude-3 not divulging any information on the training set. As a result, contamination becomes a major issue: LLMs' performance may not be reliable anymore, as the high performance may be at least partly due to their previous exposure to the data. This limitation jeopardizes real capability improvement in the field of NLP, yet, there remains a lack of methods on how to efficiently detect contamination. In this paper, we survey all recent work on contamination detection with LLMs, analyzing their methodologies and use cases to shed light on the appropriate usage of contamination detection methods. Our work calls the NLP research community's attention into systematically taking into account contamination bias in LLM evaluation.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.00699")
get_code_for_paper("2404.00699")
have("2404.00699")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.00699.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.00699.svg)](https://syntology.ai/paper/2404.00699)

Connect an agent — have() is free.