SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.03543 · 2022

A2: Efficient Automated Attacker for Boosting Adversarial Training

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 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; 8 failures of our instrument; 3 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/2210.03543.json · badge: /api/ran/2210.03543.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
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training canonical (classifier label)
classifier basis not recorded on the link
9 ran · 3 no recorded run
FunctionStatusWhere it lives
PreActResNet18 Ran
ran; our contract draft was wrong, not the code
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/preactresnet.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from jiancongxiao/moreau-envelope-sgd, is pointer only (licence: NONE) · get_code("1153837ba4a94242")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from jiancongxiao/moreau-envelope-sgd, and GitHub detected no licence in that repository 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.

cwloss Ran
ran; our contract draft was wrong, not the code
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/attack_generator.py
code served (permissive licence) · get_code("9813b7acd483544c")
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; 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
from torch.autograd import Variable

torch.manual_seed(0)

# The function expects:
# - output: a tensor of shape (batch_size, num_classes) with logits/scores
# - target: a tensor of shape (batch_size,) with class indices
# - confidence: int, margin parameter (default 50)
# - num_classes: int, number of classes (default 10)

batch_size = 2
num_classes = 10

# output: model predictions/logits of shape (batch_size, num_classes)
output = torch.randn(batch_size, num_classes, requires_grad=True)

# target: ground truth class indices of shape (batch_size,)
target = torch.tensor([1, 5], dtype=torch.long)

ARGS = {
    "output": output,
    "target": target,
    "confidence": 50,
    "num_classes": 10
}
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 0, 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
diff_in_weights Ran
ran; our contract draft was wrong, not the code
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/utils_awp.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Alexkael/S2O, is pointer only (licence: NONE) · get_code("4170809219439d13")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Alexkael/S2O, and GitHub detected no licence in that repository 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.

eval_clean Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/attack_generator.py
code served (permissive licence) · get_code("7d56f981324d219b")
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. 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
from torch import nn

torch.manual_seed(0)

# Build a small model that takes input and produces class logits
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Create model instance
model = SimpleClassifier(input_dim=4, num_classes=3)

# Create test loader as a list of (data, target) tuples
# Batch size 2, input dimension 4, 3 classes
test_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([2, 0])),
]

# Add dataset attribute to test_loader for len(test_loader.dataset)
class SimpleDataLoader(list):
    def __init__(self, data):
        super().__init__(data)
        self.dataset = self

test_loader = SimpleDataLoader(test_loader)

