SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.15523 · 2024

The Mosaic Memory of Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

16 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 14 failures of our instrument; 0 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/2405.15523.json · badge: /api/ran/2405.15523.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/mosaic_memory canonical (classifier label)
classifier basis: census
16 ran · 0 no recorded run
FunctionStatusWhere it lives
build_single_position_candidates_mlm Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/src/gen_variations.py
code served (permissive licence) · get_code("0030a57004494e5e")
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

torch.manual_seed(0)

class SimpleTokenizer:
    def __init__(self, vocab_size=100):
        self.vocab_size = vocab_size
    
    def decode(self, token_ids):
        if isinstance(token_ids, list):
            return " ".join([f"tok{i}" for i in token_ids])
        return f"tok{token_ids}"
    
    def encode(self, text, add_special_tokens=False):
        return [1, 2]

class SimpleMLMTokenizer:
    def __init__(self, vocab_size=100):
        self.vocab_size = vocab_size
        self.mask_token = "[MASK]"
        self.mask_token_id = 99
    
    def batch_encode_plus(self, texts, return_tensors='pt', padding=True, truncation=True, return_attention_mask=True):
        batch_size = len(texts)
        seq_len = 5
        
        input_ids = torch.ones(batch_size, seq_len, dtype=torch.long)
        for i in range(batch_size):
            input_ids[i, i % seq_len] = self.mask_token_id
        
        attention_mask = torch.ones(batch_size, seq_len, dtype=torch.long)
        
        return {
            'input_ids': input_ids,
            'attention_mask': attention_mask
        }
    
    def decode(self, token_ids):
        return " ".join([f"token{i}" for i in token_ids])

class SimpleMLMModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_size=4):
        super().__init__()
        self.vocab_size = vocab_size
        self.hidden_size = hidden_size
        self.linear = nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, attention_mask=None):
        batch_size, seq_len = input_ids.shape
        hidden_states = torch.randn(batch_size, seq_len, self.hidden_size)
        logits = self.linear(hidden_states)
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        return output

tokens = [1, 2, 3]
topk = 5
tokenizer = SimpleTokenizer(vocab_size=100)
mlm_tokenizer = SimpleMLMTokenizer(vocab_size=100)
mlm_model = SimpleMLMModel(vocab_size=100, hidden_size=4)
device = 'cpu'

ARGS = {
    'tokens': tokens,
    'topk': topk,
    'tokenizer': tokenizer,
    'mlm_tokenizer': mlm_tokenizer,
    'mlm_model': mlm_model,
    'device': device
}
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
build_single_position_candidates_mlm_random Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/src/gen_variations.py
code served (permissive licence) · get_code("fd6ab7a22bf3287e")
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 random

class MockTokenizer:
    def encode(self, text, add_special_tokens=False):
        # Return a small list of token ids
        return [1, 2, 3]
    
    def decode(self, token_ids):
        # Return a simple text representation
        return "word"

# Set seed for reproducibility
random.seed(0)

# Create mock tokenizers
tokenizer = MockTokenizer()
mlm_tokenizer = MockTokenizer()

# Create small token list
tokens = [101, 102, 103, 104]  # Small list of 4 tokens

# Small MLM vocab size
mlm_vocab_size = 100

ARGS = {
    "tokens": tokens,
    "tokenizer": tokenizer,
    "mlm_tokenizer": mlm_tokenizer,
    "mlm_vocab_size": mlm_vocab_size
}
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 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
bytes_to_ints Ran
ran, honoured the contract we drafted
computationalprivacy/mosaic_memory/slimpajama/py_src/near_duplicates/utils.py
code served (permissive licence) · get_code("9ded4bc578262637")
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 int; 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 torch
import numpy as np

# Construct valid arguments for bytes_to_ints function
byte_data = b'\x01\x02\x03\x04\x05\x06\x07\x08'
bytes_per_int = 2
byteorder = 'little'

ARGS = {
    'byte_data': byte_data,
    'bytes_per_int': bytes_per_int,
    'byteorder': byteorder
}
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 list, ndim 1, dtype family int — 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
check_retokenization Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/src/gen_canaries.py
code served (permissive licence) · get_code("051e235bda615dc8")
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 bool, 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
import numpy as np

