Do Robustness Tokens Break the "Robustness on the Line" Ceiling?

Adversarial training makes image classifiers resistant to small, deliberately crafted input changes. It does this by solving a min-max problem: for every training step it first searches for the worst perturbation, then updates the weights against it. Three problems come with it. It is expensive, because each update needs many extra forward and backward passes. It lowers accuracy on ordinary clean images. And its protection does not carry over well to new data distributions. A large benchmark of 706 robust models, OODRobustBench, found that robustness on shifted data is almost a linear function of robustness on the training distribution. It also found that robustness falls 18% to 31% under shift, and that the line extrapolates to only about 43% out-of-distribution robustness on ImageNet even for a model that is perfectly robust in-distribution.

We propose to test a specific way out. Leave a large pretrained vision transformer completely frozen, and buy robustness with a handful of extra learned input vectors, so-called robustness tokens. Robustness Tokens showed that this restores white-box accuracy on DINOv2-Giant from 0.3% to 63.1% at almost no clean cost (85.2% vs. 85.6%) after only 200 optimization steps. Our hypothesis is that the token defense does not overwrite the backbone's features. If so, it should keep the backbone's own tolerance to natural shift, and its out-of-distribution adversarial robustness should sit measurably above the OODRobustBench line rather than on it. We will measure this, fix the known weakness of the token method (it assumes the attacker cannot see the tokens), and add one training change aimed at shifted inputs.

Core Claim

Full adversarial training reshapes every layer. That plausibly explains both the clean-accuracy loss and the tight coupling between in-distribution and shifted robustness. A frozen backbone with an additive token module separates "what the network knows" from "how it resists perturbations." We claim three things. First, token-based defenses, once trained and evaluated against an attacker who knows the tokens, show positive effective robustness, meaning shifted-data adversarial accuracy above the value the OODRobustBench line predicts from their in-distribution robustness. Second, this comes at a small fraction of the compute of full adversarial training. Third, a shift-aware version of the token objective enlarges that margin on held-out shifts without costing clean accuracy.

If the first claim fails and token defenses fall on the same line, that is itself informative. It would mean the line reflects the threat model and data, not the weight-update procedure.

Research Program

The work has three stages.

Stage 1: measurement. We take the original token recipe on DINOv2 (ViT-B, ViT-L, ViT-G), DeiT-III and OpenCLIP backbones with linear heads, as in the original paper. We evaluate it on the OODRobustBench natural-shift and unforeseen-threat suites. This tells us where the method sits relative to the fitted line. The original paper never evaluated it on ImageNet-C, -A, -R, -V2 or -Sketch.

Stage 2: closing the security hole. The original method's security rests on keeping the tokens private. We retrain the tokens with an attacker who differentiates through them. Only the tokens get updated, but each step still needs a projected-gradient attack through the frozen backbone. The cost therefore grows relative to the original 200 steps, and we will report it honestly in GPU-hours against full adversarial training.

Stage 3: the shift-aware objective. Let $g(x;t)$ be backbone features with tokens $t$, let $g(x)$ be the frozen undefended features, and let $s$ be a shift transformation drawn from a training family $\mathcal{S}$. The tokens minimize

$$ \mathcal{L}(t)=d\big(g(x;t),g(x)\big)+\lambda\,\mathbb{E}_{s\sim\mathcal{S}}\,d\big(g(s(x)+\delta^\ast;t),\,g(s(x))\big),\quad \delta^\ast=\arg\max_{\|\delta\|\le\epsilon} d\big(g(s(x)+\delta;t),g(s(x))\big), $$

where $d$ is one minus cosine similarity, $\epsilon$ is the perturbation budget and $\lambda$ weights the two terms.

The design choice is the anchor. Adversarial features of a shifted image are pulled toward the backbone's own features of that shifted image, not toward the clean original. The tokens are asked only to remove the adversarial component, not to undo the shift. This should keep whatever natural-shift tolerance the pretrained backbone already has. To prevent leakage, $\mathcal{S}$ will contain only a subset of ImageNet-C corruption families. Evaluation uses the held-out families plus the natural shifts ImageNet-A, -R, -V2 and -Sketch.

Mechanistic diagnostic. The token paper ties recovery to "massive activations," a few outlier channels in deep layers that act like feature biases. We will measure whether natural shift suppresses these channels the way adversarial noise does. If it does, that would explain any failure of in-distribution tokens to transfer.

Baselines