ARGS = {
    'model': model,
    'test_loader': test_loader,
}
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
filter_state_dict Ran
ran; our contract draft was wrong, not the code
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/attack.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from inspire-group/variation-regularization, is pointer only (licence: NONE) · get_code("18b797b7c88af64d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from inspire-group/variation-regularization, and GitHub detected no licence in that repository 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.

mixup_data Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/train_cifar10.py
code served (permissive licence) · get_code("b20f1357b1d8dbf8")
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. 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 numpy as np
import torch

torch.manual_seed(0)

# Create small tensors for x and y
# x should be a 2D tensor (batch_size, features)
# y should be a 1D tensor (batch_size,) with class labels
batch_size = 2
feature_dim = 4

x = torch.randn(batch_size, feature_dim)
y = torch.tensor([0, 1])

ARGS = {
    "x": x,
    "y": y,
    "alpha": 1.0
}
Setup block drafted by
a language model, Claude Haiku 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 — 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
normalize Ran
ran on a synthesized input
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/auto_adv/adv_x.py
code served (permissive licence) · get_code("47cda3ad3eaf971b")
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
import numpy as np

torch.manual_seed(0)

# Create small tensors for X, mu, and std
X = torch.randn(2, 4)  # batch size 2, dimension 4
mu = torch.randn(4)    # mean vector matching feature dimension
std = torch.randn(4)   # std vector matching feature dimension

ARGS = {
    'X': X,
    'mu': mu,
    'std': std
}
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 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
pad Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from jiancongxiao/moreau-envelope-sgd, is pointer only (licence: NONE) · get_code("1e0eb41fc8899d05")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from jiancongxiao/moreau-envelope-sgd, and GitHub detected no licence in that repository 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.

pgd Ran
ran; our contract draft was wrong, not the code
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/attack_generator.py
code served (permissive licence) · get_code("cdf5b1330544a607")
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. 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 numpy as np

torch.manual_seed(0)

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

# Create model instance
model = SimpleModel(input_dim=4, num_classes=10)

# Create tiny tensors for data and target
batch_size = 2
input_dim = 4
num_classes = 10

data = torch.randn(batch_size, input_dim)
target = torch.randint(0, num_classes, (batch_size,))

# Define loss function
def loss_fn_cw(output, target):
    return nn.CrossEntropyLoss(reduction='mean')(output, target)

# Define adversarial attack parameters
epsilon = 0.3
step_size = 0.1
num_steps = 2
loss_fn = 'cent'
category = 'Madry'
rand_init = True

ARGS = {
    'model': model,
    'data': data,
    'target': target,
    'epsilon': epsilon,
    'step_size': step_size,
    'num_steps': num_steps,
    'loss_fn': loss_fn,
    'category': category,
    'rand_init': rand_init
}
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 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
clamp Not yet run
unverified (harvested, no recorded run)
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/train_cifar10.py
code served (permissive licence) · get_code("8a93e041134b597a")
How it ran

no invocation recorded.

normalise Not yet run
unverified (harvested, no recorded run)
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from jiancongxiao/moreau-envelope-sgd, is pointer only (licence: NONE) · get_code("d2a4ac781b2a9628")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from jiancongxiao/moreau-envelope-sgd, and GitHub detected no licence in that repository 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.

transpose Not yet run
unverified (harvested, no recorded run)
alipay/A2-efficient-automated-attacker-for-boosting-adversarial-training/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from jiancongxiao/moreau-envelope-sgd, is pointer only (licence: NONE) · get_code("c0f89c373fea538a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from jiancongxiao/moreau-envelope-sgd, and GitHub detected no licence in that repository 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.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
clamp 33 other papers
17 dated earlier, 16 later · 1 only as an assembly brick
1706.06083 (2017-06)
Towards Deep Learning Models Resistant to Adversarial Attacks
2001.03994 (2020-01)
Fast is better than free: Revisiting adversarial training
2002.11569 (2020-02)
Overfitting in adversarially robust deep learning
and 30 more not named here
PreActResNet18 22 other papers
6 dated earlier, 1 the same month, 15 later
1710.09412 (2017-10)
mixup: BEYOND EMPIRICAL RISK MINIMIZATION
2003.04887 (2020-03)
ReZero is All You Need: Fast Convergence at Large Depth
2103.14222 (2021-03)
Adversarial Attacks are Reversible with Natural Supervision
and 19 more not named here
normalise 8 other papers
5 dated earlier, 3 later
1905.02249 (2019-05)
MixMatch: A Holistic Approach to Semi-Supervised Learning
2003.14297 (2020-03)
Generative Latent Implicit Conditional Optimization when Learning from Small Sample
2006.12135 (2020-06)
Learning to Generate Noise for Multi-Attack Robustness
and 5 more not named here
diff_in_weights 7 other papers
2 dated earlier, 2 the same month, 3 later · 1 only as an assembly brick
1901.08573 (2019-01)
Theoretically Principled Trade-off between Robustness and Accuracy
2208.08270 (2022-08)
On the Privacy Effect of Data Enhancement via the Lens of Memorization
2210.09852 (2022-10)
Scaling Adversarial Training to Large Perturbation Bounds
and 4 more not named here
mixup_data 7 other papers
6 dated earlier, 1 later
1706.06083 (2017-06)
Towards Deep Learning Models Resistant to Adversarial Attacks
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 4 more not named here
cwloss 6 other papers
2 dated earlier, 4 later · 2 only as an assembly brick
2010.01736 (2020-10)
Geometry-aware Instance-reweighted Adversarial Training
2106.04928 (2021-06)
Reliable Adversarial Distillation with Unreliable Teachers
2303.00250 (2023-03)
Combating Exacerbated Heterogeneity for Robust Models in Federated Learning
and 3 more not named here
pad 6 other papers
3 dated earlier, 3 later
2006.12135 (2020-06)
Learning to Generate Noise for Multi-Attack Robustness
2103.14222 (2021-03)
Adversarial Attacks are Reversible with Natural Supervision
2204.03714 (2022-04)
ICLR 2022 PAIR 2 Struct Workshop USING MULTIPLE SELF-SUPERVISED TASKS IM-PROVES MODEL ROBUSTNESS
and 3 more not named here
filter_state_dict 5 other papers
4 dated earlier, 1 later
2103.14347 (2021-03)
Combating Adversaries with Anti-Adversaries
2107.14110 (2021-07)
Enhancing Adversarial Robustness via Test-time Transformation Ensembling
2204.13779 (2022-04)
Formulating Robustness Against Unforeseen Attacks
and 2 more not named here
transpose 3 other papers
3 later
2303.02251 (2023-03)
Certified Robust Neural Networks: Generalization and Corruption Resistance
2310.08847 (2023-10)
On the Over-Memorization During Natural, Robust and Catastrophic Overfitting
2405.01817 (2024-05)
Uniformly Stable Algorithms for Adversarial Training and Beyond
eval_clean 1 other paper
1 later
2309.05145 (2023-09)
Outlier Robust Adversarial Training
pgd 1 other paper
1 later
2309.05145 (2023-09)
Outlier Robust Adversarial Training

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

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

Abstract

Based on the significant improvement of model robustness by AT (Adversarial Training), various variants have been proposed to further boost the performance. Well-recognized methods have focused on different components of AT (e.g., designing loss functions and leveraging additional unlabeled data). It is generally accepted that stronger perturbations yield more robust models. However, how to generate stronger perturbations efficiently is still missed. In this paper, we propose an efficient automated attacker called A2 to boost AT by generating the optimal perturbations on-the-fly during training. A2 is a parameterized automated attacker to search in the attacker space for the best attacker against the defense model and examples. Extensive experiments across different datasets demonstrate that A2 generates stronger perturbations with low extra cost and reliably improves the robustness of various AT methods against different attacks.

For agents

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

get_harvested_code_for_paper("2210.03543")
get_code_for_paper("2210.03543")
have("2210.03543")

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

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

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

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

Connect an agent — have() is free.