class SimpleTokenizer:
    def __init__(self):
        # Simple vocabulary mapping
        self.vocab = {
            0: "hello",
            1: "world",
            2: "test",
            3: "token"
        }
        self.token_to_id = {v: k for k, v in self.vocab.items()}
    
    def decode(self, token_id):
        """Convert token ID to string"""
        return self.vocab.get(token_id, "")
    
    def encode(self, text, add_special_tokens=False):
        """Convert string to token IDs"""
        # Simple tokenization: split by spaces and map to IDs
        words = text.split()
        token_ids = []
        for word in words:
            if word in self.token_to_id:
                token_ids.append(self.token_to_id[word])
        return token_ids if token_ids else [0]

# Create tokenizer instance
tokenizer = SimpleTokenizer()

# Create a sequence of token IDs that will round-trip successfully
# Token 0 -> "hello" -> encode("hello") -> [0]
# Token 1 -> "world" -> encode("world") -> [1]
# Token 2 -> "test" -> encode("test") -> [2]
seq = [0, 1, 2, 0]

ARGS = {
    "seq": seq,
    "tokenizer": tokenizer
}
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 bool, 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
compute_perplexity Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
computationalprivacy/mosaic_memory/src/utils.py
code served (permissive licence) · get_code("8b00eb35104e3d2f")
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 ndarray, ndim 1, dtype family float, shape (2,) 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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal PreTrainedModel stand-in
class MinimalModel(nn.Module):
    def __init__(self, vocab_size=50257):
        super().__init__()
        self.config = type('Config', (), {'vocab_size': vocab_size})()
        self.linear = nn.Linear(768, vocab_size)
    
    def forward(self, input_ids, attention_mask=None):
        # input_ids shape: (batch_size, seq_len)
        # Return object with logits attribute
        batch_size, seq_len = input_ids.shape
        # Create dummy logits of shape (batch_size, seq_len, vocab_size)
        logits = self.linear(torch.randn(batch_size, seq_len, 768))
        
        output = type('Output', (), {'logits': logits})()
        return output

# Instantiate model
model = MinimalModel(vocab_size=128)

# Create token_ids tensor: shape (2, 5) - batch size 2, sequence length 5
token_ids = torch.randint(0, 128, (2, 5))

# Create attention_mask tensor: shape (2, 5) - same as token_ids
attention_mask = torch.ones((2, 5), dtype=torch.long)

# Set ignore_prefix to None
ignore_prefix = None

