← Lab /AI/ML

Backdoor triggers map to a linear direction in Vision Transformer activations

A specific linear direction in ViT activations encodes the backdoor trigger and that manipulating this direction modulates the backdoor behavior.

AI/ML arXiv 11 Mar 2026 Measurement Simulation evidence

Published as “Backdoor Directions in Vision Transformers”

Why it matters

The techniques enable practical removal of backdoors from ViTs and provide a lightweight, weight-only detection method for certain stealthy attacks.

Summary

A single linear direction in the residual stream of Vision Transformers governs backdoor behavior; removing this direction via weight orthogonalization cuts attack success rate to below 5% for all but one attack. The direction can be identified using activation steering, and its removal restores clean accuracy with minimal loss. Weight-based detection using alignment scores can reliably flag stealthy attacks like WaNet and BPP, though it fails on patch-based attacks such as TrojanNN. Evidence comes from experiments on 33 models across CIFAR-10, CIFAR-100 and Tiny-ImageNet, but the analysis assumes full knowledge of the trigger.

What they found 2

  1. A single linear direction in the residual stream modulates backdoor behavior across models.

    “Overall, both the steering and orthogonalization results indicate that for each model, a single linear direction in the models’ residual stream modulates backdoor behavior.”

  2. Weight-based detection scores can flag WaNet and BPP backdoors but fail on TrojanNN.

    “WaNet achieves a high score for the correct class across many tested combinations, whereas for SSBA, this fraction is smaller. For TrojanNN, we see no clear indication that the model is backdoored.”

Caveats 3

  • However, especially the CLS-only steering does not always fully increase ASR or increase RA to better levels. While these results suggest that steering is not particularly effective...
  • Concretely, we assume full knowledge of the backdoor trigger and the backdoored training data, as this enables more detailed analyses across multiple datasets and attacks.
  • we refrain from tuning these parameters or steering across multiple layers as our goal is not to optimize steering performance.

What’s new here 4

  • Identifies a single linear backdoor direction in ViT activations, a concept not previously explored for transformers.
  • Demonstrates that orthogonalizing this direction from weight matrices effectively removes the backdoor.
  • Provides layer-wise analysis of how different trigger types propagate through ViT layers.
  • Introduces a simple weight-based detection metric for ViTs that works on stealthy attacks.