SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-emnlp.621 · EMNLP Findings · 2024

Code Membership Inference for Detecting Unauthorized Data Use in Code Pre-trained Language Models

Sheng Zhang, Rongrong Ji, Hui Li

Open in the Atlas

Code that ran

9 of 11 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 9 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2024.findings-emnlp.621.json · badge: /api/ran/2024.findings-emnlp.621.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
KDEGroup/Buzzer canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
clean_doc Ran
ran on a synthesized input
KDEGroup/Buzzer/src/data_utils/csn.py
code served (permissive licence) · get_code("0a59f93b31fa6426")
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_doc(s):
    """
    Clean docstring.

    Args:
        s (str): Raw docstring

    Returns:
        str: Cleaned docstring

    """
    s = re.sub('{@link|code(.*?)}', '\\1', s)
    s = re.sub('@see', '', s)
    s = re.sub('<a.*?>(.*?)a>', '\\1', s)
    s = re.sub('</?[A-Za-z0-9]+>', '', s)
    s = re.sub('\\(.*?\\)', '', s)
    s = re.sub('#([\\w]+)\\s+\\1', '\\1', s)
    s = re.sub('http\\S*', '', s)
    s = re.sub('[^a-zA-Z0-9_]', ' ', s)
    s = re.sub('[ \\f\\n\\r\\t]', ' ', s).strip()
    s = re.sub(' +', ' ', s).strip()
    if len(s) == 0 or len(s.split()) < 3:
        return None
    else:
        return s

ARGS = {
    "s": "This is a valid docstring with multiple words and content to process"
}
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
load_feature Ran
ran on a synthesized input
KDEGroup/Buzzer/src/clf/llm_mia.py
code served (permissive licence) · get_code("316b6f37385eb52e")
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 torch
import numpy as np
import tempfile
import os

torch.manual_seed(0)

# Create a temporary numpy file with test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_feature.npy")

# Create a small test array with some zeros and some non-zeros
test_data = np.array([[1.0, 0.0, 2.0, 0.0],
                      [0.0, 3.0, 0.0, 4.0]], dtype=np.float32)
np.save(temp_file, test_data)

ARGS = {
    "data_path": temp_file
}
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 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
minmax_norm_2d_feature Ran
ran on a synthesized input
KDEGroup/Buzzer/src/common/block.py
code served (permissive licence) · get_code("991e8770494734f3")
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

torch.manual_seed(0)

# Create small 2D feature tensor (batch_size=2, feature_dim=4)
feature = torch.randn(2, 4)

# Create attention mask (batch_size=2, seq_len=4)
# True means attend, False means ignore
attention_mask = torch.tensor([
    [True, True, True, False],
    [True, True, False, False]
])

# Test case 1: with min_ and max_ as None (will compute them)
min_ = None
max_ = None
type_ = 'seq'

ARGS = {
    'feature': feature,
    'attention_mask': attention_mask,
    'min_': min_,
    'max_': max_,
    'type_': type_
}
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 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
plot_roc Ran
ran on a synthesized input
KDEGroup/Buzzer/src/common/evaluate_metrics.py
code served (permissive licence) · get_code("a6fab09051bbdf51")
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 numpy as np

# Construct valid arguments for plot_roc function
# The function expects:
# - args: used for plotting context (can be a simple object)
# - mem: numpy array of scores for members (positive class)
# - non: numpy array of scores for non-members (negative class)
# - name: string for metrics name

class SimpleArgs:
    """Minimal args object for plotting context"""
    def __init__(self):
        self.plot_dir = '/tmp'
        self.verbose = False

# Create sample score arrays
# mem: scores for positive class (members)
mem = np.array([0.9, 0.85, 0.92, 0.88, 0.95], dtype=np.float32)

# non: scores for negative class (non-members)
non = np.array([0.1, 0.25, 0.15, 0.3, 0.2], dtype=np.float32)

# Create args object
args = SimpleArgs()

ARGS = {
    'args': args,
    'mem': mem,
    'non': non,
    'name': 'metrics'
}
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 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
process_llm_feature Ran
ran on a synthesized input
KDEGroup/Buzzer/src/clf/llm_mia.py
code served (permissive licence) · get_code("4d4672a63a7536f2")
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 torch
import numpy as np
import tempfile
import os

torch.manual_seed(0)

# Create temporary numpy files for the feature data
temp_dir = tempfile.mkdtemp()

# Create small feature arrays (2x4 tensors)
mem_data = np.array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)
non_data = np.array([[0.5, 1.5, 2.5, 3.5], [4.5, 5.5, 6.5, 7.5]], dtype=np.float32)
cal_mem_data = np.array([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]], dtype=np.float32)
cal_non_data = np.array([[0.05, 0.15, 0.25, 0.35], [0.45, 0.55, 0.65, 0.75]], dtype=np.float32)

mem_path = os.path.join(temp_dir, "mem.npy")
non_path = os.path.join(temp_dir, "non.npy")
cal_mem_path = os.path.join(temp_dir, "cal_mem.npy")
cal_non_path = os.path.join(temp_dir, "cal_non.npy")

