SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.00378 · 2020

Understanding the Intrinsic Robustness of Image Distributions using Conditional Generative Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 5 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-21; 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/2003.00378.json · badge: /api/ran/2003.00378.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
xiaozhanguva/Intrinsic-Rob canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
check_args Ran
ran on a synthesized input
xiaozhanguva/Intrinsic-Rob/build_generator_mnist.py
code served (permissive licence) · get_code("b78ee352c8735875")
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 Args. 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 os
import tempfile

class Args:
    def __init__(self):
        self.save_dir = tempfile.mkdtemp()
        self.result_dir = tempfile.mkdtemp()
        self.epoch = 10
        self.batch_size = 32

args = Args()

ARGS = {
    'args': args
}
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 Args — a Args output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Args 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
depth_to_space Ran
ran on a synthesized input
xiaozhanguva/Intrinsic-Rob/generative/src/util.py
code served (permissive licence) · get_code("5075d4eded93eec1")
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 Tensor, ndim 4, dtype family float, shape (2, 1, 6, 10) 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

torch.manual_seed(0)

# Create a small tensor for depth_to_space
# The function expects: x of shape (n, c, h, w) where c is divisible by r^2
# Let's use: n=2 (batch), r=2, so c must be divisible by 4
# We'll use c=4, h=3, w=5 for distinct dimensions
x = torch.randn(2, 4, 3, 5)

# r must be such that c is divisible by r^2
# With c=4, r=2 works (4 / 4 = 1)
r = 2

ARGS = {
    'x': x,
    'r': r
}
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 Tensor, ndim 4, dtype family float, shape (2, 1, 6, 10) — shape (2, 1, 6, 10) 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
madry_loss Ran
ran on a synthesized input
xiaozhanguva/Intrinsic-Rob/train_classifier/adv_loss.py
code served (permissive licence) · get_code("a6e5703583807cb4")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. 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, 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 torch.optim as optim

torch.manual_seed(0)

# Define a simple model that takes input and produces logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super(SimpleModel, self).__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        # x shape: (batch_size, input_dim)
        return self.linear(x)

# Create model
model = SimpleModel(input_dim=4, num_classes=3)

# Create natural inputs: batch_size=2, channels=1, height=2, width=2 (flattened to 4)
x_natural = torch.randn(2, 4, requires_grad=False)
x_natural = torch.clamp(x_natural, 0.0, 1.0)

# Create labels
y = torch.tensor([0, 2], dtype=torch.long)

# Create optimizer
optimizer = optim.SGD(model.parameters(), lr=0.01)

ARGS = {
    'model': model,
    'x_natural': x_natural,
    'y': y,
    'optimizer': optimizer,
    'step_size': 0.003,
    'epsilon': 0.031,
    'perturb_steps': 10,
    'distance': 'l_inf'
}
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 Tensor, 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
normalize Ran
ran on a synthesized input
xiaozhanguva/Intrinsic-Rob/generative/src/util.py
code served (permissive licence) · get_code("1c11005825913bca")
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 Tensor, 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 torch

torch.manual_seed(0)

# Create a small input tensor with batch size 2 and feature dimension 4
input_tensor = torch.randn(2, 4)

# Create an output tensor with the same shape (optional parameter)
output_tensor = torch.empty(2, 4)

ARGS = {
    "input": input_tensor,
    "p": 2,
    "dim": 1,
    "eps": 1e-12,
    "out": None
}
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 Tensor, 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
squared_l2_norm Ran
ran; our contract draft was wrong, not the code
xiaozhanguva/Intrinsic-Rob/train_classifier/adv_loss.py
code served (permissive licence) · get_code("724c88e3f81d2123")
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 Tensor, ndim 1, dtype family float, shape (1,) 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

torch.manual_seed(0)

