Making an image model hold up against adversarial inputs (tiny, deliberately crafted pixel changes that flip its prediction) usually means adversarial training. In adversarial training the model is retrained on attacks generated against itself at every step. That costs an order of magnitude more compute than ordinary training and tends to lower accuracy on normal images. A cheaper route has recently appeared. Robustness Tokens freezes a large vision transformer and learns only ten extra input tokens in 200 optimization steps. On DINOv2-Giant this keeps clean ImageNet accuracy at 85.2% (versus 85.6%) and raises white-box attacked accuracy from 0.3% to 63.1%. That defense is a single static object trained once against a fixed attack. Its authors say its security depends partly on keeping the tokens secret. Work on deployed security systems, from ad fraud to agent-driven cheating on GPU leaderboards, keeps finding the same pattern: attackers study whatever is deployed and adapt to it.
This note proposes to use the cheapness of token defenses to run the arms race deliberately and offline, as a game. The defender keeps a growing pool of token sets on one frozen backbone and randomizes which set answers each query. Each new token set is trained against the strongest attack on the current pool. The attacker is assumed to know every token set and the randomization probabilities. The central empirical question is whether such a pool beats a single token set given the same parameters and compute, under that fully informed attacker. If it does, the defense adapts to the attacker at a cost of a few hundred token-training steps per round, with no loss of clean accuracy. If it does not, because attacks transfer freely between token sets that share a backbone, we will have a clean negative result bounding what moving-target defenses can do with parameter-efficient modules.
Core Claim
We claim that robustness tokens are cheap enough to act as the pure strategies in a double-oracle game. In a double-oracle game the two sides alternately add a best response to the other's current mix, and then an equilibrium mix is recomputed. We further claim that the equilibrium mixture of token sets over one frozen backbone achieves higher accuracy under an attacker who averages over the whole mixture than any single token set trained with matched compute. The mixture should keep clean accuracy within the roughly half-point gap that Robustness Tokens reports.
Two things make this different from prior work. First, MTDeep already frames defense as a Stackelberg game over a randomized choice among networks. However, its pool members are separate full networks trained in advance, and the pool never grows in response to attacks. Second, MoAPT already mixes several short prompts over a frozen CLIP. However, its mixing weights are a deterministic function of the input, chosen for accuracy. Nothing in it is randomized to defeat an attacker who knows the router, and the prompt set does not grow in response to attacks. Our pool is grown by best responses, weighted by an equilibrium solver, and evaluated against a mixture-aware attacker.
Research Program
The backbone is a frozen DINOv2 or DeiT-III vision transformer with a linear head, as in Robustness Tokens. A defender strategy is a set of $m$ tokens $\phi_j$ appended to the input sequence. It is trained with that paper's two losses. The first is an invariance loss that keeps clean-image features equal to those of the untouched backbone; this is what protects clean accuracy. The second is a correction loss that maps features of attacked images back to the clean features.
The loop starts from one token set $\phi_1$ trained against ordinary projected gradient descent (PGD, the standard iterative attack that repeatedly steps along the loss gradient and clips to an $\ell_\infty$ ball of radius $\epsilon$). At round $k$ the defender holds sets $\phi_1,\dots,\phi_k$ with mixture weights $p$. The attacker then computes a best response to that mixture:
$$\delta^{*}(x)=\arg\max_{\|\delta\|_\infty\le\epsilon}\ \sum_{j=1}^{k} p_j\,\mathcal{L}\big(f_{\theta,\phi_j}(x+\delta),y\big),$$
where $\theta$ is the frozen backbone and $\mathcal{L}$ is cross-entropy. This is the expectation-over-transformation attack, applied to the randomization over token sets instead of over image resizings. The new set $\phi_{k+1}$ is trained with the invariance and correction losses against these attacks, plus a diversity term. The diversity term penalizes the cosine similarity between the input gradient under $\phi_{k+1}$ and the input gradients under the existing sets. It operationalizes MTDeep's "differential immunity": an attack that fools one set should not fool the others.
A payoff matrix records the accuracy of each token set against each round's attack set. A linear program then solves the zero-sum game to update $p$. The loop stops when the new best response no longer lowers the game value.
Three analyses come out of the program. The first is the cross-set transfer matrix. It tells us directly whether a shared frozen backbone forces attacks to transfer, which is the main way the idea could fail. The second is the game value as a function of pool size and total compute, measured in forward-plus-backward passes through the backbone. This is the fair currency for comparing against single-set and full-model training. The third is the clean accuracy of every pool member and of the mixture.
Baselines
The naive reference is the undefended frozen backbone. Robustness Tokens reports 85.6% clean and 0.3% white-box accuracy for it on ImageNet-1k with DINOv2-Giant, and an attacked ADE20K segmentation score (mIoU) of 4.7.
The strongest existing method is a single robustness-token set. It is the closest competitor because it already reaches our efficiency and clean-accuracy targets: 85.2% clean and 63.1% white-box accuracy in that paper's setup. A pool has to beat it on robustness, not on cost. We will run it in two forms. One is the published recipe: 10 tokens and 200 steps. The other is a compute-matched version: one token set with $k\cdot m$ tokens, trained for as many backbone passes as the entire co-evolution loop uses. We will also let it train against the union of all attacks our loop generates. This compute-matched single set is the baseline to beat. The proposal succeeds only if the mixture's accuracy under the mixture-aware attack exceeds it by a margin larger than seed variance across three seeds, with clean accuracy no lower.
A second competitor is a MoAPT-style deterministic router over the same pool, following MoAPT but on the frozen vision transformer. We attack it end to end through the router. It tests whether randomization adds anything beyond input-conditioned mixing. MoAPT reports only gains relative to single-prompt tuning on CLIP (+8.99% PGD, +11.33% AutoAttack, +5.60% clean averaged over 11 datasets), so we will reimplement it on our backbone rather than compare numbers across setups.
The ablations remove one ingredient at a time. The first replaces equilibrium weights $p$ with uniform weights. The second drops the diversity term. The third trains all $k$ sets independently against plain PGD, with no best-response loop. This third one is essentially MTDeep's static pool made cheap, and it isolates whether the co-evolution itself matters.
As an upper reference for robustness and a lower reference for efficiency, we will run full-parameter adversarial training of a smaller vision transformer with the alibaba/easyrobust tooling (easyrobust). We found no reported result on Lacuna for full adversarial training of DINOv2 at this scale.
Why not just…?
Why not just train one bigger token set for longer? This is the most serious threat. If attacks transfer almost perfectly across token sets on a shared backbone, randomization buys nothing against a mixture-aware attacker. In that case a single larger set trained on the pooled attacks should match or beat the mixture. The compute-matched single-set baseline and the cross-set transfer matrix settle this directly. We treat a tie as a real outcome and would report it as evidence that moving-target defense requires diversity in the backbone itself.
Why not just randomize the input, which costs no training? Mitigating Adversarial Effects Through Randomization recovers Inception-v3 accuracy from 1.1% to 98.2% under DeepFool with random resizing and padding, at a clean cost of 100% to 97.3% on its test subset. The same paper notes that an attacker who averages gradients over the transformations (expectation over transformation) weakens it. We run random resizing and padding on our backbone under exactly the mixture-aware attack we apply to our own pool. That gives both randomization schemes the same informed adversary, and it also lets us combine the two.
Why not just precompute a bank of attacks once, as AdvPT does? AdvPT gets a speedup of more than 100 times by generating attacks once against the base encoder, reaching 37.4% under 40-step PGD on Flowers with ViT-B/16. Its bank never sees the defended model, so it cannot anticipate attacks on the defense. Our third ablation, a static pool trained on fixed attacks, is the vision analogue. If it matches the full loop, co-evolution is unnecessary and the cheaper precomputed approach should be preferred.
Proposed Experiments
The main experiment uses ImageNet-1k linear probing on DINOv2 (Base and Giant) and DeiT-III with $\ell_\infty$ radius $\epsilon=4/255$. The loop runs for up to eight rounds with 10 tokens per set. We report clean accuracy and accuracy under the mixture-aware attack: PGD averaged over the mixture, plus AutoAttack with the same averaging. Following Robustness Tokens, a second experiment transfers the pool to ADE20K segmentation with a frozen decoder and reports attacked mIoU against that paper's 23.3.
Because randomized defenses are known to look strong when gradients are merely obscured, three decisive checks are built in. First, attack strength must grow monotonically with the number of attack steps and with the number of mixture samples averaged per step. Second, a transfer attack from a surrogate model trained on the full pool must not outperform the white-box attack. Third, we report the per-draw robustness of the mixture alongside its game value, so that no gain comes from reporting the easier number.
Finally, we test a KernelGuard-style scenario inspired by KernelGuard. An attacker receives only query feedback, meaning the predicted labels, while the defender adds a new token set after every block of queries. We measure whether the pool's accuracy recovers faster than the attacker can adapt, and at what cost in backbone passes per round.
The proposal is confirmed if the equilibrium pool beats the compute-matched single set under the mixture-aware attack, with no clean-accuracy loss, and if the diversity ablation shows that the gain comes from lower cross-set transfer. It is refuted if the transfer matrix is near-uniform and the single set ties the pool.
References
- Robustness Tokens: Towards Adversarial Robustness of Transformers
- Detecting adversarial advertisements in the wild
- We Let Agents Compete and They Tried to Cheat. KernelGuard: Defending GPU Competitions from Adversarial Agentic Systems
- Securing Deep Neural Nets against Adversarial Attacks with Moving Target Defense
- Enhancing Adversarial Robustness of Vision Language Models via Adversarial Mixture Prompt Tuning
- Mitigating Adversarial Effects Through Randomization
- Adversarial Prompt Tuning for Vision-Language Models