SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.15007 · 2023

Did the Neurons Read your Book? Document-level Membership Inference for Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

13 of 16 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 3 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/2310.15007.json · badge: /api/ran/2310.15007.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
computationalprivacy/document-level-membership-inference canonical (classifier label)
classifier basis: census
13 ran · 3 no recorded run
FunctionStatusWhere it lives
compute_baselines Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/compute_baselines.py
code served (permissive licence) · get_code("650014829c70a9f8")
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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class SimpleTokenizer:
    def encode(self, text):
        # Simple character-level tokenizer
        tokens = [ord(c) % 100 for c in text]
        return tokens

class SimpleLanguageModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_size=4):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_size)
        self.lm_head = nn.Linear(hidden_size, vocab_size)
        self.device_attr = torch.device('cpu')
    
    @property
    def device(self):
        return self.device_attr
    
    def forward(self, input_ids, labels=None):
        embeddings = self.embedding(input_ids)
        logits = self.lm_head(embeddings)
        
        loss = None
        if labels is not None:
            loss_fn = nn.CrossEntropyLoss()
            loss = loss_fn(logits.view(-1, 100), labels.view(-1))
        
        return (loss, logits)

model1 = SimpleLanguageModel(vocab_size=100, hidden_size=4)
model1.eval()

model2 = SimpleLanguageModel(vocab_size=100, hidden_size=4)
model2.eval()

tokenizer1 = SimpleTokenizer()
tokenizer2 = SimpleTokenizer()

text = "The quick brown fox jumps"

