Papers › Fighting Gradients with Gradients: Dynamic Defenses against Adversarial Attacks

Fighting Gradients with Gradients: Dynamic Defenses against Adversarial Attacks

18 May 2021NeurIPS 2021 12arXiv:2105.08714archive 2025-07-28

Dequan Wang, An Ju, Evan Shelhamer, David Wagner, Trevor Darrell

Adversarial attacks optimize against models to defeat defenses. Existing defenses are static, and stay the same once trained, even while attacks change. We argue that models should fight back, and optimize their defenses against attacks at test time. We propose dynamic defenses, to adapt the model and input during testing, by defensive entropy minimization (dent). Dent alters testing, but not training, for compatibility with existing models and train-time defenses. Dent improves the robustness of adversarially-trained defenses and nominally-trained models against white-box, black-box, and adaptive attacks on CIFAR-10/100 and ImageNet. In particular, dent boosts state-of-the-art defenses by 20+ points absolute against AutoAttack on CIFAR-10 at ϵ_∞ = 8/255.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2105.08714")

Code

Syntology Ran 10 of 13 code samples harvested from 2 repositories linked to this paper; 3 have no recorded run. Of those that ran: 5 ran · our draft was wrong; 2 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: official repository: 6 samples from 1 repository, 4 ran; community (archive-listed): 2 samples from 1 repository, 2 ran; 5 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

DequanWang/dent officialmentioned in papermentioned on GitHubpytorchMIT report
DequanWang/tent mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

13 samples harvested; 10 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

5ran · our draft was wrong
2ran · fixture could not drive it
3ran
3unverified

Licence: 5 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

collect_stats DequanWang/dent/norm.py official repository ran MIT (permissive) · c5f915703f30ab89 · report
configure_model DequanWang/dent/norm.py official repository ran MIT (permissive) · 8f537ee8d4a9b397 · report
setup_source DequanWang/dent/cifar10c.py official repository ran · our draft was wrong MIT (permissive) · 721e565ebd5fda4e · report
softmax_entropy DequanWang/dent/tent.py official repository ran · fixture could not drive it MIT (permissive) · 3078648c75e3e1e3 · report
shot DequanWang/dent/dent.py official repository unverified MIT (permissive) · 1a3691c12b2dbd54 · report
tent DequanWang/dent/dent.py official repository unverified MIT (permissive) · 5a02af70018fdf00 · report
collect_params DequanWang/tent/tent.py community (archive-listed) ran · our draft was wrong MIT (permissive) · fb3d07027ed3b46c · report
forward_and_adapt DequanWang/tent/tent.py community (archive-listed) ran · our draft was wrong MIT (permissive) · dae52c9027c48afd · report
Tent identical code first harvested elsewhere ran · metamorphic tier: deterministic licence of this copy not recorded · 9b0b70ed44f66088 · report
copy_model_and_optimizer identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · d203451c6493f65d · report
forward_and_adapt identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 1d10e9bc70ce18a5 · report
softmax_entropy identical code first harvested elsewhere ran · fixture could not drive it licence of this copy not recorded · 60e9cb8fea03027c · report
load_model_and_optimizer identical code first harvested elsewhere unverified licence of this copy not recorded · 5014c3a1f79a6661 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections