SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.04985 · 2022

Understanding and Combating Robust Overfitting via Input Loss Landscape Analysis and Regularization

arXiv · PDF · Open in the Atlas

Code that ran

11 of 14 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 9 have no contract verdict; 2 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/2212.04985.json · badge: /api/ran/2212.04985.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
treelli/combating-ro-advlc canonical (classifier label)
classifier basis not recorded on the link
11 ran · 3 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/utils/helper.py
code served (permissive licence) · get_code("4fd5d1dd1a797d37")
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 list, ndim 2, 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
import torch.nn as nn

torch.manual_seed(0)

# Create output tensor: batch_size=2, num_classes=4
# output should be logits/scores for each class
output = torch.randn(2, 4)

# Create target tensor: batch_size=2, with class indices
target = torch.tensor([1, 3])

# topk parameter specifies which top-k accuracies to compute
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
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 list, ndim 2, dtype family float — a list 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
complete_ids Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/utils/log.py
code served (permissive licence) · get_code("4e3bcb7fb6c461e4")
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 str. 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

ID_LENGTH = 4

def complete_ids(ids):
    while len(ids) < ID_LENGTH:
        ids = '0' + ids
    return ids

ARGS = {
    'ids': '42'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
treelli/combating-ro-advlc/src/model/wide_resnet.py
pointer only (licence: MIT); 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 link allows the body inline (MIT), but get_code serves the stored copy, first harvested from amerch/CIFAR100-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.

gather_all Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/utils/helper.py
code served (permissive licence) · get_code("e7976a487657389f")
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 list, ndim 3, 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
import torch.distributed as dist
from unittest.mock import MagicMock, patch

torch.manual_seed(0)

# Mock torch.distributed.gather since we can't actually run distributed code in single process
original_gather = dist.gather

def mock_gather(tensor, gather_list=None, dst=0, group=None):
    """Mock gather that simulates distributed behavior"""
    if gather_list is not None:
        # Rank 0 case: fill the gather_list
        for i, t in enumerate(gather_list):
            t.copy_(tensor)
    # For other ranks, just return without error

dist.gather = mock_gather

# Create test arguments
rank = 0
world_size = 4
target = torch.randn(2, 4)

ARGS = {
    "rank": rank,
    "world_size": world_size,
    "target": target,
}
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 list, ndim 3, dtype family float — a list 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
ids_from_idx Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/utils/log.py
code served (permissive licence) · get_code("eac0350365e31875")
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 str. 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 numpy as np

def ids_from_idx(idx):
    try:
        ids = np.base_repr(idx, 36).lower()
        ids = '0' * (4 - len(ids)) + ids
        return ids
    except:
        raise Exception('Invalid index: {}'.format(idx))

ARGS = {
    'idx': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
idx_from_ids Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/utils/log.py
code served (permissive licence) · get_code("c4060e502670b5cb")
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 numpy as np

torch.manual_seed(0)

# The function idx_from_ids takes a string 'ids' and converts it from base 36 to an integer
# It uses int(ids, BASE) where BASE=36
# Valid base-36 strings use digits 0-9 and letters a-z (or A-Z)

ARGS = {
    "ids": "abc"  # Valid base-36 string
}
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 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
input_grad Ran
ran; our contract draft was wrong, not the code
treelli/combating-ro-advlc/src/utils/grad.py
code served (permissive licence) · get_code("b63f8dddc272ba67")
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 as nn

torch.manual_seed(0)

# Create a minimal model that accepts imgs and returns predictions
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal criterion (loss function)
criterion = nn.CrossEntropyLoss()

# Create tiny tensors
# imgs: batch_size=2, feature_dim=4
imgs = torch.randn(2, 4, requires_grad=True)

# targets: batch_size=2, class indices for CrossEntropyLoss
targets = torch.tensor([0, 2], dtype=torch.long)

# Create model
model = MinimalModel()

ARGS = {
    "imgs": imgs,
    "targets": targets,
    "model": model,
    "criterion": criterion
}
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
pixel_2_real Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/config/config.py
code served (permissive licence) · get_code("5d1ae0c45e71f173")
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 float, 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)

ARGS = {
    "pixel": 128
}
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 float, 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
real_2_pixel Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/config/config.py
code served (permissive licence) · get_code("f33bd487ae731b24")
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 numpy as np

torch.manual_seed(0)

# real_2_pixel takes a single parameter 'real' and converts it to a pixel value
# by multiplying by 255 and converting to int
# The parameter should be a float or numeric value between 0 and 1

ARGS = {
    "real": 0.5
}
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 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
upper Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/config/config.py
code served (permissive licence) · get_code("c4a5928bd44f924c")
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 str. 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

def upper(x):
    if isinstance(x, str):
        return x.upper()
    else:
        return str(x).upper()

# Test with a string argument
ARGS = {
    "x": "hello world"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
word Ran
ran on a synthesized input
treelli/combating-ro-advlc/src/utils/printer.py
code served (permissive licence) · get_code("d49988befbdccf83")
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 str. 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)

# Analyzing the function:
# - k: a string that gets ':' appended to it
# - v: can be bool, float, or other types (converted to str)
# The function formats and returns a message string

ARGS = {
    'k': 'example_key',
    'v': 0.5
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
hessian_ig Not yet run
unverified (harvested, no recorded run)
treelli/combating-ro-advlc/src/utils/grad.py
code served (permissive licence) · get_code("73e4014f2a1e2e1f")
How it ran

no invocation recorded.

hessian_loss Not yet run
unverified (harvested, no recorded run)
treelli/combating-ro-advlc/src/utils/grad.py
code served (permissive licence) · get_code("4d5ced10f4ad3d8d")
How it ran

no invocation recorded.

reduce_all Not yet run
unverified (harvested, no recorded run)
treelli/combating-ro-advlc/src/utils/helper.py
code served (permissive licence) · get_code("44448a225e87438a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 12 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 12 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
conv3x3 686 other papers
435 dated earlier, 6 the same month, 234 later, 11 same year, order not determinable · 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
input_grad 3 other papers
3 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
2306.07197 (2023-06)
AROID: Improving Adversarial Robustness Through Online Instance-Wise Data Augmentation
2403.01849 (2024-03)
One Prompt Word is Enough to Boost Adversarial Robustness for Pre-trained Vision-Language Models
pixel_2_real 2 other papers
2 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
2306.07197 (2023-06)
AROID: Improving Adversarial Robustness Through Online Instance-Wise Data Augmentation
real_2_pixel 2 other papers
2 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
2306.07197 (2023-06)
AROID: Improving Adversarial Robustness Through Online Instance-Wise Data Augmentation
upper 2 other papers
2 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
2306.07197 (2023-06)
AROID: Improving Adversarial Robustness Through Online Instance-Wise Data Augmentation
accuracy 1 other paper
1 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
complete_ids 1 other paper
1 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
gather_all 1 other paper
1 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
ids_from_idx 1 other paper
1 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
idx_from_ids 1 other paper
1 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
reduce_all 1 other paper
1 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve Adversarial Training
word 1 other paper
1 later
2301.09879 (2023-01)
Data Augmentation Alone Can Improve 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

Adversarial training is widely used to improve the robustness of deep neural networks to adversarial attack. However, adversarial training is prone to overfitting, and the cause is far from clear. This work sheds light on the mechanisms underlying overfitting through analyzing the loss landscape w.r.t. the input. We find that robust overfitting results from standard training, specifically the minimization of the clean loss, and can be mitigated by regularization of the loss gradients. Moreover, we find that robust overfitting turns severer during adversarial training partially because the gradient regularization effect of adversarial training becomes weaker due to the increase in the loss landscapes curvature. To improve robust generalization, we propose a new regularizer to smooth the loss landscape by penalizing the weighted logits variation along the adversarial direction. Our method significantly mitigates robust overfitting and achieves the highest robustness and efficiency compared to similar previous methods. Code is available at https://github.com/TreeLLi/Combating-RO-AdvLC.

For agents

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

get_harvested_code_for_paper("2212.04985")
get_code_for_paper("2212.04985")
have("2212.04985")

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

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

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

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

Connect an agent — have() is free.