Papers › Which Models have Perceptually-Aligned Gradients? An Explanation via Off-Manifold Robustness

Which Models have Perceptually-Aligned Gradients? An Explanation via Off-Manifold Robustness

30 May 2023NeurIPS 2023 11arXiv:2305.19101archive 2025-07-28

Suraj Srinivas, Sebastian Bordt, Hima Lakkaraju

One of the remarkable properties of robust computer vision models is that their input-gradients are often aligned with human perception, referred to in the literature as perceptually-aligned gradients (PAGs). Despite only being trained for classification, PAGs cause robust models to have rudimentary generative capabilities, including image generation, denoising, and in-painting. However, the underlying mechanisms behind these phenomena remain unknown. In this work, we provide a first explanation of PAGs via \emph{off-manifold robustness}, which states that models must be more robust off- the data manifold than they are on-manifold. We first demonstrate theoretically that off-manifold robustness leads input gradients to lie approximately on the data manifold, explaining their perceptual alignment. We then show that Bayes optimal models satisfy off-manifold robustness, and confirm the same empirically for robust models trained via gradient norm regularization, randomized smoothing, and adversarial training with projected gradient descent. Quantifying the perceptual alignment of model gradients via their similarity with the gradients of generative models, we show that off-manifold robustness correlates well with perceptual alignment. Finally, based on the levels of on- and off-manifold robustness, we identify three different regimes of robustness that affect both perceptual alignment and model accuracy: weak robustness, bayes-aligned robustness, and excessive robustness. Code is available at \url{https://github.com/tml-tuebingen/pags}.

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="2305.19101")

Code

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

By repository: official repository: 5 samples from 1 repository, 5 ran; found in paper text by Syntology: 6 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

tml-tuebingen/pags officialmentioned in paperpytorch 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

11 samples harvested; 6 ran; 0 honoured the contract we drafted; 5 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.

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

Licence: 0 of the 11 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. “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.

dict2options tml-tuebingen/pags/run_experiments.py official repository ran · our draft was wrong MIT (permissive) · 05d569aa12038fae · report
get_optimizer_scheduler tml-tuebingen/pags/train_models.py official repository ran · our draft was wrong MIT (permissive) · 0d11fdf711dd6e20 · report
measure_on_off_manifold_robustness tml-tuebingen/pags/experiments/measure_manifold_robustness.py official repository ran · fixture could not drive it MIT (permissive) · 65b5172b3691e86a · report
project_into_tangent_space tml-tuebingen/pags/experiments/measure_manifold_robustness.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 58244b9a6e3b6f31 · report
softmax_l1 tml-tuebingen/pags/experiments/measure_manifold_robustness.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · d401cbdf3efe9b60 · report
add_args_to_parser MadryLab/robustness/robustness/defaults.py found in paper text by Syntology ran MIT (permissive) · 078da01e51a28471 · report
alexnet MadryLab/robustness/robustness/imagenet_models/alexnet.py found in paper text by Syntology unverified MIT (permissive) · 3b26d6ebbd9142b2 · report
densenet121 MadryLab/robustness/robustness/imagenet_models/densenet.py found in paper text by Syntology unverified MIT (permissive) · 85c4757ab3246b61 · report
densenet161 MadryLab/robustness/robustness/imagenet_models/densenet.py found in paper text by Syntology unverified MIT (permissive) · 6b70762b5419b176 · report
densenet169 MadryLab/robustness/robustness/imagenet_models/densenet.py found in paper text by Syntology unverified MIT (permissive) · 019686268f24b3b5 · report
model_dataset_from_store MadryLab/robustness/robustness/model_utils.py found in paper text by Syntology unverified MIT (permissive) · c1e41af537b4027c · report

Tasks

DenoisingImage Generation

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