CLIP is a model that matches images to text descriptions, and it is used for zero-shot classification. It can be fooled by small pixel changes that a person would not notice. A recent group of defenses tries to fix this without the cost of adversarial training. Adversarial training means retraining the model on attacked examples, and it is expensive because every training step contains an inner loop that searches for the worst-case perturbation. The cheaper alternatives instead show the model several transformed copies of each test image, such as crops and flips, and use the disagreement among those copies to detect and undo an attack. They report large robustness gains with almost no loss on clean images and almost no added latency. That claim, if it holds, means robustness without paying in training compute or in clean accuracy.
This note proposes to test whether that claim survives an attacker who knows the defense, and to account for what the defense really costs. The central idea comes from a result on diffusion purification. DiffBreak showed that diffusion purification, which denoises the input before classifying it, can be attacked with exact gradients through the denoiser. Under that attack the purifier does more than fail. It actively steers the cleaned image into the wrong class, and reported robust accuracy of about 62% on CIFAR-10 drops to 17.19%. We conjecture that augmentation-based test-time correction has the same weakness. If a defense moves an embedding along a "recovery direction" computed from the input itself, an attacker can shape the input so that this direction points toward a class of the attacker's choosing.
Core Claim
Training-free test-time defenses for CLIP preserve clean accuracy through a gate. The gate is a check that decides whether an input looks attacked before any correction is applied. We claim the gate is also where they are weakest. An attacker has two options. One is to keep the input below the gate's trigger while still fooling plain CLIP. The other is to trigger the gate deliberately and make the correction itself carry the embedding to a target class.
We predict that the worse of these two attacks will cut adaptive robust accuracy well below the numbers reported under PGD and AutoAttack. PGD (projected gradient descent) is the standard iterative pixel-space attack, and AutoAttack is a fixed ensemble of attacks. We also predict that raising the gate's sensitivity to recover robustness will bring back the clean-accuracy loss the defense claimed to avoid. In short, the robustness-accuracy trade-off has not been removed. It has been hidden by evaluating against attackers that ignore the defense.
What would be new is threefold. First, a correction-hijacking attack built specifically for drift-and-gate defenses and for test-time prompt tuning. Second, a measured trade-off curve under that attack. Third, a comparison of trained and training-free defenses at matched total compute.
Where this sits
Two papers motivate this work by leaving the question open. ATAC works in CLIP's embedding space. It averages the shifts in embedding between a test image and its geometric augmentations to estimate a recovery direction. It then applies that correction only when a cosine-consistency gate finds the shifts aligned. It reports outperforming prior test-time defenses by nearly 50% on average across 13 datasets, and it reports "non-trivial resilience" to attacks aimed at the gate.
R-TPT tunes a text prompt at test time by minimizing the entropy of each augmented view's prediction. It then combines views with weights that downweight outliers. It raises ImageNet robust accuracy under PGD from 0.1% to 47.7%, at 0.58s per sample with 64 views. It does not test attacks that anticipate its outlier rejection.
The difference from ATAC's own adaptive test is specific. ATAC tests evasion of the gate. We add the opposite mode: triggering the gate on purpose and controlling where the correction sends the embedding. That is the analogue of DiffBreak's finding that the defense mechanism itself can be steered.
Two papers constrain the design. DiffBreak shows that naive gradient estimates through a stochastic defense overstate robustness. Its exact-gradient recipe, which replays the defense's randomness and matches its steps, is the method we reuse. DiffBreak also shows that low-frequency perturbations survive purification and drive robust accuracy to about 0%. MetaCloak uses expectation over transformations, meaning it optimizes a perturbation averaged over random transformations, so that the perturbation survives blurring.
Together these suggest a mechanism for evading the gate. The fragility literature, including APBench, shows that high-frequency perturbations are destroyed by transformations. Augmentation defenses rely on exactly that destruction to produce a consistent drift. A perturbation built to survive the defense's own augmentations should therefore produce scattered, clean-looking drift.
The trained competitors are MoAPT and Robustness Tokens. MoAPT adversarially tunes a mixture of 8 text prompts, weighted by a small router network that looks at image features. Robustness Tokens trains 10 tokens prepended to the input of a frozen vision transformer, in 200 steps. Both cut the cost of adversarial training sharply. Neither has been tested against attacks that target the router or the learned tokens directly.
Research Program
The first component is a ladder of attacks, ordered by how much the attacker knows. The bottom rung is the reported setting: PGD and AutoAttack on the undefended pipeline. The next rung is expectation over transformations, applied across the defense's actual augmentation distribution. For R-TPT, this rung also backpropagates through the unrolled prompt-tuning steps with randomness replayed, following DiffBreak.
The top rung is correction hijacking. Let $e(\cdot)$ be CLIP's image embedding and $D(x)$ the defended embedding after the gated correction. Let $t$ be the text embedding of a target class, $g(x)$ the gate's consistency score, $\tau$ its threshold, and $\epsilon$ the perturbation budget. We solve
$$\max_{\|\delta\|_\infty \le \epsilon} \; \cos\big(D(x+\delta),\, t\big)$$
in two modes. The trigger mode forces $g(x+\delta) > \tau$ through a hinge penalty, so the correction is applied and steered toward $t$. The evade mode forces $g(x+\delta) < \tau$, so the correction is skipped while plain CLIP is fooled. In evade mode we also add a low-frequency parameterization of $\delta$, following DiffBreak's low-frequency attack. Per-example robust accuracy is the worst case over the two modes. This answers in advance the objection that the attack was tuned for only one branch.
The second component is the trade-off curve. For ATAC we sweep $\tau$, and for R-TPT we sweep the reliability-weighting strength. At each setting we record clean accuracy and worst-case adaptive robust accuracy. The prediction is a monotone frontier: settings that keep clean accuracy near vanilla CLIP have low adaptive robustness. The published operating point would then be one point on an ordinary trade-off curve, not an escape from it.
The third component is compute accounting. Each defense is charged its training FLOPs plus its per-query inference FLOPs times a deployment volume $N$. We report its position on the plane of clean accuracy against adaptive robust accuracy at $N$ of $10^4$, $10^6$, and $10^8$ queries. Training-free methods carry multi-view inference cost, and trained prompt methods carry a one-time training cost. Which is cheaper depends on $N$, and no paper in the file reports this crossover.
Baselines
The naive reference point is undefended zero-shot CLIP: ResNet-50 and ViT-B/16 backbones with default class prompts, evaluated on the 11 to 13 dataset suite used by MoAPT, ATAC and R-TPT, including ImageNet. R-TPT reports this point collapsing to 0.1% on ImageNet under PGD. Alongside it we run JPEG compression and bit-depth reduction before CLIP, the zero-overhead transforms that APBench finds effective against availability poisoning. Including them tests whether augmentation defenses do anything beyond what a fixed lossy filter does once the attacker adapts.
The strongest training-free competitor is ATAC. It claims latency close to vanilla CLIP and the largest reported margins. We run it with its published augmentation set and gate, and give our attacks the same number of defense queries per example that ATAC's own adaptive evaluation used. No absolute ATAC robust-accuracy figure is reported on Lacuna; the file gives only the "nearly 50% on average" margin over prior test-time defenses. We will therefore reproduce its PGD numbers before attacking it.
The reported number to beat for R-TPT is 47.7% ImageNet robust accuracy under PGD, with clean accuracy on its CLIP ResNet-50 benchmark rising from 53.2% to 53.7%, both from R-TPT.
The strongest trained competitor is MoAPT. It reports average gains over single-prompt adversarial tuning of +11.33% under AutoAttack, +8.99% under PGD, and +5.60% on clean accuracy. No absolute values are reported on Lacuna. We retrain it on the same ImageNet training split and attack budget, and attack it adaptively through its router network. Robustness Tokens is included on an OpenCLIP backbone as a white-box target. Its reported 63.1% robust accuracy on DINOv2-G is not comparable to zero-shot CLIP, so we use it only for the compute frontier.
The ablation that isolates our key ingredient is the expectation-over-transformations attack with the hijack and gate terms removed. A second ablation is ATAC with the gate removed, so that correction is always applied. "Beating" a defense means two things. Our top-rung attack must lower its worst-case robust accuracy by a margin larger than the spread across random seeds, relative to the strongest of the lower rungs. And every gate setting on the frontier that keeps clean accuracy within one point of vanilla CLIP must fall below MoAPT's adaptive robustness at matched compute.
Why not just…?
Why not just run AutoAttack with expectation over transformations and call it adaptive? This may well be enough. If it is, the audit result stands and our attack contribution shrinks to confirming it. The ladder is designed to show this. We report the lowest rung that breaks each defense. DiffBreak is the reason not to stop at the generic rung: generic gradient estimates through stochastic defenses overstated DiffPure's robustness by more than 40 points.
Why not just apply JPEG or blur before CLIP? APBench shows these transforms work against non-adaptive shortcut noise. However, IMPRESS (IMPRESS) and the Proactive Defense Benchmark both find them insufficient against perturbations that account for the model, and low-frequency perturbations pass through them. We include these filters under the same adaptive ladder, so the comparison is measured rather than assumed.
Why not just adversarially prompt-tune once and skip test-time defenses? This is a real threat to the training-free line, and the compute frontier is designed to settle it. MoAPT's one-time training cost may be repaid within a modest number of queries compared with 64-view R-TPT. If MoAPT also holds up better under router-aware attack, the honest conclusion is that training-free defenses are dominated beyond some query volume. We will report that conclusion if the data show it.
Why not trust ATAC's own adaptive evaluation? That evaluation targets gate evasion. Our trigger-mode hijack tests the opposite route, which ATAC's evaluation does not consider. If ATAC holds within a few points under both modes, that is itself a strong positive result for training-free defense, and we will report it as such.
Decisive Checks
Three outcomes decide the proposal. The first concerns the attack: on ImageNet, correction hijacking must cut ATAC's and R-TPT's worst-case accuracy clearly below both their reported PGD robustness and the plain expectation-over-transformations rung. The second concerns the trade-off: the gate sweep must produce a frontier on which no setting has both clean accuracy within one point of vanilla CLIP and adaptive robustness above MoAPT's adaptive robustness. The third concerns cost: the matched-compute plot must show at what query volume trained prompts become cheaper than multi-view test-time inference.
If hijacking fails and the frontier stays flat, the defenses' claim of near-free robustness survives a far stronger audit than they have faced so far. If hijacking succeeds, the field needs to evaluate test-time defenses with exact gradients, as diffusion purification now must be.
References
- DiffBreak: Is Diffusion-Based Purification Robust?
- ATAC: Augmentation-Based Test-Time Adversarial Correction for CLIP
- R-TPT: Improving Adversarial Robustness of Vision-Language Models through Test-Time Prompt Tuning
- MetaCloak: Preventing Unauthorized Subject-Driven Text-to-Image Diffusion-Based Synthesis via Meta-Learning
- APBench: A Unified Availability Poisoning Attack and Defenses Benchmark
- Enhancing Adversarial Robustness of Vision Language Models via Adversarial Mixture Prompt Tuning
- Robustness Tokens: Towards Adversarial Robustness of Transformers
- IMPRESS: Evaluating the Resilience of Imperceptible Perturbations Against Unauthorized Data Usage in Diffusion-Based Generative AI
- Proactive Defense Benchmark against Deepfake Generation