SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.03297 · ICML · 2023

Preprocessors Matter! Realistic Decision-Based Attacks on Machine Learning Systems

Nicholas Carlini, Florian Tramèr, Chawin Sitawarin

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 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 1 has no contract verdict; 2 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/2210.03297.json · badge: /api/ran/2210.03297.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
google-research/preprocessor-aware-black-box-attack canonical (classifier label)
classifier basis: classifier_2025
3 ran · 3 no recorded run
FunctionStatusWhere it lives
PytorchModel Ran
ran on a synthesized input
google-research/preprocessor-aware-black-box-attack/attack_prep/attack/opt.py
code served (permissive licence) · get_code("6a9bb728e1e68bb8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 1, dtype family int; no output shape is stated. 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 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 torch.nn as nn
import numpy as np

# Create a simple stand-in model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 8, 3, padding=1)
        self.fc = nn.Linear(8 * 16 * 16, 10)
    
    def forward(self, x):
        x = self.conv(x)
        x = torch.relu(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        return x

model = SimpleModel()
bounds = (0.0, 1.0)

INIT_ARGS = {
    'model': model,
    'bounds': bounds
}

# Create a test image with shape (batch=2, channels=3, height=16, width=16)
image = torch.randn(2, 3, 16, 16)

ARGS = {
    'image': image
}

METHOD = 'predict_label'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family int — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
fine_grained_binary_search Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google-research/preprocessor-aware-black-box-attack/attack_prep/attack/opt.py
code served (permissive licence) · get_code("8399509cbd9bd67c")
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 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 torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def predict_label(self, x):
        """Returns a predicted label (0 or 1) for input x"""
        with torch.no_grad():
            logits = self.linear(x)
            label = torch.argmax(logits, dim=-1).item() if x.dim() > 1 else torch.argmax(logits).item()
        return label

model = SimpleModel()

x0 = torch.randn(4, dtype=torch.float32)
y0 = 0

theta = torch.randn(4, dtype=torch.float32)

initial_lbd = 0.5

current_best = 1.0

ARGS = {
    "model": model,
    "x0": x0,
    "y0": y0,
    "theta": theta,
    "initial_lbd": initial_lbd,
    "current_best": current_best
}
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, ndim 1, 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
normalize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google-research/preprocessor-aware-black-box-attack/attack_prep/attack/opt.py
code served (permissive licence) · get_code("667b1399bf0e16ad")
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) 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)

# Test case 1: non-batch normalization
x_non_batch = torch.randn(4)

# Test case 2: batch normalization
x_batch = torch.randn(2, 4)

# Create ARGS dict with both test cases
# We'll use the batch case as the primary example
ARGS = {
    "x": x_batch,
    "batch": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
Attack Not yet run
unverified (harvested, no recorded run)
google-research/preprocessor-aware-black-box-attack/attack_prep/attack/opt.py
code served (permissive licence) · get_code("d9d87c3e7fb8c45f")
How it ran

no invocation recorded.

OptAttack Not yet run
unverified (harvested, no recorded run)
google-research/preprocessor-aware-black-box-attack/attack_prep/attack/opt.py
code served (permissive licence) · get_code("12293d4864d30be8")
How it ran

no invocation recorded.

fine_grained_binary_search_local Not yet run
unverified (harvested, no recorded run)
google-research/preprocessor-aware-black-box-attack/attack_prep/attack/opt.py
code served (permissive licence) · get_code("f6b866392a8aa1ce")
How it ran

no invocation recorded.

Also present in other papers' code

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

Decision-based attacks construct adversarial examples against a machine learning (ML) model by making only hard-label queries. These attacks have mainly been applied directly to standalone neural networks. However, in practice, ML models are just one component of a larger learning system. We find that by adding a single preprocessor in front of a classifier, state-of-the-art query-based attacks are up to seven× less effective at attacking a prediction pipeline than at attacking the model alone. We explain this discrepancy by the fact that most preprocessors introduce some notion of invariance to the input space. Hence, attacks that are unaware of this invariance inevitably waste a large number of queries to re-discover or overcome it. We therefore develop techniques to (i) reverse-engineer the preprocessor and then (ii) use this extracted information to attack the end-to-end system. Our preprocessors extraction method requires only a few hundreds queries, and our preprocessor-aware attacks recover the same efficacy as when attacking the model alone. The code can be found at https: //github.com/google-research/ preprocessor-aware-black-box-attack.

For agents

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

get_harvested_code_for_paper("2210.03297")
get_code_for_paper("2210.03297")
have("2210.03297")

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

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

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

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

Connect an agent — have() is free.