SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2002.10509 · NeurIPS · 2020

HYDRA: Pruning Adversarially Robust Neural Networks

Vikash Sehwag, Shiqi Wang, Prateek Mittal, Suman Jana

arXiv · PDF · Open in the Atlas

Code that ran

4 of 19 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 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; 0 failures of our instrument; 15 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/2002.10509.json · badge: /api/ran/2002.10509.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
inspire-group/hydra community
Papers with Code archive
2 ran · 15 no recorded run
unites-lab/vpns community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
GetSubnet Ran
ran on a synthesized input · constructed an object; no result was computed
unites-lab/vpns/unstructured_network_with_score.py
code served (permissive licence) · get_code("3c96583f581f4d37")
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 an instance of its own class, GetSubnet: the run constructed the object and did not call it, so no result was computed. 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.autograd as autograd

torch.manual_seed(0)

# GetSubnet.forward expects:
# - scores: a tensor of scores
# - threshold: a scalar threshold value
# The forward method clones scores, compares to threshold, and returns binary output

scores = torch.randn(2, 4)
threshold = torch.tensor(0.5)

ARGS = {
    "scores": scores,
    "threshold": threshold
}
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 GetSubnet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GetSubnet 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
GetSubnet Ran
ran on a synthesized input · constructed an object; no result was computed
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("9c06e50d9e8c334e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_BN Ran
ran on a synthesized input · constructed an object; no result was computed
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("7440b4e5bc3f91bc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

SubnetConv Ran
ran on a synthesized input · constructed an object; no result was computed
unites-lab/vpns/unstructured_network_with_score.py
code served (permissive licence) · get_code("9fa88431a218cf84")
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 an instance of its own class, SubnetConv: the run constructed the object and did not call it, so no result was computed. 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 math

torch.manual_seed(0)

ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1,
    'groups': 1,
    'bias': True,
    'channel_prune': 'kernel'
}
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 SubnetConv — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SubnetConv 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
Center_symbolic_interval Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("95be6efd42f19c4d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_Bound Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("727eb7c9df20157d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_Conv2d Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("c24d64ff812f33fb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_Dense Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("e3fcced1e96eb0f2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_Flatten Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("001e355f33be54d7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_ReLU Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("f6c5efd14db6201c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_SubConv Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("7b61dbf5d4a8dbd0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_SubLinear Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("a65a8d15783b7474")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Interval_network Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("f108d8edefeb2b08")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Inverse_interval Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("f62e45a681df257c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Symbolic_interval Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("0ba759110f8efeb7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Symbolic_interval_proj1 Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("01f2161a52449ec4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

Symbolic_interval_proj2 Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("cfe05853a4302ca5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

gen_sym Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("c2a80e1b6f39c437")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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.

mix_interval Not yet run
unverified (harvested, no recorded run)
inspire-group/hydra/symbolic_interval/symbolic_network.py
pointer only (licence: NONE) · get_code("9e06a651cf81f00f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, inspire-group/hydra 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 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 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 18 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
GetSubnet
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2006.14769 (2020-06)
Supermasks in Superposition
2202.01341 (2022-02)
Robust Binary Models by Pruning Randomly-initialized Networks

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

In safety-critical but computationally resource-constrained applications, deep learning faces two key challenges: lack of robustness against adversarial attacks and large size of neural networks (often millions of parameters). While the research community has extensively explored the use of robust training and network pruning independently to address one of these challenges, only a few recent works have studied them jointly. However, these works inherit a heuristic pruning strategy that was developed for benign training, which performs poorly when integrated with robust training techniques, including adversarial training and verifiable robust training. To overcome this challenge, we propose to make pruning techniques aware of the robust training objective and let the training objective guide the search for which connections to prune. We realize this insight by formulating the pruning objective as an empirical risk minimization problem which is solved efficiently using SGD. We demonstrate that our approach, titled HYDRA 1 , achieves compressed networks with state-of-the-art benign and robust accuracy, simultaneously. We demonstrate the success of our approach across CIFAR-10, SVHN, and ImageNet dataset with four robust training techniques: iterative adversarial training, randomized smoothing, MixTrain, and CROWN-IBP. We also demonstrate the existence of highly robust sub-networks within non-robust networks. Our code and compressed networks are publicly available 2 . Key contributions: We make the following key contributions. • We develop a novel pruning technique, which is aware of the robust training objective, by formulating it as an empirical risk minimization problem, which we solve efficiently with SGD. We show the generalizability of our formulation by considering multiple types of robust training objectives, including verifiable robustness. We employ an importance score based optimization technique with our proposed scaled initialization of importance scores, which is the key driver behind the success of our approach. • We evaluate the proposed approach across four robust training objectives, namely iterative adversarial training [7, 30, 49], randomized smoothing [8, 7], MixTrain [38], and CROWN-IBP [48] on CIFAR-10, SVHN, and ImageNet dataset with multiple network architectures. Notably, at 99% connection pruning ratio, we achieve gains up to 3.2, 11.2, and 17.8 percentage points in robust accuracy, while simultaneously achieving state-of-the-art benign accuracy, compared to previous works [34, 45, 15] for ImageNet, CIFAR-10, and SVHN dataset, respectively. • We also demonstrate the existence of highly robust sub-networks within non-robust or weakly robust networks. In particular, within empirically robust networks that have no verifiable robustness, we were able to find sub-networks with verified robust accuracy close to state-of-the-art. 2 Background and related work Robust training. Robust training is one of the primary defenses against adversarial examples [5, 13, 6, 30, 3] where it can be divided into two categories: Adversarial training and verifiable robust training. The key objective of adversarial training is to minimize the training loss on adversarial

For agents

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

get_harvested_code_for_paper("2002.10509")
get_code_for_paper("2002.10509")
have("2002.10509")

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

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

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

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

Connect an agent — have() is free.