Introduction
Generating adversarial examples against black-box AI models typically requires thousands of queries to estimate gradients, making them impractical for real-world systems with strict rate limits. This paper introduces SWITCH, a remarkably simple yet effective attack strategy. By leveraging the gradient of a local "surrogate" model and simply flipping its direction when it fails to increase the attack loss, SWITCH achieves state-of-the-art success rates with unprecedented query efficiency.
The Challenge of Black-Box Attacks
In a black-box scenario, attackers lack access to the target model's internal weights and must rely solely on output scores. Existing approaches generally fall into three categories:
- Gradient Estimation: Methods like Random Gradient-Free (RGF) query the model thousands of times to estimate gradients, which is slow and easily detected.
- Random Search: These are query-efficient but ignore structural information, leading to slow optimization.
- Transfer-based Attacks: These use a local surrogate model's gradient. While query-free, they often fail because the surrogate's gradient may not align with the target model's loss landscape.
The authors address a core question: How can we exploit surrogate gradients, correct them when they are misaligned, and minimize target model queries to an absolute minimum?
The SWITCH Algorithm
The core of the proposed method is the assumption that Deep Neural Networks (DNNs) are locally approximately linear. If moving in the direction of a surrogate gradient $\hat{g}$ decreases the loss, moving in the opposite direction $-\hat{g}$ is likely to increase it.
Base SWITCH
In each iteration, the attacker takes a step along the surrogate gradient $\hat{g}$. If the target model's loss increases, the step is accepted. If not, the algorithm "switches" to the exact opposite direction $-\hat{g}$. This logic ensures a maximum of only 2 queries per iteration.
SWITCH$_{RGF}$ Extension
To prevent the attack from stalling when both $\hat{g}$ and $-\hat{g}$ fail, the authors introduce a fallback mechanism. If neither direction works, the algorithm employs a batch of queries to perform a standard RGF estimation, ensuring the optimization continues toward a successful adversarial example.
Experimental Evaluation
The authors evaluated SWITCH on CIFAR-10, CIFAR-100, and TinyImageNet against seven state-of-the-art query-based attacks, including Bandits, SignHunter, and Square Attack.
Key Results
- Unmatched Efficiency: In untargeted $L_2$ attacks on CIFAR-10, the base SWITCH algorithm achieved a >90% success rate with a median of just 14 to 67 queries—orders of magnitude fewer than competing methods.
- Dominance in Low-Budget Scenarios: SWITCH significantly outperforms other methods when the query budget is restricted (e.g., < 1,000 queries), making it particularly dangerous for API-based models with rate limits.
- Robustness Against Defenses: Interestingly, the base SWITCH algorithm often outperformed its RGF-augmented version against defensive models like ComDefend, as RGF is more susceptible to "obfuscated gradients" introduced by such defenses.
Conclusion
SWITCH demonstrates that complex gradient estimation isn't always necessary for effective black-box attacks. By simply checking a surrogate gradient and its negation, attackers can achieve high success rates with minimal queries. While the base algorithm can plateau if it gets stuck, the SWITCH$_{RGF}$ variant provides a robust path to near 100% success. This work sets a new, simple, and strong baseline for future research into query-efficient adversarial attacks.
Summary updated