Not All Prompts Are Safe: A Switchable Backdoor Attack Against Pretrained Vision TransformersNot All Prompts Are Secure: A Switchable Backdoor Attack Against Pre-trained Vision Transformers
The researchers propose SWARM, a switchable backdoor attack against the "pretrain, then prompt" paradigm: adding a switch token to the prompt switches a benign vision Transformer into backdoor mode, and a specific trigger then forces the model to predict the target class, with an attack success rate above 95% in experiments. The method jointly optimizes the trigger and the prompt tokens, including the switch token, via a clean loss and a backdoor loss, and uses cross-modal feature distillation to reduce the switch token's impact on clean samples. Because the malicious behavior cannot be activated or detected in benign mode, the attack is highly stealthy against cloud API users and difficult to detect and remove. Code is open-sourced at https://github.com/20000yshust/SWARM。