
Share
Researchers have developed SWARM, a sophisticated backdoor attack using a switch token to activate hidden malware in pre-trained vision transformers, posing a serious threat to cloud API users.
A recent paper from a team of researchers at multiple institutions has unveiled a novel security threat targeting pre-trained vision transformers (ViTs). The attack, dubbed SWARM, leverages an extra prompt token known as the "switch token" to covertly activate a backdoor in the model. This stealthy approach poses significant risks, especially for users relying on cloud APIs where such malicious behavior can remain undetected.
The traditional security landscape of machine learning models has been extended to include pre-trained ViTs, which are increasingly popular due to their efficiency and effectiveness in various visual recognition tasks. The researchers have identified a new vulnerability: an attacker can inject a backdoor into a pre-trained model using a switch token. This token acts as a hidden trigger that, when activated, converts the benign model into a malicious one.
For practitioners, this means that even trusted pre-trained models from reputable sources could be compromised. The attack is particularly insidious because it remains dormant until the switch token is used, making it difficult to detect and mitigate. This poses serious risks for applications in security-critical domains like healthcare, finance, and autonomous systems.
Trigger and Token Optimization:
Cross-Mode Feature Distillation:

The researchers tested SWARM on diverse visual recognition tasks and achieved a 95%+ attack success rate. The model's behavior under the benign mode remained indistinguishable from its original performance, making the attack hard to detect and remove.
The discovery of the switchable backdoor attack on pre-trained vision transformers highlights a new front in AI security. Practitioners must remain vigilant and adopt proactive measures to protect against such threats. The research team's code is available for further study, providing a valuable resource for the community to develop countermeasures.
Tags
Original Sources
About the author
Kai built ML infrastructure at a Bay Area startup before developing an obsession with transformer architectures and inference optimisation that eventually pulled him out of product work entirely. A stint at a compute research lab sharpened his instinct for what actually matters in a model release versus what is marketing. He writes from the inside — from the perspective of someone who has debugged the systems he is describing at three in the morning. He is allergic to hype and instinctively drawn to the unglamorous plumbing questions that everyone else skips over.
More from The Engineer →This Week's Edition
21 May 2024
88 articles
Related Articles
Related Articles
More Stories