# The function takes a tensor x and:
# 1. Unsqueezes it (adds a dimension at position 0)
# 2. Gets the shape and uses shape[0]
# 3. Views/reshapes to (batch_size, -1)
# 4. Squares and sums along dimension 1
# So x should be a tensor that can be unsqueezed and reshaped

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 Tensor, ndim 1, dtype family float, shape (1,) — shape (1,) 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
trades_loss Ran
ran on a synthesized input
xiaozhanguva/Intrinsic-Rob/train_classifier/adv_loss.py
code served (permissive licence) · get_code("92f367701add3745")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. 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, 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 torch.optim as optim

torch.manual_seed(0)

# Define a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__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 model and optimizer
model = SimpleModel()
optimizer = optim.SGD(model.parameters(), lr=0.01)

# Create small tensors for testing
# x_natural: batch_size=2, channels=1, height=2, width=2 (flattened to 4)
x_natural = torch.rand(2, 4)

# y: labels for batch_size=2, with 3 classes
y = torch.tensor([0, 1])

# Construct ARGS dictionary
ARGS = {
    'model': model,
    'x_natural': x_natural,
    'y': y,
    'optimizer': optimizer,
    'step_size': 0.003,
    'epsilon': 0.031,
    'perturb_steps': 2,
    'beta': 1.0,
    'distance': 'l_inf'
}
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 Tensor, 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
mnist_loader Not yet run
unverified (harvested, no recorded run)
xiaozhanguva/Intrinsic-Rob/generative/acgan.py
code served (permissive licence) · get_code("45ee55b50948ee1c")
How it ran

no invocation recorded.

remove_spectral_norm Not yet run
unverified (harvested, no recorded run)
xiaozhanguva/Intrinsic-Rob/generative/src/spectral_normalization.py
code served (permissive licence) · get_code("086ed50f42b2a3dd")
How it ran

no invocation recorded.

spectral_norm Not yet run
unverified (harvested, no recorded run)
xiaozhanguva/Intrinsic-Rob/generative/src/spectral_normalization.py
code served (permissive licence) · get_code("20fc434ea449700f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 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.

FunctionAlso present inEarliest-datedOthers named
remove_spectral_norm 6 other papers
1 dated earlier, 5 later
1911.07532 (2019-11)
Graph Neural Ordinary Differential Equations
2007.10247 (2020-07)
Learning Joint Spatial-Temporal Transformations for Video Inpainting
2106.08748 (2021-06)
Input Invex Neural Network
and 3 more not named here
spectral_norm 6 other papers
2 dated earlier, 4 later
1911.13239 (2019-11)
DoveNet: Deep Image Harmonization via Domain Verification
2001.02332 (2020-01)
Generative Adversarial Zero-Shot Relational Learning for Knowledge Graphs
2007.10247 (2020-07)
Learning Joint Spatial-Temporal Transformations for Video Inpainting
and 3 more not named here
squared_l2_norm 5 other papers
2 dated earlier, 3 later
1910.09338 (2019-10)
An Alternative Surrogate Loss for PGD-based Adversarial Testing
2002.03517 (2020-02)
Random Smoothing Might be Unable to Certify $\ell_\infty$ Robustness for High-Dimensional Images
aaai_26027 (2023 (year only))
Learning Adversarially Robust Sparse Networks via Weight Reparameterization
and 2 more not named here

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

Repositories linked to this paper

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

Abstract

Starting with Gilmer et al. (2018), several works have demonstrated the inevitability of adversarial examples based on different assumptions about the underlying input probability space. It remains unclear, however, whether these results apply to natural image distributions. In this work, we assume the underlying data distribution is captured by some conditional generative model, and prove intrinsic robustness bounds for a general class of classifiers, which solves an open problem in Fawzi et al. (2018). Building upon the state-of-the-art conditional generative models, we study the intrinsic robustness of two common image benchmarks under $\ell_2$ perturbations, and show the existence of a large gap between the robustness limits implied by our theory and the adversarial robustness achieved by current state-of-the-art robust models. Code for all our experiments is available at https://github.com/xiaozhanguva/Intrinsic-Rob.

For agents

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

get_harvested_code_for_paper("2003.00378")
get_code_for_paper("2003.00378")
have("2003.00378")

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

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

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

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

Connect an agent — have() is free.