SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1412.6572 · ICLR · 2014

Explaining and Harnessing Adversarial Examples

Christian Szegedy, Jonathon Shlens, Ian Goodfellow

arXiv · PDF · Open in the Atlas

Code that ran

16 of 21 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, 1 violated it and 6 have no contract verdict; 7 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/1412.6572.json · badge: /api/ran/1412.6572.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
formal-verification-research/verapak community (classifier label)
classifier basis not recorded on the link
3 ran · 2 no recorded run
BendeguzToth/Fun-with-ConvNets community (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
Anaststam/Adversarial-Attacks reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
KeAWang/BayesianGAN4AdversarialAttacks extension (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
eth-sri/diffai extension (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
shijiel2/cleverhans reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
amerch/CIFAR100-Training extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
LawrenceMMStewart/Adversarial_Attack reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
arg_type Ran
ran; our contract draft was wrong, not the code
shijiel2/cleverhans/cleverhans/attacks/attack.py
code served (permissive licence) · get_code("50b95028f0c76d76")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 2, 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
import torch

torch.manual_seed(0)

# Create arg_names as a tuple of argument names
arg_names = ('input_data', 'labels', 'weights', 'optional_param')

# Create kwargs dict with various numpy arrays and None values
kwargs = {
    'input_data': np.array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=np.float32),
    'labels': np.array([0, 1], dtype=np.int64),
    'weights': None,
    # 'optional_param' is intentionally not included to test the "not passed" case
}

ARGS = {
    'arg_names': arg_names,
    'kwargs': kwargs
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 2, 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
catNonNullErrors Ran
ran; our contract draft was wrong, not the code
eth-sri/diffai/ai.py
code served (permissive licence) · get_code("f8f37cd8a52870c1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned function. 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.autograd

torch.manual_seed(0)

# The function catNonNullErrors takes two parameters:
# 1. op: a function that operates on two tensors
# 2. ref_errs: an optional tensor (default None)

# Define a simple operation function that takes two tensors
def simple_op(tensor1, tensor2):
    return tensor1 + tensor2

# Create a reference errors tensor (optional parameter)
ref_errs_tensor = torch.randn(3)

ARGS = {
    'op': simple_op,
    'ref_errs': ref_errs_tensor
}
Setup block drafted by
a language model, Claude Sonnet 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
amerch/CIFAR100-Training/models/resnet.py
pointer only (licence: NONE) · get_code("583f9780bdd00a45")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, amerch/CIFAR100-Training when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

fast_gradient_attack Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Anaststam/Adversarial-Attacks/attacks.py
pointer only (licence: NONE) · get_code("10b255fd33ae2074")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Anaststam/Adversarial-Attacks when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

fgsm Ran
ran; our contract draft was wrong, not the code
LawrenceMMStewart/Adversarial_Attack/FGSM_LeNet5.py
pointer only (licence: NONE) · get_code("4cb25a22c32d9e0a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, LawrenceMMStewart/Adversarial_Attack when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_gan_labels Ran
ran, violated the contract we drafted
KeAWang/BayesianGAN4AdversarialAttacks/bayesian_gan_hmc.py
pointer only (licence: NOASSERTION) · get_code("a0cc7a40deacf582")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, KeAWang/BayesianGAN4AdversarialAttacks (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_supervised_batches Ran
ran; our contract draft was wrong, not the code
KeAWang/BayesianGAN4AdversarialAttacks/bayesian_gan_hmc.py
pointer only (licence: NOASSERTION) · get_code("c3eb6809b747e0a0")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, KeAWang/BayesianGAN4AdversarialAttacks (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_test_batches Ran
ran; our contract draft was wrong, not the code
KeAWang/BayesianGAN4AdversarialAttacks/bayesian_gan_hmc.py
pointer only (licence: NOASSERTION) · get_code("428f94db5821f119")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, KeAWang/BayesianGAN4AdversarialAttacks (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

indices Ran
ran on a synthesized input
BendeguzToth/Fun-with-ConvNets/project/layers.py
code served (permissive licence) · get_code("3f8a2efde87b7214")
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 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

# Construct valid arguments for the indices function
# This function performs im2col (image to column) indexing for convolution operations

ARGS = {
    "Fh": 3,           # Filter height
    "Fw": 3,           # Filter width
    "Sh": 1,           # Vertical stride
    "Sw": 1,           # Horizontal stride
    "steps_h": 4,      # Height of output (number of vertical steps)
    "steps_w": 5,      # Width of output (number of horizontal steps)
}
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 tuple, ndim 3, dtype family int — 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
one_hot Ran
ran on a synthesized input
BendeguzToth/Fun-with-ConvNets/project/utils.py
code served (permissive licence) · get_code("df76aed2eb8e5d62")
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 (5, 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 numpy as np

# Analyze the function: one_hot takes two parameters
# - size: int (dimension of the vector to create)
# - hot: int (index to set to 1)
# The function creates a zero vector of length 'size', sets index 'hot' to 1,
# and adds a new axis at the end

ARGS = {
    'size': 5,
    'hot': 2,
}
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 (5, 1) — shape (5, 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
output_to_loss Ran
ran on a synthesized input
formal-verification-research/verapak/verapak/model_tools/model_base.py
code served (permissive licence) · get_code("a7d275667792ebe3")
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 EagerTensor, 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 numpy as np
import tensorflow as tf

# Create output tensor - needs to be a TensorFlow tensor
# Using values that will trigger from_logits=True (max > 1 or min < 0)
output = tf.constant([[2.0, -1.0, 0.5, 1.5], 
                       [0.8, -0.5, 1.2, 0.3]], dtype=tf.float32)

# Create label tensor - needs to be one-hot encoded for categorical_crossentropy
# Shape should match output (batch_size=2, num_classes=4)
label_tf = tf.constant([[1.0, 0.0, 0.0, 0.0],
                        [0.0, 1.0, 0.0, 0.0]], dtype=tf.float32)

ARGS = {
    "output": output,
    "label_tf": label_tf
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
point_to_domain Ran
ran on a synthesized input
formal-verification-research/verapak/verapak/snap.py
code served (permissive licence) · get_code("0246559ef6f30ca2")
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 (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 numpy as np

# Create a simple point (can be a scalar, 1D array, or multi-dimensional)
point = np.array([0.5, 1.5, -0.3, 2.1])

# Create a domain [min, max]
domain = np.array([-1.0, 1.0])

ARGS = {
    "point": point,
    "domain": domain,
}
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 1, dtype family float, shape (4,) — shape (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
predict_model Ran
ran, honoured the contract we drafted
Anaststam/Adversarial-Attacks/training_and_evaluation.py
pointer only (licence: NONE) · get_code("81a5ee879107fc8b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Anaststam/Adversarial-Attacks when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

region_to_domain Ran
ran on a synthesized input
formal-verification-research/verapak/verapak/snap.py
code served (permissive licence) · get_code("6a50db6778426abc")
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 2, 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

class Region:
    def __init__(self, low, high):
        self.low = low
        self.high = high

# Create a region object with low and high bounds
region = Region(
    low=np.array([1.0, 2.0, 3.0, 4.0]),
    high=np.array([8.0, 9.0, 10.0, 11.0])
)

# Define a domain as a tuple (min, max)
domain = (0.0, 7.0)

ARGS = {
    "region": region,
    "domain": domain
}
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 2, dtype family float — 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
train_model Ran
ran, honoured the contract we drafted
Anaststam/Adversarial-Attacks/training_and_evaluation.py
pointer only (licence: NONE) · get_code("9b17713b7849e4b3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Anaststam/Adversarial-Attacks when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

unpickle Ran
ran on a synthesized input
BendeguzToth/Fun-with-ConvNets/project/utils.py
code served (permissive licence) · get_code("46842ba14f312456")
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

# Create a temporary pickle file with some test data
test_data = {
    b'key1': b'value1',
    b'key2': [1, 2, 3],
    b'key3': {'nested': b'data'}
}

# Create a temporary file and pickle the data
temp_fd, temp_path = tempfile.mkstemp(suffix='.pkl')
os.close(temp_fd)

with open(temp_path, 'wb') as f:
    pickle.dump(test_data, f)

ARGS = {
    'file': temp_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 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
creluBoxy Not yet run
unverified (harvested, no recorded run)
eth-sri/diffai/ai.py
code served (permissive licence) · get_code("a49c0dd16152c346")
How it ran

no invocation recorded.

creluBoxySound Not yet run
unverified (harvested, no recorded run)
eth-sri/diffai/ai.py
code served (permissive licence) · get_code("c42ef7b9012126aa")
How it ran

no invocation recorded.

get_onnx_node_shape Not yet run
unverified (harvested, no recorded run)
formal-verification-research/verapak/verapak/model_tools/onnx_utils.py
code served (permissive licence) · get_code("ab24078cd09fe35d")
How it ran

no invocation recorded.

load_cifar10 Not yet run
unverified (harvested, no recorded run)
BendeguzToth/Fun-with-ConvNets/project/utils.py
code served (permissive licence) · get_code("4bbe5492f940117b")
How it ran

no invocation recorded.

load_graph_by_type Not yet run
unverified (harvested, no recorded run)
formal-verification-research/verapak/verapak/model_tools/model_base.py
code served (permissive licence) · get_code("6ffa680aced49b5f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 5 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 5 later) and 16 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
conv3x3 686 other papers
2 dated earlier, 684 later · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1505.04597 (2015-05)
U-Net: Convolutional Networks for Biomedical Image Segmentation
and 683 more not named here
arg_type 2 other papers
2 later
1602.02697 (2016-02)
Practical Black-Box Attacks against Machine Learning
1610.00768 (2016-10)
Technical Report on the CleverHans v2.1.0 Adversarial Examples Library
creluBoxy 2 other papers
2 later
1810.12715 (2018-10)
On the Effectiveness of Interval Bound Propagation for Training Verifiably Robust Models
2002.09579 (2020-02)
Robustness to Programmable String Transformations via Augmented Abstract Training
catNonNullErrors 1 other paper
1 later
1810.12715 (2018-10)
On the Effectiveness of Interval Bound Propagation for Training Verifiably Robust Models
creluBoxySound 1 other paper
1 later
1810.12715 (2018-10)
On the Effectiveness of Interval Bound Propagation for Training Verifiably Robust 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-22.

Repositories linked to this paper

More are linked than shown here.

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

Abstract

Several machine learning models, including neural networks, consistently misclassify adversarial examples-inputs formed by applying small but intentionally worst-case perturbations to examples from the dataset, such that the perturbed input results in the model outputting an incorrect answer with high confidence. Early attempts at explaining this phenomenon focused on nonlinearity and overfitting. We argue instead that the primary cause of neural networks' vulnerability to adversarial perturbation is their linear nature. This explanation is supported by new quantitative results while giving the first explanation of the most intriguing fact about them: their generalization across architectures and training sets. Moreover, this view yields a simple and fast method of generating adversarial examples. Using this approach to provide examples for adversarial training, we reduce the test set error of a maxout network on the MNIST dataset.

For agents

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

get_harvested_code_for_paper("1412.6572")
get_code_for_paper("1412.6572")
have("1412.6572")

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

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

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

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

Connect an agent — have() is free.