Models defended against adversarial examples (tiny, deliberately chosen input perturbations that flip predictions) are almost always hardened once, offline, and then deployed as if the world will stay still. It does not. A benchmark of 706 adversarially trained models found that robustness falls by 18 to 31 percent as soon as the data distribution shifts, and extrapolation puts a ceiling near 43 percent on out-of-distribution robustness on ImageNet (OODRobustBench). The usual fix is to retrain adversarially, which multiplies training cost by 10 to 100 times and needs labels. In a live data stream, labels arrive late or never. Robust models therefore decay silently in deployment, and nothing cheap exists to restore them.
This note argues that the robustness half of the problem does not need labels. The robustness tokens of Pulfer et al. are a handful of learnable vectors appended to a frozen Vision Transformer's input. They are trained only to make the network's features under attack match its features on the clean input, so they can be retrained on unlabeled streaming data. We propose a system that watches, without labels, whether the backbone's features are still stable under attack on the current stream. When that stability degrades, it refreshes only the tokens using a single-step attack. The adversarial training budget is spent only when drift has actually made robustness stale.
Core Claim
Robustness under drift can be maintained online at a small fraction of retraining cost. Three conditions make this possible. The object being updated is tiny: roughly 10 tokens, with the backbone frozen. The update objective is label-free feature consistency, so it can run on the raw stream. And the decision of when to update comes from a direct, label-free probe of robustness rather than from input statistics.
The third ingredient is what separates this from simply "running fast adversarial training inside test-time adaptation." A shift in the input distribution does not necessarily damage robustness, and robustness can decay even when a standard input-drift test sees little change. We therefore monitor the quantity we care about. For a small random subsample of each window of the stream, we run a strong multi-step attack on feature similarity. We then apply a sequential exact-interval test to the fraction of samples whose attacked features fall below a similarity threshold. The same probe also catches catastrophic overfitting, the failure mode of single-step adversarial training in which the model learns to fool its own one-step attack. Fast adversarial training normally guards against this with a labeled validation set (Wong et al.), which a label-free stream cannot provide.
Research Program
The system has three parts.
Frozen backbone. We use a DINOv2 backbone with a linear classification head, kept frozen throughout. Robustness tokens are initialized offline with the dual objective from Pulfer et al., who report that on DINOv2-Giant this lifts white-box ImageNet accuracy from 0.3 to 63.1 percent with clean accuracy essentially unchanged.
Online token update. Write $f(x;t)$ for backbone features with tokens $t$ and $f(x)$ for features without tokens. The update minimizes
$$ \mathcal{L}(t)=\mathbb{E}_{x}\big[d(f(x;t),f(x)) + d(f(x+\delta_x;t),f(x))\big], $$
where $d$ is one minus cosine similarity. Each $\delta_x$ is a single signed-gradient step of size $\epsilon$ that maximizes the second term, started from a uniform random point in the $\epsilon$-ball. This random start is the fix for single-step collapse identified by Wong et al.. The expectation runs over the current window mixed with a small, fixed-size replay buffer of past unlabeled inputs, so the tokens do not forget earlier regimes.
Robustness monitor. On $m$ probe samples per window, we run a 10-step feature attack and count failures, meaning cases where similarity drops below $\tau$. We then apply the Clopper-Pearson exact interval to the failure rate. This is the evaluate-then-update logic of Jang et al., whose sequential detector reached 80 percent detection within 190 ImageNet samples at under 1 percent false positive rate. We reuse their statistics but apply them to a robustness quantity rather than to a source-versus-target classifier. When the interval's lower bound exceeds the rate measured on the source distribution, token updates switch on. They switch off once the rate returns to that level.
Analysis. We will measure how much the monitor's trigger lags true robustness decay, and whether single-step token updates ever exhibit catastrophic overfitting that the probe catches. We will also measure the ratio of probe cost to update cost across stream velocities.
Baselines
The naive reference point is the offline-initialized robustness tokens, frozen and deployed across the whole stream. This is exactly what Pulfer et al. evaluate, but only on a static distribution. Beating it means higher white-box robust accuracy, averaged over later stream segments, at equal clean accuracy. A second static reference is an adversarially trained full model evaluated through the same stream, the population OODRobustBench studies.
The strongest competitor on robustness is continuous token updating: the same objective, applied on every batch with no monitor. It isolates whether the monitor earns its place. Both variants get the same backbone, replay buffer, step size, and tuning budget, and we plot robust accuracy against extra GPU-seconds per thousand stream samples. The proposal beats this baseline if it matches continuous updating's robust accuracy within one point while spending substantially less extra compute. It loses if the curves coincide.
The strongest existing method for adapting under drift is a test-time adaptation pipeline, ETA augmented with PTTA purification. PTTA reduces ETA's lifelong degradation from 37.1 to 1.2 percent over 150 environments, and we run it from its released code haiv-lab/ptta on the identical stream. It targets clean accuracy, not worst-case perturbations. Beating it means large robust-accuracy gains under white-box attack while staying competitive on clean accuracy. We also evaluate the combination of PTTA and our tokens, since the two address different failures. There is no reported result found on Lacuna for robust accuracy of any method on a continual ImageNet-C stream.
The key ablation replaces our robustness probe with an input-drift trigger: a Kolmogorov-Smirnov test on projected features, in the incremental form of dos Reis et al., and the sequential classifier test of Jang et al.. Both get matched false-alarm rates. A second ablation drops the random start in the single-step attack to test whether catastrophic overfitting appears online and whether the probe detects it.
Why not just…?
Why not just freeze a robust model and deploy it? OODRobustBench shows robustness drops of 18 to 31 percent under shift for adversarially trained models. That evidence concerns full-model adversarial training, however, and robustness tokens might generalize better. This is a real possibility, and the frozen-token baseline settles it directly. If frozen tokens hold robustness across the ImageNet-C stream, the online component is unnecessary and we will report that.
Why not just update the tokens on every batch? Token-only updates are already cheap, so the monitor might add nothing. On a large backbone, though, each update requires an extra attack forward-backward pass plus the update itself, roughly tripling per-sample cost. Continuous updating also exposes the tokens constantly to whatever the stream contains. The compute-matched comparison above decides the question. We will also report the case where the monitor is not worth it, which is slow streams where compute is not the binding constraint.
Why not just trigger on a standard input-drift detector? Input-drift tests are cheaper than a multi-step probe and already fast (dos Reis et al.). OODRobustBench's finding that out-of-distribution robustness tracks in-distribution robustness linearly hints that shift magnitude may predict robustness loss well. If it does, the cheaper trigger wins, and the ablation is designed to show that. Our hypothesis is that some shifts, such as mild blur, move input statistics a lot but robustness little, while others do the reverse. That would cause input triggers either to waste updates or to miss decay.
Why not just retrain with fast adversarial training when drift is flagged? Fast adversarial training takes 12 hours on ImageNet and relies on labeled attacked validation data for early stopping (Wong et al.), and labels are unavailable in the stream. We include a label-oracle version of this baseline as an upper bound on robustness to quantify what label-free token updates give up.
Proposed Experiments
The main stream is ImageNet-C at severity 5, with the 15 corruptions presented sequentially and then cycled, as in PTTA's lifelong setting. ImageNet-R segments are interleaved to create stylistic shifts. The backbone is DINOv2-Base for the full grid, with DINOv2-Giant for the headline comparison against the numbers reported by Pulfer et al. A smaller CIFAR-10-C stream with a ViT allows cheap sweeps over $\epsilon$, $\tau$, and probe size $m$.
Evaluation labels are used only for scoring, never for adaptation. We report four metrics: white-box robust accuracy under 50-step attacks on the classification loss, applied to the current tokens (which also addresses the concern that tokens act as a secret key); clean accuracy; clean-versus-adversarial feature cosine similarity; and extra compute per thousand samples.
A secondary threat test injects DIA-style contaminated inputs, using inspire-group/tta_risk, into update windows. This checks whether an adversary can steer the tokens, given that Wu et al. reached over 92 percent attack success with 5 percent contamination against standard test-time adaptation.
Three checks decide the question. First, frozen tokens must lose meaningful robustness over the stream; otherwise the premise fails. Second, the monitored system must match continuous updating's robustness at clearly lower compute. Third, the robustness probe must trigger with less lag or fewer wasted updates than input-drift detectors at matched false-alarm rates. If the third check fails, the correct conclusion is a simpler system with an input-drift trigger, and we will report it that way.
References
- OODRobustBench: benchmarking and analyzing adversarial robustness under distribution shift
- Robustness Tokens: Towards Adversarial Robustness of Transformers
- Fast is better than free: Revisiting adversarial training
- Sequential Covariate Shift Detection Using Classifier Two-Sample Tests
- PTTA: Purifying Malicious Samples for Test-Time Model Adaptation
- Fast Unsupervised Online Drift Detection Using Incremental Kolmogorov-Smirnov Test
- Uncovering Adversarial Risks of Test-Time Adaptation