SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.01879 · ICLR · 2024

σ-ZERO: GRADIENT-BASED OPTIMIZATION OF ℓ 0 -NORM ADVERSARIAL EXAMPLES

Lea Schönherr, Maura Pintor, Battista Biggio, Antonio Cinà, Francesco Villani, Marcello Pelillo

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 5 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/2402.01879.json · badge: /api/ran/2402.01879.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
cinofix/sigma-zero-adversarial-attack canonical (classifier label)
classifier basis: census
8 ran · 5 no recorded run
jeromerony/adversarial-library canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
conv1x1 Ran
ran; our contract draft was wrong, not the code
cinofix/sigma-zero-adversarial-attack/utils/resnet.py
pointer only (licence: NONE); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("2a80220dabcb742a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

conv3x3 Ran
ran; our contract draft was wrong, not the code
cinofix/sigma-zero-adversarial-attack/utils/resnet.py
pointer only (licence: NONE); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("600ff2c45e0de056")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

difference_of_logits Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jeromerony/adversarial-library/adv_lib/attacks/sigma_zero.py
code served (permissive licence) · get_code("8de30c9ed4a4827e")
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 1, dtype family float, shape (2,) 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
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
num_classes = 4

# logits: shape (batch_size, num_classes)
logits = torch.randn(batch_size, num_classes)

# labels: shape (batch_size,) with class indices
labels = torch.tensor([1, 3], dtype=torch.long)

# labels_infhot: Optional, can be None or precomputed
# If None, it will be computed inside the function
labels_infhot = None

ARGS = {
    "logits": logits,
    "labels": labels,
    "labels_infhot": labels_infhot,
}
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 1, dtype family float, shape (2,) — shape (2,) 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
dlr_loss_targeted Ran
ran; our contract draft was wrong, not the code
cinofix/sigma-zero-adversarial-attack/utils/attack_wrappers.py
pointer only (licence: NONE); the stored copy get_code serves, from CityU-MLO/sPGD, is pointer only (licence: NONE) · get_code("ddce71a067599f06")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

drop_path Ran
ran; our contract draft was wrong, not the code
cinofix/sigma-zero-adversarial-attack/models/cifar10/c11_c12.py
pointer only (licence: NONE) · get_code("cc62fb1a937874d2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

fixed_asr Ran
ran, honoured the contract we drafted
cinofix/sigma-zero-adversarial-attack/utilities.py
pointer only (licence: NONE) · get_code("3038e0a67906d5b1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

get_norm_stats Ran
ran; our contract draft was wrong, not the code
cinofix/sigma-zero-adversarial-attack/utilities.py
pointer only (licence: NONE) · get_code("db77c4e8aea690b7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

sigma_zero Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jeromerony/adversarial-library/adv_lib/attacks/sigma_zero.py
code served (permissive licence) · get_code("f5f6eb3692c34ae6")
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 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 simple model that takes inputs and produces logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        # x shape: (batch_size, input_dim)
        return self.linear(x)

# Set up parameters
batch_size = 2
input_dim = 4
num_classes = 3

# Create model
model = SimpleModel(input_dim, num_classes)

# Create inputs in [0, 1] range
inputs = torch.rand(batch_size, input_dim)

# Create labels (class indices)
labels = torch.tensor([0, 1])

# Build ARGS dictionary with all parameters
ARGS = {
    'model': model,
    'inputs': inputs,
    'labels': labels,
    'num_steps': 10,
    'η_0': 1.0,
    'σ': 0.001,
    'τ_0': 0.3,
    'τ_factor': 0.01,
    'grad_norm': float('inf'),
    'targeted': 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 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
tp_relu Ran
ran; our contract draft was wrong, not the code
cinofix/sigma-zero-adversarial-attack/models/cifar10/c11_c12.py
pointer only (licence: NONE) · get_code("cd4fda681f389b4e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

tp_smoothed_relu Ran
ran; our contract draft was wrong, not the code
cinofix/sigma-zero-adversarial-attack/models/cifar10/c11_c12.py
pointer only (licence: NONE) · get_code("9c29c23a42e6a66b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

PreActResNet18 Not yet run
unverified (harvested, no recorded run)
cinofix/sigma-zero-adversarial-attack/models/cifar10/preact_resnet.py
pointer only (licence: NONE) · get_code("88e37f205195a51a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

get_cifar_loaders Not yet run
unverified (harvested, no recorded run)
cinofix/sigma-zero-adversarial-attack/dataset.py
pointer only (licence: NONE) · get_code("741cc4bc602aecde")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

get_mnist_loaders Not yet run
unverified (harvested, no recorded run)
cinofix/sigma-zero-adversarial-attack/dataset.py
pointer only (licence: NONE) · get_code("d0d665da7580ee86")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

get_predictions Not yet run
unverified (harvested, no recorded run)
cinofix/sigma-zero-adversarial-attack/utils/attack_wrappers.py
pointer only (licence: NONE) · get_code("72b9398658504f03")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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.

get_predictions_and_gradients Not yet run
unverified (harvested, no recorded run)
cinofix/sigma-zero-adversarial-attack/utils/attack_wrappers.py
pointer only (licence: NONE) · get_code("1a30faaa5c84a8d4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinofix/sigma-zero-adversarial-attack 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 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 2 the same month, 3 later) and 10 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
conv1x1 112 other papers
67 dated earlier, 3 the same month, 38 later, 4 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 109 more not named here
conv3x3 111 other papers
68 dated earlier, 3 the same month, 36 later, 4 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 108 more not named here
dlr_loss_targeted 2 other papers
2 later · 1 only as an assembly brick
2405.05075 (2024-05)
Sparse-PGD: A Unified Framework for Sparse Adversarial Perturbations Generation
2502.21041 (2025-02)
Understanding and Improving Fast Adversarial Training against l 0 Bounded Perturbations
difference_of_logits
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2103.01208 (2021-03)
Mind the Box: l 1 -APGD for Sparse Adversarial Attacks on Image Classifiers
drop_path 1 other paper
1 dated earlier
2309.04195 (2023-09)
Towards Mitigating Architecture Overfitting on Distilled Datasets

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

Evaluating the adversarial robustness of deep networks to gradient-based attacks is challenging. While most attacks consider ℓ 2 -and ℓ ∞ -norm constraints to craft input perturbations, only a few investigate sparse ℓ 1 -and ℓ 0 -norm attacks. In particular, ℓ 0 -norm attacks remain the least studied due to the inherent complexity of optimizing over a non-convex and non-differentiable constraint. However, evaluating adversarial robustness under these attacks could reveal weaknesses otherwise left untested with more conventional ℓ 2 -and ℓ ∞ -norm attacks. In this work, we propose a novel ℓ 0 -norm attack, called σ-zero, which leverages a differentiable approximation of the ℓ 0 norm to facilitate gradient-based optimization, and an adaptive projection operator to dynamically adjust the trade-off between loss minimization and perturbation sparsity. Extensive evaluations using MNIST, CIFAR10, and ImageNet datasets, involving robust and non-robust models, show that σ-zero finds minimum ℓ 0 -norm adversarial examples without requiring any time-consuming hyperparameter tuning, and that it outperforms all competing sparse attacks in terms of success rate, perturbation size, and efficiency. Code is available at https://github.com/sigma0-advx/sigma-zero.

For agents

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

get_harvested_code_for_paper("2402.01879")
get_code_for_paper("2402.01879")
have("2402.01879")

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

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

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

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

Connect an agent — have() is free.