ARGS = {
    'model': model,
    'token_ids': token_ids,
    'attention_mask': attention_mask,
    'ignore_prefix': ignore_prefix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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_MIA_data Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/src/fine_tune_model.py
code served (permissive licence) · get_code("39a96108f827f885")
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 pickle
import tempfile
import os
import torch

torch.manual_seed(0)

# Create temporary files for member and non-member tokens
temp_dir = tempfile.mkdtemp()
path_to_members = os.path.join(temp_dir, "members.pkl")
path_to_non_members = os.path.join(temp_dir, "non_members.pkl")

# Create mock token data (small tensors)
member_tokens = torch.randint(0, 100, (2, 4))
non_member_tokens = torch.randint(0, 100, (2, 4))

# Save to pickle files
with open(path_to_members, 'wb') as f:
    pickle.dump(member_tokens, f)
with open(path_to_non_members, 'wb') as f:
    pickle.dump(non_member_tokens, f)

# Create a minimal tokenizer stand-in with batch_decode method
class MockTokenizer:
    def batch_decode(self, tokens):
        # Convert token tensors to list of strings
        if isinstance(tokens, torch.Tensor):
            tokens = tokens.tolist()
        return [f"decoded_text_{i}" for i in range(len(tokens))]

tokenizer = MockTokenizer()

ARGS = {
    'path_to_members': path_to_members,
    'path_to_non_members': path_to_non_members,
    'tokenizer': tokenizer
}
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
hamming_distance Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
computationalprivacy/mosaic_memory/slimpajama/py_src/near_duplicates/utils.py
code served (permissive licence) · get_code("9dc75d54d914e3fd")
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 torch
import numpy as np

torch.manual_seed(0)

# The function takes two lists of integers and computes hamming distance
# It iterates through pairs of elements and counts mismatches

arr1 = [1, 0, 1, 0]
arr2 = [1, 1, 1, 0]

ARGS = {
    'arr1': arr1,
    'arr2': arr2,
}
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 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
is_duplicate Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/src/gen_canaries.py
code served (permissive licence) · get_code("65518064cf879393")
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 bool, 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - is_duplicate(seq, canaries, threshold=0.2)
# - seq: needs to be iterable (converted to set in jaccard_similarity)
# - canaries: iterable of iterables (each converted to set in loop)
# - threshold: numeric value for comparison

# Create simple test data
seq = [1, 2, 3, 4, 5]
canaries = [
    [1, 2, 6, 7],  # some overlap with seq
    [8, 9, 10],    # no overlap
    [1, 2, 3, 11]  # high overlap with seq
]
threshold = 0.2

ARGS = {
    "seq": seq,
    "canaries": canaries,
    "threshold": threshold
}
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 bool, 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
jaccard_similarity Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/src/gen_canaries.py
code served (permissive licence) · get_code("60ab76511145062d")
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

# The function jaccard_similarity takes two iterables (set1, set2)
# and computes their Jaccard similarity by:
# 1. Converting them to sets
# 2. Computing intersection and union lengths
# 3. Returning intersection / union

# We need two iterables that can be converted to sets
set1 = [1, 2, 3, 4, 5]
set2 = [4, 5, 6, 7, 8]

ARGS = {
    "set1": set1,
    "set2": set2
}
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
load_counts Ran
ran, honoured the contract we drafted
computationalprivacy/mosaic_memory/slimpajama/py_src/near_duplicates/build_targets.py
code served (permissive licence) · get_code("fa5bfde010bf115b")
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 int; 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 tempfile
import os

# Create a temporary directory with test files
temp_dir = tempfile.mkdtemp()

# Create test files with counts
file1_content = "item1 10\nitem2 20\nitem3 30\n"
file2_content = "item1 5\nitem2 15\nitem3 25\n"

with open(os.path.join(temp_dir, "counts1.txt"), "w") as f:
    f.write(file1_content)

with open(os.path.join(temp_dir, "counts2.txt"), "w") as f:
    f.write(file2_content)

ARGS = {
    "dir_path": temp_dir
}
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 list, ndim 1, dtype family int — 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
load_dataset Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/slimpajama/py_src/near_duplicates/utils.py
code served (permissive licence) · get_code("444514d9ca58e878")
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 tempfile
import os

# Create temporary files to simulate the dataset
temp_dir = tempfile.mkdtemp()
path = os.path.join(temp_dir, 'test_dataset')

# Create a .size file with size information
# We'll write 3 documents with sizes: 100, 200, 150 bytes
size_data = b''
size_data += (100).to_bytes(8, byteorder='little')
size_data += (200).to_bytes(8, byteorder='little')
size_data += (150).to_bytes(8, byteorder='little')

size_path = path + '.size'
with open(size_path, 'wb') as f:
    f.write(size_data)

# Create the main dataset file with some dummy data
dataset_data = b'x' * 450  # 100 + 200 + 150 bytes
with open(path, 'wb') as f:
    f.write(dataset_data)

ARGS = {
    'path': path
}
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 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
min_k_prob Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
computationalprivacy/mosaic_memory/src/utils.py
code served (permissive licence) · get_code("1e9127a989fc5037")
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 ndarray, ndim 1, dtype family float, shape (2,) 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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal PreTrainedModel stand-in
class MinimalModel(nn.Module):
    def __init__(self, vocab_size=256, hidden_size=16):
        super().__init__()
        self.config = type('Config', (), {'vocab_size': vocab_size})()
        self.embedding = nn.Embedding(vocab_size, hidden_size)
        self.linear = nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, attention_mask=None):
        x = self.embedding(input_ids)
        logits = self.linear(x)
        # Return an object with logits attribute
        return type('Output', (), {'logits': logits})()

# Create model
model = MinimalModel(vocab_size=256, hidden_size=16)

# Create tiny tensors
# batch_size=2, seq_length=4
batch_size = 2
seq_length = 4
vocab_size = 256

