SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.12554 · 2023

Improving the Accuracy-Robustness Trade-Off of Classifiers via Adaptive Smoothing

arXiv · PDF · Open in the Atlas

Code that ran

6 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 6 have no contract verdict; 0 failures of our instrument; 2 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/2301.12554.json · badge: /api/ran/2301.12554.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
bai-yt/adaptivesmoothing canonical (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
L1_projection Ran
ran on a synthesized input
bai-yt/adaptivesmoothing/comp_autoattack/autopgd_base.py
code served (permissive licence) · get_code("1c16a011a0349571")
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

torch.manual_seed(0)

# x2: center of the L1 ball (bs x input_dim)
x2 = torch.rand(2, 4)

# y2: current perturbation (bs x input_dim)
y2 = torch.rand(2, 4) * 0.1

# eps1: radius of the L1 ball (scalar)
eps1 = 0.5

ARGS = {
    "x2": x2,
    "y2": y2,
    "eps1": eps1,
}
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
assemble_data Ran
ran on a synthesized input
bai-yt/adaptivesmoothing/adaptive_smoothing/prepare_data.py
code served (permissive licence) · get_code("4734cca6699e8aac")
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

torch.manual_seed(0)

# Create sample image tensors (batch_size=2, channels=4)
image_batch_1 = torch.randn(2, 4)
image_batch_2 = torch.randn(2, 4)

# Create sample label tensors (batch_size=2)
label_batch_1 = torch.randn(2)
label_batch_2 = torch.randn(2)

# Test case 1: nested=False (flat lists of tensors)
imageset_flat = [image_batch_1, image_batch_2]
labelset_flat = [label_batch_1, label_batch_2]

# Test case 2: nested=True (lists of lists of tensors)
imageset_nested = [[image_batch_1, image_batch_2], [torch.randn(2, 4)]]
labelset_nested = [[label_batch_1, label_batch_2], [torch.randn(2)]]

# Using the flat (non-nested) case for ARGS
ARGS = {
    "imageset": imageset_flat,
    "labelset": labelset_flat,
    "nested": False
}
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 — 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
check_range_output Ran
ran on a synthesized input
bai-yt/adaptivesmoothing/comp_autoattack/checks.py
code served (permissive licence) · get_code("f219074d942e3b32")
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 int, ndim 0, dtype family int, 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
import warnings

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

class SimpleLogger:
    def log(self, msg):
        pass

model = SimpleModel(input_dim=5, output_dim=4)
x = torch.randn(2, 5)

logger = SimpleLogger()

ARGS = {
    'model': model,
    'x': x,
    'alpha': 1e-05,
    'logger': logger
}
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 int, ndim 0, dtype family int, 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
load_data Ran
ran on a synthesized input
bai-yt/adaptivesmoothing/adaptive_smoothing/prepare_data.py
code served (permissive licence) · get_code("070460386bfb8f43")
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 pickle
import torch
import tempfile
import os

torch.manual_seed(0)

# Create temporary pickle file with test data
train_images = torch.randn(2, 4)
train_labels = torch.randint(0, 2, (2,))
test_images = torch.randn(2, 4)
test_labels = torch.randint(0, 2, (2,))

# Create data dict with 2-element tuples (no first element)
data = {
    'train': (train_images, train_labels),
    'test': (test_images, test_labels)
}

# Write to temporary file
temp_fd, temp_path = tempfile.mkstemp(suffix='.pkl')
os.close(temp_fd)
try:
    with open(temp_path, 'wb') as f:
        pickle.dump(data, f)
    
    ARGS = {
        'load_path': temp_path
    }
finally:
    # Note: file will remain for the function to use
    pass
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 — 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
pgd_update Ran
ran on a synthesized input
bai-yt/adaptivesmoothing/adaptive_smoothing/attacks.py
code served (permissive licence) · get_code("cc49f7b6dd72223e")
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 5, 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 torch

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
height = 4
width = 3
channels = 1

# Create images tensor with gradient enabled
images = torch.randn(batch_size, channels, height, width, requires_grad=True, dtype=torch.float32)
images.grad = torch.randn(batch_size, channels, height, width, dtype=torch.float32)

# Create ori_images tensor (original images for reference)
ori_images = torch.rand(batch_size, channels, height, width, dtype=torch.float32)

# Clamp to valid image range [0, 1]
ori_images = torch.clamp(ori_images, min=0, max=1)
images.data = torch.clamp(ori_images + torch.randn(batch_size, channels, height, width) * 0.01, min=0, max=1)

ARGS = {
    'images': images,
    'ori_images': ori_images,
    'pgd_type': 'l_inf',
    'pgd_alpha': 0.01,
    'pgd_eps': 0.03,
    'n': batch_size,
    'momentum': 0
}
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 5, 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
reduce Ran
ran on a synthesized input
bai-yt/adaptivesmoothing/adaptive_smoothing/losses.py
code served (permissive licence) · get_code("849d15297f8360ce")
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

torch.manual_seed(0)

# Create a small loss tensor
loss = torch.randn(2, 4)

# Define reduction type - test with 'mean'
reduction = 'mean'

ARGS = {
    'loss': loss,
    'reduction': reduction
}
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
comp_pgd_attack Not yet run
unverified (harvested, no recorded run)
bai-yt/adaptivesmoothing/adaptive_smoothing/attacks.py
code served (permissive licence) · get_code("9d155aa2b6ebc707")
How it ran

no invocation recorded.

single_pgd_attack Not yet run
unverified (harvested, no recorded run)
bai-yt/adaptivesmoothing/adaptive_smoothing/attacks.py
code served (permissive licence) · get_code("f484c71520aed670")
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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

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

While prior research has proposed a plethora of methods that build neural classifiers robust against adversarial robustness, practitioners are still reluctant to adopt them due to their unacceptably severe clean accuracy penalties. This paper significantly alleviates this accuracy-robustness trade-off by mixing the output probabilities of a standard classifier and a robust classifier, where the standard network is optimized for clean accuracy and is not robust in general. We show that the robust base classifier's confidence difference for correct and incorrect examples is the key to this improvement. In addition to providing intuitions and empirical evidence, we theoretically certify the robustness of the mixed classifier under realistic assumptions. Furthermore, we adapt an adversarial input detector into a mixing network that adaptively adjusts the mixture of the two base models, further reducing the accuracy penalty of achieving robustness. The proposed flexible method, termed "adaptive smoothing", can work in conjunction with existing or even future methods that improve clean accuracy, robustness, or adversary detection. Our empirical evaluation considers strong attack methods, including AutoAttack and adaptive attack. On the CIFAR-100 dataset, our method achieves an 85.21% clean accuracy while maintaining a 38.72% $\ell_\infty$-AutoAttacked ($ε= 8/255$) accuracy, becoming the second most robust method on the RobustBench CIFAR-100 benchmark as of submission, while improving the clean accuracy by ten percentage points compared with all listed models. The code that implements our method is available at https://github.com/Bai-YT/AdaptiveSmoothing.

For agents

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

get_harvested_code_for_paper("2301.12554")
get_code_for_paper("2301.12554")
have("2301.12554")

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

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

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

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

Connect an agent — have() is free.