ARGS = {
    "text": text,
    "model1": model1,
    "model2": model2,
    "tokenizer1": tokenizer1,
    "tokenizer2": tokenizer2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
extract_features Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/feature_extraction.py
code served (permissive licence) · get_code("19d90f1525de7b3c")
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
import pandas as pd

# Create small sample data for both train and test sets
# Each element in data_train and data_test is a list of numerical values (nlls)
np.random.seed(42)

data_train = [
    np.random.randn(20).tolist(),
    np.random.randn(25).tolist(),
    np.random.randn(30).tolist(),
]

data_test = [
    np.random.randn(18).tolist(),
    np.random.randn(22).tolist(),
]

ARGS = {
    'data_train': data_train,
    'data_test': data_test,
    'type': 'simple_agg',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, tqdm — 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
filter_on_date Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/split_chunks.py
code served (permissive licence) · get_code("534d1ab80c6edb56")
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 MockDataset. 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 random
from datasets import Dataset

# Create a mock dataset with the select method
class MockDataset:
    def __init__(self, data):
        self.data = data
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]
    
    def select(self, indices):
        selected_data = [self.data[i] for i in indices]
        return MockDataset(selected_data)

# Create sample data with date_name field
sample_data = []
for i in range(100):
    sample_data.append({
        'date': random.randint(1800, 1950),
        'text': f'document {i}'
    })

dataset = MockDataset(sample_data)

ARGS = {
    'dataset': dataset,
    'date_name': 'date',
    'min_date': 1850,
    'max_date': 1910
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockDataset — a MockDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockDataset output the recorded ndim 1 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_diff_max_token Ran
ran, honoured the contract we drafted
computationalprivacy/document-level-membership-inference/src/normalization.py
code served (permissive licence) · get_code("7022375f485ac9be")
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 list, 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
from datasets import Dataset

def get_norm_val(token, token_norm_dict):
    if token in token_norm_dict.keys():
        return token_norm_dict[token]
    else:
        return min(token_norm_dict.values()) / 2.0

def get_diff_max_token(idd: int, dataset: Dataset, probas: dict, nlls: dict, ranks: dict, token_norm: dict):
    all_tokens = dataset[idd]['input_ids']
    diffs = []
    for token_idx in nlls.keys():
        max_proba = max(probas[token_idx].values())
        token_proba = np.exp(-nlls[token_idx])
        token = all_tokens[token_idx]
        token_norm_val = get_norm_val(token, token_norm)
        norm_diff = -np.log((1 - (max_proba - token_proba)) / token_norm_val)
        if np.isnan(norm_diff) or np.isinf(norm_diff):
            print(norm_diff)
            norm_diff = 1e-05
        diffs.append(norm_diff)
    return diffs

# Create a small Dataset with input_ids
dataset_dict = {
    'input_ids': [[101, 102, 103, 104, 105], [106, 107, 108, 109, 110]]
}
dataset = Dataset.from_dict(dataset_dict)

# Create probas dict: maps token_idx -> dict of probabilities
probas = {
    0: {0: 0.5, 1: 0.3, 2: 0.2},
    1: {0: 0.4, 1: 0.4, 2: 0.2},
    2: {0: 0.6, 1: 0.2, 2: 0.2}
}

# Create nlls dict: maps token_idx -> negative log likelihood value
nlls = {
    0: 0.5,
    1: 0.7,
    2: 1.2
}

# Create ranks dict (required parameter but not used in function body)
ranks = {
    0: 1,
    1: 2,
    2: 3
}

# Create token_norm dict: maps token id -> normalization value
token_norm = {
    101: 1.5,
    102: 2.0,
    103: 1.8,
    104: 2.5,
    105: 1.2
}

ARGS = {
    'idd': 0,
    'dataset': dataset,
    'probas': probas,
    'nlls': nlls,
    'ranks': ranks,
    'token_norm': token_norm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
get_norm_val Ran
ran, honoured the contract we drafted
computationalprivacy/document-level-membership-inference/src/normalization.py
code served (permissive licence) · get_code("8fc952dbcf49f67d")
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 float, ndim 0, dtype family float, 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 torch

torch.manual_seed(0)

# Construct token_norm_dict
# This is a dictionary mapping tokens (strings) to their norm values (floats)
token_norm_dict = {
    "token_a": 2.5,
    "token_b": 1.8,
    "token_c": 3.2,
    "token_d": 0.9,
}

# Test with a token that exists in the dict
token = "token_a"

ARGS = {
    "token": token,
    "token_norm_dict": token_norm_dict,
}
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 float, ndim 0, dtype family float, 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_token_count Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/compute_token_freq.py
code served (permissive licence) · get_code("6dee4ea2c9310a31")
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
import numpy as np
from collections import Counter

torch.manual_seed(0)

# Create sample data that matches what get_token_count expects
# The function iterates over sample and accesses sample['input_ids']
# input_ids should be a list/array of integers

sample_data = [
    {'input_ids': [0, 1, 2, 1, 0]},
    {'input_ids': [2, 3, 1, 3, 2]},
]

ARGS = {
    'sample': sample_data,
    'token_count': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
get_token_freq Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/compute_token_freq.py
code served (permissive licence) · get_code("2bf9d952a5b20ff3")
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
import numpy as np

torch.manual_seed(0)

# The function takes token_count as a parameter
# It calls: sum() on token_count.values(), token_count.copy(), token_count.keys()
# and performs division operations on the values
# So token_count needs to be a dict with numeric values

token_count = {
    'token_a': 10,
    'token_b': 20,
    'token_c': 30,
    'token_d': 40
}

ARGS = {
    'token_count': token_count
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
normalize_token_loss Ran
ran, honoured the contract we drafted
computationalprivacy/document-level-membership-inference/src/normalization.py
code served (permissive licence) · get_code("4907842083ba956e")
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 list, 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
from datasets import Dataset

# Create a minimal Dataset object with the required structure
# The function accesses dataset[idd]['input_ids']
dataset_dict = {
    'input_ids': [
        [101, 2054, 2003, 1045],  # Example token sequence
        [102, 2054, 2003, 1045],
    ]
}
dataset = Dataset.from_dict(dataset_dict)

# Create token_norm dictionary
# Maps token IDs to their normalization values
token_norm = {
    101: 0.5,
    2054: 0.3,
    2003: 0.7,
    1045: 0.4,
}

# Create nlls dictionary
# Maps token positions to their negative log likelihoods
nlls = {
    0: 0.5,
    1: 1.2,
    2: 0.8,
}

# Sample document index
idd = 0

ARGS = {
    'idd': idd,
    'dataset': dataset,
    'nlls': nlls,
    'token_norm': token_norm,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
remove_small_docs Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/split_chunks.py
code served (permissive licence) · get_code("10d15d0c9b1eb682")
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 MinimalDataset. 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 random
from datasets import Dataset

torch.manual_seed(0)
random.seed(0)

# Create a minimal dataset that mimics HuggingFace datasets.Dataset
# The function calls: len(dataset), dataset[idx], dataset.select()
class MinimalDataset:
    def __init__(self, data):
        self.data = data
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]
    
    def select(self, indices):
        selected_data = [self.data[i] for i in indices]
        return MinimalDataset(selected_data)

# Create sample data with varying token counts
sample_data = [
    {'input_ids': [1, 2, 3, 4, 5]},           # 5 tokens
    {'input_ids': [1, 2]},                     # 2 tokens
    {'input_ids': [1, 2, 3, 4, 5, 6, 7, 8]},  # 8 tokens
    {'input_ids': [1]},                        # 1 token
    {'input_ids': [1, 2, 3, 4, 5, 6]},        # 6 tokens
    {'input_ids': [1, 2, 3]},                  # 3 tokens
    {'input_ids': [1, 2, 3, 4, 5, 6, 7]},     # 7 tokens
    {'input_ids': [1, 2, 3, 4]},               # 4 tokens
]

dataset = MinimalDataset(sample_data)
min_tokens = 4

ARGS = {
    'dataset': dataset,
    'min_tokens': min_tokens,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MinimalDataset — a MinimalDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalDataset output the recorded ndim 1 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
scale_features Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/meta_classifier.py
code served (permissive licence) · get_code("f103f8afd8bf8f81")
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 3, 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 pandas as pd
import numpy as np

# Create small training dataframe with 4 columns and 2 rows
X_train = pd.DataFrame({
    'feat_1': [1.0, 5.0],
    'feat_2': [10.0, 20.0],
    'feat_3': [0.5, 0.5],  # constant column to test edge case
    'feat_4': [100.0, 200.0]
})

# Create small test dataframe with same columns and 2 rows
X_test = pd.DataFrame({
    'feat_1': [2.0, 4.0],
    'feat_2': [12.0, 18.0],
    'feat_3': [0.5, 0.5],
    'feat_4': [150.0, 180.0]
})

ARGS = {
    'X_train': X_train,
    'X_test': X_test
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
simple_agg_feat_extraction Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
computationalprivacy/document-level-membership-inference/src/feature_extraction.py
code served (permissive licence) · get_code("e9631d636a73e644")
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.

import numpy as np
import pandas as pd

# Create sample data: a list of arrays where each array represents a sequence of values
# The function will compute aggregation features over each sequence
data = [
    np.array([1.5, 2.3, 3.1, 1.8, 2.9, 3.5, 2.1]),
    np.array([0.5, 1.2, 0.8, 1.5, 0.9, 1.1, 0.7, 1.3, 0.6]),
    np.array([10.0, 12.5, 11.3, 13.2, 10.8, 12.1])
]

percentiles = (1, 5, 10, 25, 50, 75, 90, 95, 99)

ARGS = {
    'data': data,
    'percentiles': percentiles
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, tqdm — 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
split_data Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/meta_classifier.py
code served (permissive licence) · get_code("d173585d2fb91fd1")
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 torch
import numpy as np

torch.manual_seed(0)

# Create sample data for member_vals dict
# Keys are arbitrary identifiers, values are feature vectors or arrays
member_vals = {
    'member_1': np.array([1.0, 2.0, 3.0, 4.0]),
    'member_2': np.array([5.0, 6.0, 7.0, 8.0]),
    'member_3': np.array([9.0, 10.0, 11.0, 12.0]),
}

# Create sample data for non_member_vals dict
non_member_vals = {
    'non_member_1': np.array([13.0, 14.0, 15.0, 16.0]),
    'non_member_2': np.array([17.0, 18.0, 19.0, 20.0]),
}

# Define ARGS dict with all parameters
ARGS = {
    'member_vals': member_vals,
    'non_member_vals': non_member_vals,
    'test_size': 0.2,
    'seed': 42,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — 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
validate_clf Ran
ran; our contract draft was wrong, not the code
computationalprivacy/document-level-membership-inference/src/meta_classifier.py
code served (permissive licence) · get_code("f7625eef253c7afe")
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 pandas as pd
import numpy as np
from sklearn.linear_model import LogisticRegression

# Create small sample data
np.random.seed(0)
n_train = 10
n_test = 5
n_features = 4

# Create training data
X_train_data = np.random.randn(n_train, n_features)
y_train_data = np.random.randint(0, 2, n_train)

# Create test data
X_test_data = np.random.randn(n_test, n_features)
y_test_data = np.random.randint(0, 2, n_test)

# Convert to DataFrames
X_train = pd.DataFrame(X_train_data, columns=[f'feature_{i}' for i in range(n_features)])
y_train = pd.DataFrame(y_train_data, columns=['target'])

X_test = pd.DataFrame(X_test_data, columns=[f'feature_{i}' for i in range(n_features)])
y_test = pd.DataFrame(y_test_data, columns=['target'])

# Create and train a simple classifier
clf = LogisticRegression(random_state=0, max_iter=1000)
clf.fit(X_train, y_train.values.ravel())

ARGS = {
    'clf': clf,
    'X_train': X_train,
    'y_train': y_train,
    'X_test': X_test,
    'y_test': y_test
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — 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
calculatePerplexity Not yet run
unverified (harvested, no recorded run)
computationalprivacy/document-level-membership-inference/src/compute_baselines.py
code served (permissive licence) · get_code("1183adedf54bed5a")
How it ran

no invocation recorded.

compute_perplexity Not yet run
unverified (harvested, no recorded run)
computationalprivacy/document-level-membership-inference/src/compute_perplexity.py
code served (permissive licence) · get_code("a2c54d95202e2509")
How it ran

no invocation recorded.

histogram_feats Not yet run
unverified (harvested, no recorded run)
computationalprivacy/document-level-membership-inference/src/feature_extraction.py
code served (permissive licence) · get_code("9b828cec3990ecfe")
How it ran

no invocation recorded.

Also present in other papers' code

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

With large language models (LLMs) poised to become embedded in our daily lives, questions are starting to be raised about the data they learned from. These questions range from potential bias or misinformation LLMs could retain from their training data to questions of copyright and fair use of human-generated text. However, while these questions emerge, developers of the recent state-of-the-art LLMs become increasingly reluctant to disclose details on their training corpus. We here introduce the task of document-level membership inference for real-world LLMs, i.e. inferring whether the LLM has seen a given document during training or not. First, we propose a procedure for the development and evaluation of document-level membership inference for LLMs by leveraging commonly used data sources for training and the model release date. We then propose a practical, black-box method to predict document-level membership and instantiate it on OpenLLaMA-7B with both books and academic papers. We show our methodology to perform very well, reaching an AUC of 0.856 for books and 0.678 for papers. We then show our approach to outperform the sentence-level membership inference attacks used in the privacy literature for the document-level membership task. We further evaluate whether smaller models might be less sensitive to document-level inference and show OpenLLaMA-3B to be approximately as sensitive as OpenLLaMA-7B to our approach. Finally, we consider two mitigation strategies and find the AUC to slowly decrease when only partial documents are considered but to remain fairly high when the model precision is reduced. Taken together, our results show that accurate document-level membership can be inferred for LLMs, increasing the transparency of technology poised to change our lives.

For agents

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

get_harvested_code_for_paper("2310.15007")
get_code_for_paper("2310.15007")
have("2310.15007")

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

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

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

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

Connect an agent — have() is free.