SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1706.06083 · ICLR · 2017

Towards Deep Learning Models Resistant to Adversarial Attacks

Dimitris Tsipras, Aleksander Ądry, Mit, Adrian Vladu, Ludwig Schmidt, Aleksandar Makelov

arXiv · PDF · Open in the Atlas

Code that ran

9 of 17 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, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 8 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/1706.06083.json · badge: /api/ran/1706.06083.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
copy not recorded community
not in the paper's declared repositories
6 ran · 2 no recorded run
zibojia/rslad extension (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
zjfheart/Friendly-Adversarial-Training extension (classifier label)
classifier basis: classifier_2025
0 ran · 5 no recorded run
locuslab/convex_adversarial reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
attack_pgd Ran
ran; our contract draft was wrong, not the code
zibojia/rslad/rslad_loss.py
code served (permissive licence) · get_code("57555b28180e36f9")
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 Tensor, ndim 4, dtype family float; 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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc = nn.Linear(12, 3)
    
    def forward(self, x):
        # x shape: (batch, channels, height, width)
        # Flatten and pass through linear layer
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.fc(x_flat)

model = SimpleModel()

# Create small batch of image data (batch=2, channels=3, height=2, width=2)
train_batch_data = torch.rand(2, 3, 2, 2)

# Create labels for 3 classes
train_batch_labels = torch.tensor([0, 2])

ARGS = {
    'model': model,
    'train_batch_data': train_batch_data,
    'train_batch_labels': train_batch_labels,
    'attack_iters': 10,
    'step_size': 2 / 255.0,
    'epsilon': 8.0 / 255.0
}
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 Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
conv3x3 Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from amerch/CIFAR100-Training
pointer only; the stored copy get_code serves, from amerch/CIFAR100-Training, is pointer only (licence: NONE) · get_code("583f9780bdd00a45")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

kl_loss Ran
ran; our contract draft was wrong, not the code
zibojia/rslad/mobilenet_v2_rslad_cifar10.py
code served (permissive licence) · get_code("9960f247d801fa2a")
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 Tensor, ndim 2, dtype family float, shape (2, 3) 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 two small tensors for parameters a and b
# Using distinct sizes: batch=2, dim=3
a = torch.randn(2, 3)
b = torch.abs(torch.randn(2, 3)) + 0.1  # Make b positive to avoid log issues

ARGS = {
    'a': a,
    'b': b
}
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 Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
mixup_criterion Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from ndb796/pytorch-adversarial-training-cifar
pointer only; the stored copy get_code serves, from ndb796/pytorch-adversarial-training-cifar, is pointer only (licence: NONE) · get_code("33ba52fc17e89516")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

mixup_data Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from csdongxian/AWP
pointer only · get_code("b20f1357b1d8dbf8")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

mixup_data Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from ndb796/pytorch-adversarial-training-cifar
pointer only; the stored copy get_code serves, from ndb796/pytorch-adversarial-training-cifar, is pointer only (licence: NONE) · get_code("11b0ec76b88d8553")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

pseudorandom_target Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from andrewilyas/ens-adv-train-attack
pointer only; the stored copy get_code serves, from andrewilyas/ens-adv-train-attack, is pointer only (licence: NONE) · get_code("dc3545f86c25dbe2")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

pseudorandom_target_image Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from andrewilyas/ens-adv-train-attack
pointer only; the stored copy get_code serves, from andrewilyas/ens-adv-train-attack, is pointer only (licence: NONE) · get_code("108e0e470de94dfe")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

rslad_inner_loss Ran
ran; our contract draft was wrong, not the code
zibojia/rslad/rslad_loss.py
code served (permissive licence) · get_code("d4a9a69d1dba912f")
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 Tensor, ndim 2, dtype family float; 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 torch.nn.functional as F
from torch.autograd import Variable

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc1 = nn.Linear(12, 16)
        self.fc2 = nn.Linear(16, 5)
    
    def forward(self, x):
        # x shape: (batch, channels, height, width) = (2, 3, 2, 2)
        x = x.view(x.size(0), -1)  # flatten to (2, 12)
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        return x

model = SimpleModel()
teacher_logits = torch.randn(2, 5)
x_natural = torch.rand(2, 3, 2, 2)
y = torch.tensor([0, 1])
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

ARGS = {
    'model': model,
    'teacher_logits': teacher_logits,
    'x_natural': x_natural,
    'y': y,
    'optimizer': optimizer,
    'step_size': 0.003,
    'epsilon': 0.031,
    'perturb_steps': 10,
    'beta': 6.0
}
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 Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
MART_loss Not yet run
unverified (harvested, no recorded run)
zjfheart/Friendly-Adversarial-Training/FAT_for_MART.py
pointer only (licence: NONE) · get_code("f0d4b8c8f55455d1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zjfheart/Friendly-Adversarial-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. No invocation recorded.

TRADES_loss Not yet run
unverified (harvested, no recorded run)
zjfheart/Friendly-Adversarial-Training/FAT_for_TRADES.py
pointer only (licence: NONE) · get_code("310d3d6ec0329c05")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zjfheart/Friendly-Adversarial-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. No invocation recorded.

adjust_tau Not yet run
unverified (harvested, no recorded run)
zjfheart/Friendly-Adversarial-Training/FAT.py
pointer only (licence: NONE) · get_code("ed8707d32cea6f61")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zjfheart/Friendly-Adversarial-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. No invocation recorded.

adjust_tau Not yet run
unverified (harvested, no recorded run)
zjfheart/Friendly-Adversarial-Training/FAT_for_TRADES.py
pointer only (licence: NONE) · get_code("9257b5b1f6195ecf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zjfheart/Friendly-Adversarial-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. No invocation recorded.

adjust_tau Not yet run
unverified (harvested, no recorded run)
zjfheart/Friendly-Adversarial-Training/FAT_for_MART.py
pointer only (licence: NONE) · get_code("102fe6c0dc1d18bc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zjfheart/Friendly-Adversarial-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. No invocation recorded.

clamp Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from csdongxian/AWP
pointer only · get_code("8a93e041134b597a")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. No invocation recorded.

evaluate_baseline Not yet run
unverified (harvested, no recorded run)
locuslab/convex_adversarial/examples/trainer.py
code served (permissive licence) · get_code("3918fb83399cf118")
How it ran

no invocation recorded.

get_image Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from andrewilyas/ens-adv-train-attack
pointer only; the stored copy get_code serves, from andrewilyas/ens-adv-train-attack, is pointer only (licence: NONE) · get_code("197a1c1869bf9116")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. No invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 13 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 13 later) and 4 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
24 dated earlier, 662 later · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
clamp 33 other papers
33 later · 1 only as an assembly brick
2001.03994 (2020-01)
Fast is better than free: Revisiting adversarial training
2002.11569 (2020-02)
Overfitting in adversarially robust deep learning
2003.01690 (2020-03)
Reliable Evaluation of Adversarial Robustness with an Ensemble of Diverse Parameter-free Attacks
and 30 more not named here
mixup_criterion 14 other papers
14 later
1905.02175 (2019-05)
Adversarial Examples Are Not Bugs, They Are Features
1906.06784 (2019-06)
Interpolated Adversarial Training: Achieving Robust Neural Networks without Sacrificing Too Much Accuracy
1908.09699 (2019-08)
Gated Convolutional Networks with Hybrid Connectivity for Image Classification
and 11 more not named here
mixup_data 7 other papers
7 later
2002.11569 (2020-02)
Overfitting in adversarially robust deep learning
2003.01690 (2020-03)
Reliable Evaluation of Adversarial Robustness with an Ensemble of Diverse Parameter-free Attacks
2004.05884 (2020-04)
Adversarial Weight Perturbation Helps Robust Generalization
and 4 more not named here
kl_loss 3 other papers
3 later
1905.09747 (2019-05)
Adversarially Robust Distillation
2108.07969 (2021-08)
Revisiting Adversarial Robustness Distillation: Robust Soft Labels Make Student Better
2306.16170 (2023-06)
Mitigating Accuracy-Robustness Trade-off via Balanced Multi-Teacher Adversarial Distillation
TRADES_loss 2 other papers
2 later
1901.08573 (2019-01)
Theoretically Principled Trade-off between Robustness and Accuracy
2303.00250 (2023-03)
Combating Exacerbated Heterogeneity for Robust Models in Federated Learning
attack_pgd 2 other papers
2 later
1905.09747 (2019-05)
Adversarially Robust Distillation
2108.07969 (2021-08)
Revisiting Adversarial Robustness Distillation: Robust Soft Labels Make Student Better
get_image 2 other papers
1 dated earlier, 1 later
1705.07204 (2017-05)
Ensemble Adversarial Training: Attacks and Defenses
1712.07113 (2017-12)
Query-Efficient Black-box Adversarial Examples (superceded)
mixup_data 2 other papers
2 later
1905.02175 (2019-05)
Adversarial Examples Are Not Bugs, They Are Features
1906.06784 (2019-06)
Interpolated Adversarial Training: Achieving Robust Neural Networks without Sacrificing Too Much Accuracy
pseudorandom_target 2 other papers
1 dated earlier, 1 later
1705.07204 (2017-05)
Ensemble Adversarial Training: Attacks and Defenses
1712.07113 (2017-12)
Query-Efficient Black-box Adversarial Examples (superceded)
pseudorandom_target_image 2 other papers
1 dated earlier, 1 later
1705.07204 (2017-05)
Ensemble Adversarial Training: Attacks and Defenses
1712.07113 (2017-12)
Query-Efficient Black-box Adversarial Examples (superceded)
rslad_inner_loss 2 other papers
2 later
1905.09747 (2019-05)
Adversarially Robust Distillation
2108.07969 (2021-08)
Revisiting Adversarial Robustness Distillation: Robust Soft Labels Make Student Better
MART_loss 1 other paper
1 later
2303.00250 (2023-03)
Combating Exacerbated Heterogeneity for Robust Models in Federated Learning

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

Recent work has demonstrated that deep neural networks are vulnerable to adversarial examples-inputs that are almost indistinguishable from natural data and yet classified incorrectly by the network. In fact, some of the latest findings suggest that the existence of adversarial attacks may be an inherent weakness of deep learning models. To address this problem, we study the adversarial robustness of neural networks through the lens of robust optimization. This approach provides us with a broad and unifying view on much of the prior work on this topic. Its principled nature also enables us to identify methods for both training and attacking neural networks that are reliable and, in a certain sense, universal. In particular, they specify a concrete security guarantee that would protect against any adversary. These methods let us train networks with significantly improved resistance to a wide range of adversarial attacks. They also suggest the notion of security against a first-order adversary as a natural and broad security guarantee. We believe that robustness against such well-defined classes of adversaries is an important stepping stone towards fully resistant deep learning models. 1

For agents

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

get_harvested_code_for_paper("1706.06083")
get_code_for_paper("1706.06083")
have("1706.06083")

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

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

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

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

Connect an agent — have() is free.