SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2002.05999 · NeurIPS · 2020

Adversarial Distributional Training for Robust Deep Learning

Yinpeng Dong, Zhijie Deng, Tianyu Pang, Hang Su, Jun Zhu

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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 0 have no contract verdict; 2 failures of our instrument; 1 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/2002.05999.json · badge: /api/ran/2002.05999.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
dongyp13/adversarial-distributional-training canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
dongyp13/Adversarial-Distributional-Training marked official in Papers with Code
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
adt_loss Ran
ran; our contract draft was wrong, not the code
dongyp13/adversarial-distributional-training/adt_exp.py
code served (permissive licence) · get_code("425cd347c04fa255")
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 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
import torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

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

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

# Create natural input: batch_size=2, input_dim=4
x_natural = torch.rand(2, 4)

# Create labels: batch_size=2, num_classes=3
y = torch.tensor([0, 2])

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

# Define all arguments
ARGS = {
    'model': model,
    'x_natural': x_natural,
    'y': y,
    'optimizer': optimizer,
    'learning_rate': 1.0,
    'epsilon': 8.0 / 255.0,
    'perturb_steps': 2,
    'num_samples': 2,
    'lbd': 0.0
}
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 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
generate_pert Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dongyp13/Adversarial-Distributional-Training/adt_expam.py
code served (permissive licence) · get_code("3ab4f8401e4868aa")
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 4, dtype family float, shape (2, 3, 4, 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
import torch.nn.functional as F

torch.manual_seed(0)

# phi is a tensor with shape (batch, channels, height, width)
# The function expects:
# - phi[:, :3, :, :] for adv_mean (first 3 channels)
# - phi[:, 3:, :, :] for adv_std (remaining channels)
# So phi needs at least 4 channels total

batch_size = 2
height = 4
width = 3
num_channels = 6  # At least 4 channels needed (3 for mean + at least 1 for std)

phi = torch.randn(batch_size, num_channels, height, width)

ARGS = {
    "phi": phi,
    "return_entropy": False
}
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 4, dtype family float, shape (2, 3, 4, 3) — shape (2, 3, 4, 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
one_hot_tensor Not yet run
unverified (harvested, no recorded run)
dongyp13/adversarial-distributional-training/evaluate_attacks.py
code served (permissive licence) · get_code("e19cfeec2f5495fa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 2 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
one_hot_tensor 1 other paper
1 later
2201.13329 (2022-01)
Can Adversarial Training Be Manipulated By Non-Robust Features?

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

Adversarial training (AT) is among the most effective techniques to improve model robustness by augmenting training data with adversarial examples. However, most existing AT methods adopt a specific attack to craft adversarial examples, leading to the unreliable robustness against other unseen attacks. Besides, a single attack algorithm could be insufficient to explore the space of perturbations. In this paper, we introduce adversarial distributional training (ADT), a novel framework for learning robust models. ADT is formulated as a minimax optimization problem, where the inner maximization aims to learn an adversarial distribution to characterize the potential adversarial examples around a natural one under an entropic regularizer, and the outer minimization aims to train robust models by minimizing the expected loss over the worst-case adversarial distributions. Through a theoretical analysis, we develop a general algorithm for solving ADT, and present three approaches for parameterizing the adversarial distributions, ranging from the typical Gaussian distributions to the flexible implicit ones. Empirical results on several benchmarks validate the effectiveness of ADT compared with the state-of-the-art AT methods. * Equal contribution. † Corresponding author. 1 It should be noted that we consider the generalization problem across attacks under the same threat model, rather than studying the generalization ability across different threat models [25,17,64].

For agents

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

get_harvested_code_for_paper("2002.05999")
get_code_for_paper("2002.05999")
have("2002.05999")

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

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

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

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

Connect an agent — have() is free.