The naive reference point is the undefended frozen backbone with its linear head. It shows how much clean and shifted accuracy there is to protect, and how completely white-box attacks break it (0.3% on DINOv2-G per the token paper).

The original robustness tokens, trained in-distribution and evaluated both with private tokens and against a token-aware attacker, form the second baseline. The strongest reported number for this method is 63.1% white-box accuracy with 85.2% clean accuracy on DINOv2-G ImageNet-1k. No shifted-data result exists for it in the file.

The strongest existing competitor is the set of fully adversarially trained ImageNet models from the RobustBench zoo, as scored in OODRobustBench. They are the models that define the line. The comparable reported figures are the ~43% extrapolated out-of-distribution ceiling and the 18–31% average robustness gap. No reported per-model ImageNet out-of-distribution robust accuracy for the best checkpoint was found on Lacuna, so we will re-evaluate the top zoo checkpoints ourselves with the identical attack suite. We will use AutoAttack on in-distribution data and on shifted subsamples, plus the five-step multi-margin attack OODRobustBench uses at scale. Beating this baseline means one of two things. Either a token defense achieves positive effective robustness relative to the refitted line, with confidence intervals across backbones excluding zero. Or it matches these models' shifted robust accuracy at higher clean accuracy and an order of magnitude less compute.

A matched-compute baseline adversarially fine-tunes the last transformer blocks, or a low-rank adapter. It gets the same GPU-hour budget, the same token-aware attack strength and the same hyperparameter search size as our method.

Two ablations isolate the key ingredient. The first trains the token-aware version without shifted views ($\lambda$-term on clean $x$ only). The second keeps shifted views but anchors to clean $g(x)$ instead of $g(s(x))$.

Why not just…?

Why not just use an adversarially trained model with extra real data? OODRobustBench reports that extra real data is the most effective lever for shifted robustness, and RobustBench reports the same for clean and robust accuracy. This is a serious alternative. But the same study shows such models still fall on the line, with the ~43% ceiling. Full retraining of billion-parameter backbones is also the cost problem we are trying to avoid. Our comparison against the best zoo checkpoints settles whether tokens offer anything beyond cheapness.

Why not just use the original robustness tokens, since they might already transfer? They might. Stage 1 exists precisely to find out, and if they transfer, that is a publishable measurement. Their reported robustness, however, assumes a private-token attacker. Evaluating the Adversarial Robustness of Adaptive Test-time Defenses shows that defenses evaluated without fully adaptive attacks routinely collapse, for example from 51.02% to 3.7%. So the token-aware result is the number that matters.

Why not just adversarially fine-tune a small adapter or the last few blocks? This is the real threat to the proposal. It also avoids full retraining, and it may reach higher in-distribution robustness. The matched-compute baseline addresses it directly. If adapters sit at or above our effective-robustness margin, the conclusion becomes "small-update defenses break the line." Tokens would then be just one instance, and we would report it that way.

Why not just adapt at test time with batch-statistic re-estimation or entropy minimization? AdaBN and EATA recover accuracy under corruption cheaply, but they do not address per-input adversarial perturbations. Uncovering Adversarial Risks of Test-Time Adaptation shows that 10 poisoned samples in a batch of 200 achieve over 92% attack success on ImageNet-C. We include EATA on the undefended backbone as a reference under both attacks. Tokens instead need no batch and process single images.

Proposed Experiments and Decisive Checks

Datasets. We use ImageNet-1k for clean and in-distribution robust accuracy, at $\ell_\infty$ budget 4/255 and an $\ell_2$ budget following RobustBench. The OODRobustBench natural shifts are ImageNet-C (held-out families only), -A, -R, -V2 and -Sketch, and its unforeseen threat models include other $p$-norms and spatial transforms. ADE20K segmentation serves as a secondary check.

Metrics. We report clean accuracy, in-distribution and shifted robust accuracy, effective robustness as the residual from the OODRobustBench line refit on our own attack suite, mean corruption error following the ImageNet-C benchmark, and total GPU-hours.

Decisive check 1. Do token-aware token defenses show a positive residual from the line across at least three backbones? A zero residual would refute the core claim.

Decisive check 2. Does shift-anchored training raise the residual on held-out shifts relative to the clean-only ablation, while clean accuracy stays within 0.5 points of the undefended backbone? If shift anchoring helps only on the training corruption families, the effect is leakage, not generalization.

Decisive check 3. Does the massive-activation diagnostic predict which shifts the tokens fail on? This would give a mechanistic account rather than a leaderboard entry.