Many backdoor defenses rest on one assumption: the trigger is a small, local thing, such as a sticker-like patch or a rare word, that a defense can find and cut out. A backdoor is a hidden rule planted during training that makes a model output an attacker's chosen label whenever a secret trigger appears. Recent attacks break the local-trigger assumption. They shift every pixel's color by a tiny constant (Color Backdoor), bend the whole image with a smooth warp (WaNet), or rotate it slightly (Just Rotate it). These triggers leave no local footprint to find, so patch inversion and region masking fail. Meanwhile, the defenses that do work on Vision Transformers (ViTs, image models that split an image into patch "tokens" and mix them with self-attention) look for tokens that pull too much attention. Those defenses fail once the signal is spread out.
Our proposal moves the localization somewhere else. A global trigger is spread across pixels, but the backdoored model still has to turn that diffuse change into one decision. We hypothesize that it does so through a small number of attention heads, the parallel attention sub-units inside each layer. The trigger changes which tokens these heads attend to, and the rest of the network behaves nearly normally. If that holds, a defender with a frozen model and a few hundred clean images can do two things. First, search a low-dimensional family of global transformations for a candidate trigger. Second, find the heads whose attention changes under that candidate, and at inference replace those heads' attention with a clean reference. This needs no adversarial retraining and touches few parameters, so clean accuracy should barely move.
Core Claim
In backdoored ViTs, non-localized triggers are non-local in input space but local in the model's attention routing. We claim that gating a few percent of attention heads removes most of the attack success rate (ASR, the fraction of triggered inputs sent to the attacker's label) for color, warp, and rotation backdoors. We further claim that this costs under 1% clean accuracy and minutes of frozen-model computation.
The second half of the method is a trigger inversion that searches the right family of transformations. Neural Cleanse searches for the smallest $\ell_1$ patch and misses these attacks entirely, as both WaNet and Color Backdoor report. We instead search over transformations $T_\theta$, where $\theta$ has only tens of dimensions. The family covers a constant offset in each of several color spaces, a warp field built from a few low-frequency basis functions, and a small rotation.
Research Program
Inversion step. For each candidate label $y$, we solve
$$ \min_{\theta}\; \mathbb{E}_{x \sim D_c}\big[\mathrm{CE}(f(T_\theta(x)), y)\big] + \lambda\, \mathrm{LPIPS}(T_\theta(x), x). $$
Here $D_c$ is a small clean set, $f$ is the frozen model, CE is cross-entropy, and LPIPS is a perceptual distance that keeps $T_\theta$ subtle. A backdoored model reaches its target label with an unusually small, perceptually cheap $\theta$. The resulting anomaly across labels plays the role that the anomaly index plays in Neural Cleanse. Because $\theta$ is low-dimensional, the search is cheap and can use gradient-free search, such as the particle swarm method the Color Backdoor attacker itself uses.
Localization step. For every head $h$ in layer $\ell$, we measure how much its attention matrix moves when the inverted trigger is applied:
$$ s_{\ell,h} = \mathbb{E}_{x\sim D_c}\,\big\| A_{\ell,h}(T_{\hat\theta}(x)) - A_{\ell,h}(x) \big\|_1 . $$
This is normalized by the same quantity under random transformations of equal perceptual size. We then rank heads by causal effect: we replace a head's attention with its clean counterpart and record the drop in ASR on the inverted trigger.
Rectification step. At inference we replace the attention maps of the top-$k$ heads with a clean reference. The main candidate reference is the attention map computed on a color-normalized, smoothed copy of the input, which adds one extra forward pass. The cheaper alternative is the average clean attention pattern for that head. The approach follows Dynamic Attention, which showed that swapping an adversarial attention map for a clean one restores text models. We apply it per head and to 2D vision backbones instead of to top-attended tokens.
Mechanistic analysis. We will also test why this might work. Robustness Tokens report that adversarial perturbations act by suppressing "massive activations" (a few unusually large internal values). Liu et al. find that patch attacks pass through an "activated" middle-layer stage. We will check whether global triggers go through the same attention-sink tokens and the same middle layers.
Role of prior work. - Liu et al. motivates the proposal. Their ARMRO defense thresholds per-token attention; its robustness falls to about 55% when the attack is spread across patches, and it cannot see global transforms. Their finding that skipping attention in a single critical layer neutralizes patch attacks is the best existing evidence that routing is concentrated. - AIBA sets a limit on the proposal. It hides a trigger inside naturally attended regions, reaching 99.97% ASR on DeiT-Base with a 0.26% clean drop. Any defense that relies on attention magnitude is therefore suspect. For this reason we score heads by how their attention changes under the inverted trigger, not by how large it is. - ANP supplies the idea that backdoor units are unusually sensitive and can be found with about 1% clean data. We apply that idea to heads under structured input transforms rather than to CNN channels under weight noise.
Baselines
Do-nothing reference. The undefended backdoored model, which gives the starting ASR and clean accuracy.
ANP. Adversarial Neuron Pruning is the strongest existing low-overhead parameter defense. It uses a small clean set and no full retraining. Its reported result on CIFAR-10 CNNs is ASR below 1% in 5 of 6 scenarios with an average clean-accuracy drop of 1.47%. We will port it to ViTs by placing masks on heads and MLP units. It gets the same clean set and a matched tuning budget in GPU-minutes. Beating it means lower ASR at equal or smaller clean drop on ViTs.
ARMRO. ARMRO is the strongest attention-aware, inference-time defense. We run it with its $3\sigma$ threshold and also with a threshold tuned on our clean set.
EBBA+. EBBA+ is the strongest retraining-free detector. It reports poisoned-sample F1 of about 0.95–0.98 on CIFAR-10, GTSRB, and ImageNet subsets, though not on global triggers in ViTs.
Robustness Tokens adapted to backdoors. Robustness Tokens are trained with its invariance loss plus a correction loss on inputs carrying the inverted trigger. This is the strongest frozen-backbone learned alternative. On adversarial noise it holds DINOv2-G clean accuracy at 85.2% versus 85.6%.
Clean fine-tuning. We fine-tune on the same small clean set with the same step budget.
Ablations. We isolate the proposal's key ingredient in three ways. We replace inverted-trigger head selection with random heads, and separately with heads chosen by attention magnitude alone. We replace head rectification with direct input correction using the inverse of $T_{\hat\theta}$. We replace family-based inversion with Neural Cleanse.
Evidence status. No reported result was found on Lacuna for any defense against WaNet or Color Backdoor on ViTs. The comparison therefore has to be run, not quoted.
Why not just…?
Why not just normalize input color statistics? Per-image standardization can plausibly erase a constant RGB offset, and we treat it as a serious threat to the color half of the claim. Two things limit it. The Color Backdoor attacker optimizes offsets in spaces such as LUV, where a constant shift is not constant in RGB. Normalization also does nothing for warps or rotations. We will run per-image normalization in RGB, LUV, and HSV as a baseline. If it matches our method on color triggers, we will narrow the claim to geometric triggers.
Why not just train with heavy color and warp augmentation? Color Backdoor reports that aggressive color augmentation destabilizes training and lowers clean accuracy. WaNet's noise-mode training teaches the model to ignore random warps and respond only to the attacker's field, so generic warps do not cancel it. Augmentation also requires retraining, which the overhead constraint excludes. We include a test-time random-jitter variant anyway.
Why not just unlearn with the inverted trigger? Once $\hat\theta$ is known, fine-tuning on triggered inputs with their correct labels is natural. It is also the clean-accuracy risk that ANP and implicit-hypergradient unlearning describe. We run it at a matched budget. If it ties with head gating on ASR and clean accuracy, the contribution reduces to the inversion step, and we will report it that way.
Why not just mask the most-attended tokens? Generic attention masking drops ImageNet clean accuracy from about 85% to about 75% (Liu et al.). Global triggers also create no outlier tokens to mask.
Proposed Experiments
Setup. We implant backdoors by poisoned fine-tuning of ViT-B/16, DeiT-S, and DeiT-B on CIFAR-10, GTSRB, and a 100-class ImageNet subset. Attacks are Color Backdoor, WaNet, rotation, a dispersed-pixel trigger (Dispersed Pixel Perturbation), and, as an out-of-family stress test, AIBA. We follow BackdoorBench conventions for poisoning rates and metrics. We report ASR, clean accuracy, and defense wall-clock time.
Decisive check: head concentration. We plot ASR removed against the fraction of heads gated. The claim fails if more than 10% of heads are needed to push ASR below 10%.
Decisive check: clean cost. The clean-accuracy drop must stay under 1%, which is below ANP's 1.47%.
Decisive check: adaptive attacker. We add a poisoning-time penalty on the concentration of per-head attention change. We report whether spreading the backdoor across heads forces the attacker to lose ASR or clean accuracy, since that trade is the security argument.
Decisive check: family mismatch. We test on triggers outside the inversion family, such as a non-smooth warp. This measures how much depends on guessing the family and how much the head-level signal carries on its own.
References
- Color Backdoor: A Robust Poisoning Attack in Color Space
- WaNet - Imperceptible Warping-based Backdoor Attack
- Just Rotate it: Deploying Backdoor Attacks via Rotation Transformation
- Improving the Robustness of Transformer-based Large Language Models with Dynamic Attention
- Robustness Tokens: Towards Adversarial Robustness of Transformers
- Understanding and Defending Patched-based Adversarial Attacks for Vision Transformer
- Attention-Imperceptible Backdoor Attacks on Vision Transformers
- Adversarial Neuron Pruning Purifies Backdoored Deep Models
- Energy-based Backdoor Defense without Task-Specific Samples and Model Retraining
- Adversarial Unlearning of Backdoors via Implicit Hypergradient
- Dispersed Pixel Perturbation-Based Imperceptible Backdoor Trigger for Image Classifier Models
- BackdoorBench: A Comprehensive Benchmark of Backdoor Learning