token_ids = torch.randint(0, vocab_size, (batch_size, seq_length), dtype=torch.long)
attention_mask = torch.ones((batch_size, seq_length), dtype=torch.long)

# Set attention_mask to have some padding
attention_mask[0, 3] = 0
attention_mask[1, 2:] = 0

k = 20

ARGS = {
    'model': model,
    'token_ids': token_ids,
    'attention_mask': attention_mask,
    'k': k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
ratio_auc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
computationalprivacy/mosaic_memory/src/utils.py
code served (permissive licence) · get_code("74de87daccfde91d")
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
import numpy as np
from sklearn.metrics import roc_curve, auc

torch.manual_seed(0)

# Create sample data for members and non_members
# These should be sequences of floats (scores/predictions)
members = [0.1, 0.3, 0.5, 0.7, 0.9]
non_members = [0.2, 0.4, 0.6, 0.8]

ARGS = {
    "members": members,
    "non_members": non_members
}
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 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
sample_injection_indices Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
computationalprivacy/mosaic_memory/src/gen_variations.py
code served (permissive licence) · get_code("396d4d04c2e85f49")
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 int; 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
import random

# Set random seeds for reproducibility
np.random.seed(0)
random.seed(0)

# Create a simple sequence (list) to inject indices into
seq = list(range(20))

# Number of injection points
num_injection_points = 5

# Boolean flag for uniform spread
is_uniform_spread = True

ARGS = {
    "seq": seq,
    "num_injection_points": num_injection_points,
    "is_uniform_spread": is_uniform_spread
}
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 list, ndim 1, dtype family int — 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
split_into_chunks Ran
ran; our contract draft was wrong, not the code
computationalprivacy/mosaic_memory/src/fine_tune_model.py
code served (permissive licence) · get_code("a838ebb710694579")
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 expects:
# - examples: a dict with 'input_ids' key containing a list/iterable of sequences
# - seq_len: an integer (defaults to MAX_CONTEXT_SIZE)

# Create a small examples dict with input_ids containing lists of integers
# Each inner list represents a tokenized sequence
examples = {
    'input_ids': [
        [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],  # sequence of 10 tokens
        [11, 12, 13, 14, 15, 16, 17, 18],  # sequence of 8 tokens
    ]
}

# Define seq_len parameter (smaller than default for testing)
seq_len = 4

ARGS = {
    'examples': examples,
    'seq_len': seq_len,
}
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
tpr_at_fpr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
computationalprivacy/mosaic_memory/src/compute_mia_auc.py
code served (permissive licence) · get_code("606cbe1b12e20b57")
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

# Set seed for reproducibility
np.random.seed(0)

# Create sample data for members and non_members
# These should be score-like values (floats) that can be used for ROC curve
members = np.array([0.8, 0.9, 0.85, 0.95])
non_members = np.array([0.2, 0.3, 0.25, 0.15])

# Target FPR (false positive rate) - should be between 0 and 1
target_fpr = 0.3

ARGS = {
    "members": members,
    "non_members": non_members,
    "target_fpr": target_fpr
}
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 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

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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 15 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.

FunctionAlso present inEarliest-datedOthers named
ratio_auc 1 other paper
1 dated earlier
2402.09363 (2024-02)
Copyright Traps for Large Language Models

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

As Large Language Models (LLMs) become widely adopted, understanding how they learn from, and memorize, training data becomes crucial. Memorization in LLMs is widely assumed to only occur as a result of sequences being repeated in the training data. Instead, we show that LLMs memorize by assembling information from similar sequences, a phenomena we call mosaic memory. We show major LLMs to exhibit mosaic memory, with fuzzy duplicates contributing to memorization as much as 0.8 of an exact duplicate and even heavily modified sequences contributing substantially to memorization. Despite models display reasoning capabilities, we somewhat surprisingly show memorization to be predominantly syntactic rather than semantic. We finally show fuzzy duplicates to be ubiquitous in real-world data, untouched by deduplication techniques. Taken together, our results challenge widely held beliefs and show memorization to be a more complex, mosaic process, with real-world implications for privacy, confidentiality, model utility and evaluation.

For agents

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

get_harvested_code_for_paper("2405.15523")
get_code_for_paper("2405.15523")
have("2405.15523")

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

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

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

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

Connect an agent — have() is free.