SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.03692 · ICLR · 2023

Incompatibility Clustering as a Defense Against Backdoor Poisoning Attacks

Martin Rinard, Charles Jin, Melinda Sun

arXiv · PDF · Open in the Atlas

Code that ran

1 of 1 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 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/2105.03692.json · badge: /api/ran/2105.03692.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
charlesjin/compatibility_clustering canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
WeakLearner Ran
ran on a synthesized input · constructed an object; no result was computed
charlesjin/compatibility_clustering/defense/weak.py
code served (permissive licence) · get_code("bec7061126a04abc")
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 an instance of its own class, WeakLearner: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import TensorDataset

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

# Create a simple classifier model
class SimpleClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 3)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create a simple dataset
class SimpleDataset:
    def __init__(self, num_samples=20, num_features=4, num_classes=3):
        self.num_samples = num_samples
        self.num_features = num_features
        self.num_classes = num_classes
        self.data = torch.randn(num_samples, num_features)
        self.targets = torch.randint(0, num_classes, (num_samples,)).numpy()
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

# Create dataset and related arrays
dataset = SimpleDataset(num_samples=20, num_features=4, num_classes=3)
num_samples = len(dataset)

# Active indices (binary array indicating which samples are active)
active = np.array([1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0])

# Ground truth clean labels (binary array indicating which active samples are clean)
ground_truth_clean = np.array([1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0])

# Classifier function (returns new model instances)
def classifier_fn():
    return SimpleClassifier()

# Optimizer function
def optimizer_fn(params):
    return torch.optim.SGD(params, lr=0.01)

# Scheduler function (optional)
def scheduler_fn(optimizer, total_steps):
    return torch.optim.lr_scheduler.StepLR(optimizer, step_size=5, gamma=0.1)

# Criterion (loss function)
criterion = nn.CrossEntropyLoss()

# Build ARGS dictionary
ARGS = {
    'classifier_fn': classifier_fn,
    'dataset': dataset,
    'active': active,
    'num_classes': 3,
    'batch_size': 4,
    'data_perc': 0.8,
    'refit_it': 2,
    'optimizer_fn': optimizer_fn,
    'criterion': criterion,
    'expansion': 0.25,
    'scheduler_fn': scheduler_fn,
    'ground_truth_clean': ground_truth_clean,
    'clean_labels': np.array([1, 1, 0, 1]),
    'device': torch.device('cpu'),
    'amp': False,
}
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 WeakLearner — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a WeakLearner 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

Also present in other papers' code

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

We propose a novel clustering mechanism based on an incompatibility property between subsets of data that emerges during model training. This mechanism partitions the dataset into subsets that generalize only to themselves, i.e., training on one subset does not improve performance on the other subsets. Leveraging the interaction between the dataset and the training process, our clustering mechanism partitions datasets into clusters that are defined by-and therefore meaningful tothe objective of the training process. We apply our clustering mechanism to defend against data poisoning attacks, in which the attacker injects malicious poisoned data into the training dataset to affect the trained model's output. Our evaluation focuses on backdoor attacks against deep neural networks trained to perform image classification using the GTSRB and CIFAR-10 datasets. Our results show that (1) these attacks produce poisoned datasets in which the poisoned and clean data are incompatible and (2) our technique successfully identifies (and removes) the poisoned data. In an end-to-end evaluation, our defense reduces the attack success rate to below 1% on 134 out of 165 scenarios, with only a 2% drop in clean accuracy on CIFAR-10 and a negligible drop in clean accuracy on GTSRB.

For agents

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

get_harvested_code_for_paper("2105.03692")
get_code_for_paper("2105.03692")
have("2105.03692")

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

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

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

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

Connect an agent — have() is free.