SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.02284 · 2024

Training on the Test Model: Contamination in Ranking Distillation

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2411.02284.json · badge: /api/ran/2411.02284.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
Parry-Parry/ContaminatedDistillation canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
get_bm25 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Parry-Parry/ContaminatedDistillation/src/contaminate/run_topics.py
code served (permissive licence) · get_code("c26f51e9e4da5c1d")
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 DataFrame. 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.

# This function calls tira.pd.from_retriever_submission() which requires network access
# and external API calls. We'll create a minimal mock setup that allows the function
# to be called without actually making network requests.

class MockTiraClient:
    """Mock TIRA client that avoids network calls"""
    def __init__(self):
        self.pd = self
    
    def from_retriever_submission(self, approach, dataset):
        """Mock retriever submission that returns a simple DataFrame-like object"""
        import pandas as pd
        # Return a minimal DataFrame with expected columns
        return pd.DataFrame({
            'qid': ['1', '2'],
            'docid': ['doc1', 'doc2'],
            'score': [0.9, 0.8],
            'rank': [1, 2]
        })

# Create a mock module to replace tira.rest_api_client
import sys
from types import ModuleType

mock_tira_module = ModuleType('tira')
mock_rest_api_module = ModuleType('rest_api_client')
mock_client_class = MockTiraClient

mock_rest_api_module.Client = mock_client_class
mock_tira_module.rest_api_client = mock_rest_api_module
sys.modules['tira'] = mock_tira_module
sys.modules['tira.rest_api_client'] = mock_rest_api_module

# Patch the function to use our mock
import builtins
original_import = builtins.__import__

def mock_import(name, *args, **kwargs):
    if name == 'tira.rest_api_client':
        return mock_rest_api_module
    return original_import(name, *args, **kwargs)

builtins.__import__ = mock_import

