CleanSight Kills Vision-Language Backdoors by Targeting Attention, Not Pixels
A training-free defense catches backdoored inputs in vision-language models by watching how trigger patches hijack attention away from the text prompt.
ProTakeaways
- New paper reframes LVLM backdoors as attention stealing, not a pixel-level phenomenon.
- Trigger patches make visual tokens grab attention away from the text prompt in middle fusion layers.
- CleanSight detects poisoned inputs via vision-to-text attention ratios scored against a small clean reference set.
- It then prunes suspicious high-attention visual tokens by adding negative bias to their attention logits.
- ASR drops to near zero across BadNet, Blended, ISSBA, WaNet, TrojVLM, VLOOD on LLaVA, InstructBLIP, Qwen2-VL, Qwen3-VL.
- Fully training-free, plug-and-play at test time, and survives three adaptive attack strategies.
Backdoor attacks on vision-language models usually get treated as a pixel problem. Sneak a tiny patch into an image, poison a few training samples, and the fine-tuned model will spit out attacker-chosen text whenever it sees that patch at inference. The standard defense playbook has been to retrain the poisoned adapter or LoRA weights on clean data, which is expensive and typically hurts downstream accuracy. A new paper argues the whole framing is wrong: the backdoor in a large vision-language model (LVLM) does not really live in the pixels. It lives in the attention weights.
The authors call the mechanism attention stealing, and they use it to build CleanSight, a plug-and-play defense that runs entirely at test time with no retraining. You can read the full write-up on arXiv.
The backdoor is in the attention, not the pixels
The core observation is a clean piece of mechanistic interpretability. In backdoored LVLMs, prior findings show that image tokens typically receive much lower attention than textual ones in the middle layers, but poisoned inputs exhibit a clear reversal: overall visual attention sharply increases while textual attention correspondingly declines, as if the image tokens are stealing attention from the text prompt. The visual tokens receiving abnormally high attention precisely align with the trigger regions, meaning the surge is localized and induced by the trigger tokens themselves.
That reframing has a striking consequence. Existing defenses tuned for models trained from scratch on poisoned data (like ViT or CLIP) mostly perturb pixels to disrupt the trigger-target correlation. But the spurious relationship hidden in backdoored LVLMs is largely insensitive to pixel perturbations and highly fragile to attention perturbations, such as flattening the visual attention weights. When the visual attention weights are fully averaged, the backdoor effect disappears even though the trigger pixels remain intact. Blurring the image barely helps. Smoothing the attention map wipes the backdoor out.

How CleanSight works
CleanSight has two stages, both operating on the fly during a normal forward pass:
- Detect attention stealing. For each attention head in a small window of middle layers (the cross-modal fusion zone), compute the ratio of attention the last query token pays to visual tokens versus prompt tokens. Concatenate these ratios across heads and layers into a feature vector.
- Score against a clean reference. Using a small clean validation set (as few as ~10-200 samples), estimate the per-dimension mean and standard deviation, then flag any input whose whitened L2 distance exceeds a high quantile threshold.
- Selectively prune trigger tokens. If flagged, identify visual tokens that any head attends to abnormally strongly, take the union across heads into a global mask, and add a large negative bias to their attention logits in all subsequent layers. The tokens effectively vanish for the rest of the forward pass and decoding.
The authors follow prior analysis to locate the cross-modal fusion start layer, using layer 10 as the starting point and aggregating 3 layers, with the decision threshold set to 0.99 and a clean validation set of size 200. The pruning threshold is a modest 1e-4 on attention weight.
What the numbers say
The experiments cover LLaVA-1.5 (7B and 13B), InstructBLIP, Qwen2-VL, and Qwen3-VL across sizes from 2B to 32B, on VQAv2, OK-VQA, MSCOCO, and Flickr8k. Six attack types are tested: BadNet, Blended, ISSBA, WaNet, and the LVLM-specific TrojVLM and VLOOD.
CleanSight drives attack success rate to almost zero across all datasets and attacks, even in challenging settings such as global or invisible triggers tightly entangled with the input, while existing pixel-level purification methods only partially reduce ASR. On VQAv2 with BadNet, for example, undefended ASR sits at 100 percent and CleanSight brings it to 0 while keeping the V-score within a fraction of a point of the undefended model. The strongest pixel-based baselines (ST defense, BDMAE, SampDetox, ZIP) leave ASR in the 74-98 percent range on the same setup, and several of them noticeably damage clean utility.
The one attack that gives CleanSight some trouble is TrojVLM, which optimizes a semantic-preserving loss that entangles the backdoor with the clean task and produces only a mild attention shift. ASR still drops from 100 to around 3-5 percent.

Adaptive attackers and where it breaks
The paper explicitly tries to break its own defense. Three adaptive attackers add regularization during backdoor training to (1) push the vision-text attention ratio back toward clean values, (2) directly minimize CleanSight's whitened L2 score, or (3) flatten the visual attention distribution toward uniformity. All three adaptive strategies are largely mitigated by CleanSight. The backdoor mechanism inherently requires redirecting cross-modal attention toward trigger tokens to activate the target output, and this redirection cannot be fully concealed without destroying the backdoor itself.
Limitations worth flagging:
- The method assumes the attacker can only tune adapters or LoRA modules, not the visual encoder or LLM backbone weights (justified by checksum verification against public checkpoints).
- You need a small clean validation set to estimate the reference distribution. Not zero-shot.
- Semantic-preserving attacks like TrojVLM leave a fainter attention footprint and are harder to fully neutralize.
- The defense is specific to LVLMs with an identifiable cross-modal fusion zone in the middle layers. Applying it to a new architecture requires locating that zone via ablation or attribution analysis.
Why this matters
Fine-tuning-as-a-service is a real deployment pattern, and the assumption that a third-party fine-tuned adapter is trustworthy is fragile. What makes CleanSight interesting is not just the numbers but the mechanistic story: backdoors in multimodal transformers are a routing phenomenon in attention, not a texture phenomenon in pixels. That reframes the defense problem from image processing to attention analysis, and it suggests token pruning techniques originally developed for inference speed (FastV, LLaVA-PruMerge) may have a second life as security tools. For teams shipping LVLM inference stacks, this is roughly a hundred lines of hookable code on top of an existing model, with no retraining and negligible impact on clean accuracy.