What a Purifier Lets Through: Predicting Adaptive Attacks on Diffusion Purification from Its Clean-Accuracy Cost

Adversarial purification is a defense that cleans an input before a fixed classifier sees it. A common version is diffusion purification: add noise to the image, then use a generative denoiser to reconstruct it, in the hope that the small adversarial pattern is washed away while the object survives. This kind of defense rests on a bet that adversarial perturbations are fragile and the image's real content is not. Recent work shows the bet fails. When the attacker differentiates correctly through the purifier, reported robustness collapses. A low-frequency attack even drives accuracy to roughly zero under majority voting.

What the field lacks is an explanation of which perturbations survive. We also cannot predict how badly a given purifier will fail without running an attack that costs hours per model. We propose a simple, testable account. A purifier must pass through the image directions the classifier needs in order to stay accurate on clean data. Those same directions are an open channel for the attacker. Perturbations confined to that channel should succeed. Because the channel carries class-relevant content, they should also look like target-class features imprinted into the image rather than noise.

If this holds, three things become linked. A purifier's clean-accuracy cost, its weakness to adaptive attacks, and the semantic look of successful attacks are all readings of one measurable object: the purifier's average response to small input changes. That object can be estimated cheaply on clean data.

Core Claim

Let $P_t(x;\omega)$ be a purifier run at noise level $t$ with random seed $\omega$. Write $A_t(x) = \mathbb{E}_\omega[\partial P_t(x;\omega)/\partial x]$ for its expected Jacobian, which says how a small input change is carried to the output on average. Let $m(\cdot)$ be the classifier's margin between the true class and the runner-up. For a budget $\epsilon$ in the $\ell_\infty$ norm, a linearized adaptive attacker can reduce the post-purification margin by about $\epsilon \lVert A_t(x)^\top \nabla m(P_t(x)) \rVert_1$. This gives a cheap predicted robust accuracy:

$$\widehat{\mathrm{RA}}(t,\epsilon) = \Pr_x\!\left[\, m(P_t(x)) > \epsilon \,\lVert A_t(x)^\top \nabla m(P_t(x)) \rVert_1 \right].$$

Here the probability is over clean test images $x$. Raising $t$ shrinks $A_t$ in the class-relevant directions, which raises $\widehat{\mathrm{RA}}$. It also shrinks the clean margin $m(P_t(x))$, which is the clean-accuracy cost that Diffusion Models for Adversarial Purification describes when a large timestep turns a cat into a dog.

We make three claims:

  1. The top singular directions of $A_t^\top \nabla m$ carry nearly all of an exact adaptive attack's effect. An attack restricted to a small subspace of them should match a full-space attack, and an attack in the complement should fail.
  2. $\widehat{\mathrm{RA}}$ should track the true adaptive robust accuracy across $t$ closely enough to rank purifier settings without running the full attack.
  3. Successful attacks in this subspace should yield purified outputs that independent classifiers read as the target class. The purifier's own generator completes the attacker's imprint into a target-class image.

Relation to Prior Work

Two papers motivate the claim.

DiffBreak: Is Diffusion-Based Purification Robust? fixes gradient errors in attacks on DiffPure and drops CIFAR-10 robust accuracy from about 62% to 17.19%. It also argues that an adaptive attacker turns the denoiser into a generator of adversarial features. Its low-frequency attack reaches roughly 0% under majority vote. DiffBreak shows that purification breaks but offers no account of which directions break it, and no link to clean accuracy. We treat its low-frequency attack as a hand-picked approximation to the subspace we compute directly. Its gradient library is the tool we use to compute that subspace.

When Does Diffusion Purification Amplify Perturbations? finds that the gap between clean and adversarial denoising trajectories peaks mid-trajectory. Early-step perturbations are amplified by a ratio above 2. That paper tests only pixel-space PGD and builds no adaptive attack. Amplification by more than 2 means some directions in $A_t$ have gain above one, and our analysis predicts that attacks exploit exactly those.

The semantic-attack literature supplies the interpretation and one baseline. Earlier work found that perturbations align with target-class features:

None of these study what a purifier does to such imprints. We use AIM's feature-alignment loss as a competing attack objective.

AMRM-Pure reports 75.83% robust accuracy on CIFAR-10 with a masked-reconstruction purifier. Its authors leave open whether an attack aware of the attention structure would break it. We apply the same subspace analysis to it, which makes it a test case rather than a counterexample.

Theoretically Principled Trade-off between Robustness and Accuracy splits robust error into natural error plus error near the decision boundary. Our expression is the purification analogue. The boundary term is set by what the purifier passes, not by what the classifier learned.

Research Program

The first component is estimation. We estimate $A_t^\top \nabla m$ per image with a randomized low-rank decomposition. Each step uses vector-Jacobian products through the reverse process, computed with the corrected gradients from DiffGrad: replayed noise, consistent time steps, and Monte Carlo averaging over seeds. This yields the top-$k$ directions and the predicted robust accuracy $\widehat{\mathrm{RA}}$. The cost is a few dozen backward passes per image, versus hundreds of attack iterations times many restarts for a full worst-case evaluation.

The second component is a restricted attack. We run PGD constrained to the span of the top-$k$ directions and sweep $k$. We do the same in the orthogonal complement, and in a random subspace of equal size.

The third component is semantic readout. For successful attacks we check whether the purified output is read as the attacker's target class by two independent judges: classifiers from a different architecture family than the one attacked, and a CLIP zero-shot model. We also measure perceptual distance between the purified output and the clean source.