np.save(mem_path, mem_data)
np.save(non_path, non_data)
np.save(cal_mem_path, cal_mem_data)
np.save(cal_non_path, cal_non_data)

# Create a simple args object
class Args:
    def __init__(self, use_cal=False):
        self.use_cal = use_cal

args_no_cal = Args(use_cal=False)
args_with_cal = Args(use_cal=True)

ARGS = {
    "args": args_with_cal,
    "mem_path": mem_path,
    "non_path": non_path,
    "cal_mem_path": cal_mem_path,
    "cal_non_path": cal_non_path,
}
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 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
read_data Ran
ran on a synthesized input
KDEGroup/Buzzer/src/clf/codebert_mia.py
code served (permissive licence) · get_code("35d3eafc58b08416")
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 2, dtype family float, shape (2, 4) 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 tempfile
from pathlib import Path
import numpy as np

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

# Create sample .npy files
data_root = temp_dir
data_name = "test_data"
fea_name = "features"

# Create a sample numpy array and save it
sample_data = np.array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)
np.save(Path(temp_dir) / f"{data_name}_{fea_name}.npy", sample_data)

ARGS = {
    "data_root": temp_dir,
    "data_name": data_name,
    "fea_name": fea_name,
}
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 ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
remove_comments_and_docstrings Ran
ran on a synthesized input
KDEGroup/Buzzer/src/data_utils/csn.py
code served (permissive licence) · get_code("f771573c536b9be3")
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
from io import StringIO
import tokenize

# Test with Python source code
python_source = """
def hello(x):
    # This is a comment
    '''This is a docstring'''
    return x + 1  # Another comment
"""

# Test with C-style source code
c_source = """
int main() {
    // This is a comment
    /* This is a block comment */
    int x = 5;  // inline comment
    return 0;
}
"""

# Test with Ruby source code
ruby_source = """
def hello(x)
  # This is a comment
  return x + 1
end
"""

ARGS = {
    "source": python_source,
    "lang": "python"
}
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
replace_string_literal Ran
ran on a synthesized input
KDEGroup/Buzzer/src/data_utils/csn.py
code served (permissive licence) · get_code("dbf2a3313ca10252")
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

STRING_MATCHING_PATTERN = re.compile('([bruf]*)(\\"\\"\\"|\\\'\\\'\\\'|\\"|\\\')(?:(?!\\2)(?:\\\\.|[^\\\\]))*\\2')

def replace_string_literal(source, target='___STR'):
    return re.sub(pattern=STRING_MATCHING_PATTERN, repl=target, string=source)

# Create test arguments for replace_string_literal
# The function takes:
# - source: a string containing Python code with string literals
# - target: a replacement string (default is '___STR')

# Example Python source code with various string literals
source_code = '''
x = "hello world"
y = 'single quoted'
z = """triple quoted string"""
a = r"raw string"
b = f"formatted {var}"
c = 'string with \\'escaped\\' quotes'
'''

ARGS = {
    'source': source_code,
    'target': '___STR'
}
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
transfer_arg_name Ran
ran on a synthesized input
KDEGroup/Buzzer/src/signal_extractor/args.py
code served (permissive licence) · get_code("2ac804bb1bee5821")
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 torch

def transfer_arg_name(name):
    return '--' + name.replace('_', '-')

ARGS = {
    'name': 'example_parameter_name'
}
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 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
load_feature_by_name Not yet run
unverified (harvested, no recorded run)
KDEGroup/Buzzer/src/clf/codebert_mia.py
code served (permissive licence) · get_code("55c161e946d5a6df")
How it ran

no invocation recorded.

load_feature_by_name Not yet run
unverified (harvested, no recorded run)
KDEGroup/Buzzer/src/clf/codet5_mia.py
code served (permissive licence) · get_code("8ea9c7a3d9225a4c")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
transfer_arg_name 1 other paper
1 dated earlier
2201.01549 (2022-01)
SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representations

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-24.

Repositories linked to this paper

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

Abstract

Code pre-trained language models (CPLMs) have received great attention since they can benefit various tasks that facilitate software development and maintenance. However, CPLMs are trained on massive open-source code, raising concerns about potential data infringement. This paper launches the study of detecting unauthorized code use in CPLMs, i.e., Code Membership Inference (CMI) task. We design a framework BUZZER for different settings of CMI. BUZZER deploys several inference techniques, including signal extraction from pre-training tasks, hard-to-learn sample calibration and weighted inference, to identify code membership status accurately. Extensive experiments show that CMI can be achieved with high accuracy using BUZZER. Hence, BUZZER can serve as a CMI tool and help protect intellectual property rights. The implementation of BUZZER is available at: https: //github.com/KDEGroup/Buzzer.

For agents

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

get_harvested_code_for_paper("2024.findings-emnlp.621")
get_code_for_paper("2024.findings-emnlp.621")
have("2024.findings-emnlp.621")

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

curl https://syntology.ai/api/ran/2024.findings-emnlp.621.json

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

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-emnlp.621.svg)](https://syntology.ai/paper/2024.findings-emnlp.621)

Connect an agent — have() is free.