# Define the argument
ARGS = {
    'dataset_id': 'ir-benchmarks/beir-v1.0.0-trec-covid'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, tira — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
load_bi_encoder Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Parry-Parry/ContaminatedDistillation/src/contaminate/run_topics.py
code served (permissive licence) · get_code("6406f9715f5592d5")
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 MockBiScorer. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Mock the transformers and pyterrier_dr imports since we can't download real models
class MockAutoModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
        self.device = torch.device('cpu')
    
    def forward(self, input_ids, attention_mask=None):
        return MagicMock(last_hidden_state=self.linear(torch.randn(2, 4)))
    
    def cuda(self):
        return self
    
    def eval(self):
        return self

class MockTokenizer:
    def __init__(self):
        pass
    
    def __call__(self, texts, padding=True, truncation=True, return_tensors=None, max_length=None):
        if isinstance(texts, str):
            texts = [texts]
        batch_size = len(texts)
        return {
            'input_ids': torch.zeros((batch_size, 4), dtype=torch.long),
            'attention_mask': torch.ones((batch_size, 4), dtype=torch.long)
        }

class MockHgfBiEncoder:
    def __init__(self, model, tokenizer, config, device):
        self.model = model
        self.tokenizer = tokenizer
        self.device = device
    
    def encode(self, texts, **kwargs):
        return torch.randn(len(texts) if isinstance(texts, list) else 1, 4)

class MockBiScorer:
    def __init__(self, backbone, batch_size=64):
        self.backbone = backbone
        self.batch_size = batch_size

# Patch the imports
import sys
transformers_mock = MagicMock()
transformers_mock.AutoModel.from_pretrained = lambda x: MockAutoModel()
transformers_mock.AutoTokenizer.from_pretrained = lambda x: MockTokenizer()
sys.modules['transformers'] = transformers_mock

pyterrier_dr_mock = MagicMock()
pyterrier_dr_mock.HgfBiEncoder = MockHgfBiEncoder
pyterrier_dr_mock.BiScorer = MockBiScorer
sys.modules['pyterrier_dr'] = pyterrier_dr_mock

ARGS = {
    'checkpoint': 'sebastian-hofstaetter/distilbert-dot-tas_b-b256-msmarco',
    'batch_size': 64
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pyterrier_dr, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockBiScorer — a MockBiScorer output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockBiScorer 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
load_cross_encoder Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Parry-Parry/ContaminatedDistillation/src/contaminate/run_topics.py
code served (permissive licence) · get_code("9cccbc3b230dfda7")
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 CatTransformer. 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
import torch.nn as nn

torch.manual_seed(0)

# Stand-in CatTransformer class that has from_pretrained class method
class CatTransformer(nn.Module):
    def __init__(self, checkpoint: str, batch_size: int):
        super().__init__()
        self.checkpoint = checkpoint
        self.batch_size = batch_size
        self.linear = nn.Linear(4, 2)
    
    @classmethod
    def from_pretrained(cls, checkpoint: str, batch_size: int = 64, **kwargs):
        return cls(checkpoint, batch_size)

# Monkey-patch the rankers module
import sys
class RankersModule:
    CatTransformer = CatTransformer

sys.modules['rankers'] = RankersModule()

ARGS = {
    'checkpoint': 'cross-encoder/ms-marco-TinyBERT-L-6',
    'batch_size': 64,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
rankers, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CatTransformer — a CatTransformer output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CatTransformer 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
sample Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Parry-Parry/ContaminatedDistillation/src/contaminate/util.py
code served (permissive licence) · get_code("69d3d15603dedf0a")
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 tempfile
import os

# Create a temporary directory and file for output
temp_dir = tempfile.mkdtemp()
out_file = os.path.join(temp_dir, "sample_output.csv")

# The function uses ir_datasets.load() to load a dataset by string name
# and expects it to have docpairs_iter() method and has_docpairs() method.
# Since we can't actually fetch datasets, we'll mock the ir_datasets module
# and provide a mock dataset object.

class MockDocpairsDataset:
    """Mock dataset with docpairs support"""
    def __init__(self):
        self.name = "mock/dataset"
    
    def has_docpairs(self):
        return True
    
    def docpairs_iter(self):
        # Return an iterator of docpair records (dicts with columns)
        # Generate enough records to satisfy subset=100000 requirement
        for i in range(150000):
            yield {
                'query_id': f'q{i}',
                'doc_id_a': f'd{i*2}',
                'doc_id_b': f'd{i*2+1}',
                'label': i % 2
            }
    
    def __str__(self):
        return self.name

# Mock ir_datasets module
class MockIRDatasets:
    def load(self, dataset_name):
        return MockDocpairsDataset()

# Inject mock into sys.modules before the function tries to import
import sys
sys.modules['ir_datasets'] = MockIRDatasets()

ARGS = {
    'dataset': 'mock/dataset',
    'out_file': out_file,
    'subset': 100000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
ir_datasets, pandas — 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
batch_run_topics Not yet run
unverified (harvested, no recorded run)
Parry-Parry/ContaminatedDistillation/src/contaminate/batch_run_topics.py
code served (permissive licence) · get_code("cfe8396620918843")
How it ran

no invocation recorded.

bm25 Not yet run
unverified (harvested, no recorded run)
Parry-Parry/ContaminatedDistillation/src/contaminate/util.py
code served (permissive licence) · get_code("7130132ce4a31123")
How it ran

no invocation recorded.

execute Not yet run
unverified (harvested, no recorded run)
Parry-Parry/ContaminatedDistillation/src/contaminate/__main__.py
code served (permissive licence) · get_code("00a1cf01d60755fc")
How it ran

no invocation recorded.

load_monot5 Not yet run
unverified (harvested, no recorded run)
Parry-Parry/ContaminatedDistillation/src/contaminate/util.py
code served (permissive licence) · get_code("6a005ccc5accf5d4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 8 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-23.

Repositories linked to this paper

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

Abstract

Neural approaches to ranking based on pre-trained language models are highly effective in ad-hoc search. However, the computational expense of these models can limit their application. As such, a process known as knowledge distillation is frequently applied to allow a smaller, efficient model to learn from an effective but expensive model. A key example of this is the distillation of expensive API-based commercial Large Language Models into smaller production-ready models. However, due to the opacity of training data and processes of most commercial models, one cannot ensure that a chosen test collection has not been observed previously, creating the potential for inadvertent data contamination. We, therefore, investigate the effect of a contaminated teacher model in a distillation setting. We evaluate several distillation techniques to assess the degree to which contamination occurs during distillation. By simulating a ``worst-case'' setting where the degree of contamination is known, we find that contamination occurs even when the test data represents a small fraction of the teacher's training samples. We, therefore, encourage caution when training using black-box teacher models where data provenance is ambiguous.

For agents

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

get_harvested_code_for_paper("2411.02284")
get_code_for_paper("2411.02284")
have("2411.02284")

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

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

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

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

Connect an agent — have() is free.