All three components are run over a sweep of $t$, on DiffPure and on AMRM-Pure.

Baselines

The naive reference point is the undefended classifier: a standard RobustBench-listed CIFAR-10 model and a WideResNet-50-2 on ImageNet, attacked with AutoAttack. It anchors clean accuracy and shows how much any purifier buys.

The strongest existing attack is DiffGrad's full-space adaptive PGD together with its low-frequency attack. Both are run with the released library under the worst-case and majority-vote protocols from DiffBreak, which reports DiffPure robust accuracy of 17.19% on CIFAR-10 and 12.11% on ImageNet (worst-case), and roughly 0% under the low-frequency attack with majority vote. For fairness, our restricted attack gets the same $\epsilon$, iteration count, restarts and Monte Carlo sample count. The subspace-estimation passes are counted against its budget. "Beating" this baseline does not mean lower robust accuracy, since roughly 0% leaves no room. It means matching DiffGrad's success rate within a small number of points using a subspace of at most a few percent of input dimensions. It also means $\widehat{\mathrm{RA}}$ predicts DiffGrad's measured robust accuracy across $t$ with a rank correlation high enough to choose the same best $t$, at a stated fraction of the compute.

The strongest semantic attack baseline is AIM's mid-layer alignment loss, from AIM, backpropagated end-to-end through the purifier with DiffGrad gradients, under the same budget. If it produces equally semantic purified outputs at equal success, our subspace account is still the explanation. But it would weaken the claim that the subspace is the right lens for designing attacks.

The strongest defense reference points are reported numbers:

  • AMRM-Pure's 75.83% robust accuracy on CIFAR-10 from AMRM-Pure, which we re-attack.
  • TRADES at 56.61% robust and 88.64% natural accuracy on CIFAR-10 from TRADES. These come from different trade-off settings, not a single model. They locate adversarial training on the clean-versus-robust plane.

Two ablations isolate the key ingredient, the purifier-specific expected Jacobian. The first replaces the subspace with a fixed Fourier low-pass basis of equal dimension. The second replaces it with the classifier's own top gradient directions computed without the purifier.

Why not just…?

Why not just run DiffGrad and the low-frequency attack at every timestep and read off the frontier? This is the real threat to the proposal, and for measuring the frontier alone it works. DiffBreak shows the attack is accurate. What it does not give is a reason the frontier sits where it does, or a cheap way to place a new purifier on it. Evaluation cost is a known bottleneck of these attacks. The decisive check is whether $\widehat{\mathrm{RA}}$ ranks timesteps and purifiers the same way full DiffGrad does at much lower cost. If it does not, the predictive half of the proposal fails. Only the mechanistic half, the restricted-subspace attack, would remain.

Why not just use a fixed low-frequency basis, since the low-frequency attack already reaches zero? If a generic Fourier low-pass subspace matches the purifier-specific subspace at equal dimension, then "purifiers pass low frequencies" explains everything and the Jacobian is unnecessary. Two facts suggest the purifier-specific subspace should matter. The trajectory analysis in When Does Diffusion Purification Amplify Perturbations? shows gains that depend on timestep. And AMRM-Pure reconstructs through attention over patches, not frequency bands. The Fourier ablation settles this directly, and we will report it as a negative result if it ties.

Why not just use adversarial training, or simple filtering like JPEG and blur, instead of analyzing purifiers? These methods are not alternatives to the analysis. They are points it should explain. Simple filters are projections with a known pass band, so our estimate applies to them unchanged. We include JPEG and Gaussian blur in the timestep sweep as a cheap sanity check that the predicted robust accuracy also tracks their measured robust accuracy. Adversarial training changes the classifier rather than the input path. TRADES's reported numbers serve only as a reference point for the trade-off it achieves.

Proposed Experiments

On CIFAR-10 we use the DiffPure score model with 10 timesteps spanning the range from "perturbation survives" to "labels change." We also use AMRM-Pure's released MaskDiT purifier at several mask ratios. On ImageNet we use DiffPure with WideResNet-50-2 on a fixed 512-image subset, because subspace estimation scales with input size. ImageWoof serves as a fine-grained stress test, where clean-accuracy cost should rise fastest with $t$.

For every setting we report:

  • clean accuracy;
  • worst-case and majority-vote robust accuracy under DiffGrad, the low-frequency attack, the AIM-loss attack, and the restricted attack at several $k$;
  • the predicted robust accuracy $\widehat{\mathrm{RA}}$;
  • the rate at which purified adversarial outputs are classified as the target by held-out judges;
  • wall-clock compute.

The first decisive check is the subspace split. A top-$k$ attack with $k$ at most a few percent of dimensions should reach DiffGrad-level success, while the complement and random subspaces of equal size should not. If complement attacks succeed comparably, the core claim is false.

The second check is predictive. $\widehat{\mathrm{RA}}$ plotted against measured adaptive robust accuracy across all $t$ and both purifiers should be monotone and preserve rankings. Points that sit consistently above the curve would indicate that linearization misses curvature the attack exploits. We would report that as the method's limit.

The third check is semantic. Purified adversarial outputs should be assigned the attacker's target class by held-out judges far above chance, more so than for complement-subspace perturbations of equal norm. That would confirm the purifier's generator completes the imprinted features.

The last check applies the analysis to AMRM-Pure. If its 75.83% reported robustness drops sharply under the restricted attack, the account generalizes beyond score-based diffusion. If it holds, we will examine which property of attention-guided reconstruction shrinks the class-relevant pass-through directions without shrinking the clean margin. That property would be the most useful finding for future defenses.