SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.13736 · 2019

Unlabeled Data Improves Adversarial Robustness

U Berkeley, Aditi Raghunathan, John Duchi, Percy Liang, Yair Carmon, Ludwig Schmidt

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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 4 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-24; 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/1905.13736.json · badge: /api/ran/1905.13736.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
yaircarmon/semisup-adv canonical (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
yguooo/semisup-adv community (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
FunctionStatusWhere it lives
add_noise Ran
ran on a synthesized input
yguooo/semisup-adv/smoothing.py
code served (permissive licence) · get_code("1170e3d378933b6f")
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 torch.nn

torch.manual_seed(0)

# Construct a small tensor for input
x = torch.randn(2, 4)

# Set noise standard deviation
noise_sd = 0.5

ARGS = {
    "x": x,
    "noise_sd": noise_sd
}
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
entropy_loss Ran
ran; our contract draft was wrong, not the code
yguooo/semisup-adv/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from zjfheart/Geometry-aware-Instance-reweighted-Adversarial-Training, is pointer only (licence: NONE) · get_code("044ec38c1bb631ec")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zjfheart/Geometry-aware-Instance-reweighted-Adversarial-Training, 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.

noise_loss Ran
ran on a synthesized input
yguooo/semisup-adv/losses.py
code served (permissive licence) · get_code("25a38483a96ef158")
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. 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)

# Build a minimal model that takes input and produces logits
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        # Flatten if needed and pass through linear layer
        if x.dim() > 2:
            x = x.view(x.size(0), -1)
        return self.linear(x)

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

# Create sample inputs
batch_size = 2
x_natural = torch.randn(batch_size, 4)  # batch_size=2, feature_dim=4
x_natural = x_natural.clamp(0.0, 1.0)  # ensure values in [0, 1] for image-like data

# Create sample labels
y = torch.tensor([0, 1])  # 2 labels for batch_size=2

# Define arguments dict
ARGS = {
    "model": model,
    "x_natural": x_natural,
    "y": y,
    "epsilon": 0.25,
    "clamp_x": True,
}
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, 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
pgd Ran
ran on a synthesized input
yguooo/semisup-adv/attack_pgd.py
code served (permissive licence) · get_code("a23942fc2c20b6ab")
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. 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.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a simple model that takes input and outputs class logits
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim, num_classes):
        super(SimpleClassifier, self).__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        # Flatten if needed
        if len(x.shape) > 2:
            x = x.view(x.size(0), -1)
        return self.linear(x)

# Instantiate model
model = SimpleClassifier(input_dim=4, num_classes=3)

# Create small batch of input data (batch_size=2, features=4)
# Normalize to [0, 1] range as expected by the function
X = torch.rand(2, 4, dtype=torch.float32)

# Create corresponding labels (batch_size=2, with class indices in range [0, 3))
y = torch.tensor([0, 2], dtype=torch.long)

# Define ARGS dictionary with all parameters
ARGS = {
    "model": model,
    "X": X,
    "y": y,
    "epsilon": 8 / 255,
    "num_steps": 20,
    "step_size": 0.01,
    "random_start": True
}
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 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
trades_loss Ran
ran on a synthesized input
yguooo/semisup-adv/losses.py
code served (permissive licence) · get_code("b4e250fcdcfa0031")
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. 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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define a minimal model that satisfies how trades_loss uses it
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 input tensors
batch_size = 2
x_natural = torch.randn(batch_size, 4)
y = torch.tensor([0, 1])  # labels for labeled samples

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

# Build ARGS dict with all parameters for trades_loss
ARGS = {
    'model': model,
    'x_natural': x_natural,
    'y': y,
    'optimizer': optimizer,
    'step_size': 0.003,
    'epsilon': 0.031,
    'perturb_steps': 2,
    'beta': 1.0,
    'adversarial': True,
    'distance': 'l_inf',
    'entropy_weight': 0.0
}
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 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
adjust_learning_rate Not yet run
unverified (harvested, no recorded run)
yaircarmon/semisup-adv/robust_self_training.py
code served (permissive licence) · get_code("ff2608741074ca18")
How it ran

no invocation recorded.

get_cifar10_vs_ti_loader Not yet run
unverified (harvested, no recorded run)
yguooo/semisup-adv/dataloader.py
code served (permissive licence) · get_code("fa65590439d1a465")
How it ran

no invocation recorded.

get_loader Not yet run
unverified (harvested, no recorded run)
yguooo/semisup-adv/dataloader.py
code served (permissive licence) · get_code("30546224f5287d93")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
entropy_loss 2 other papers
2 later
2006.12135 (2020-06)
Learning to Generate Noise for Multi-Attack Robustness
2010.01736 (2020-10)
Geometry-aware Instance-reweighted Adversarial Training
noise_loss 1 other paper
1 later
2006.12135 (2020-06)
Learning to Generate Noise for Multi-Attack Robustness

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

Repositories linked to this paper

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

Abstract

We demonstrate, theoretically and empirically, that adversarial robustness can significantly benefit from semisupervised learning. Theoretically, we revisit the simple Gaussian model of Schmidt et al. [41] that shows a sample complexity gap between standard and robust classification. We prove that unlabeled data bridges this gap: a simple semisupervised learning procedure (selftraining) achieves high robust accuracy using the same number of labels required for achieving high standard accuracy. Empirically, we augment CIFAR-10 with 500K unlabeled images sourced from 80 Million Tiny Images and use robust self-training to outperform state-of-the-art robust accuracies by over 5 points in (i) ∞ robustness against several strong attacks via adversarial training and (ii) certified 2 and ∞ robustness via randomized smoothing. On SVHN, adding the dataset's own extra training set with the labels removed provides gains of 4 to 10 points, within 1 point of the gain from using the extra labels.

For agents

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

get_harvested_code_for_paper("1905.13736")
get_code_for_paper("1905.13736")
have("1905.13736")

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

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

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

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

Connect an agent — have() is free.