Asymmetric Bias in Text-to-Image Generation with Adversarial Attacks
Haz Sameen Shahgir, Xianghao Kong, Greg Ver Steeg, Yue Dong
TL;DR
This work analyzes adversarial robustness of Text-to-Image (T2I) models by introducing an entity-swapping objective that targets the CLIP embedding space and reveals a pronounced asymmetry in attack success depending on swap direction. It develops two gradient-based suffix-attack algorithms and evaluates them on Stable Diffusion using the HQ-Pairs and COCO-Pairs datasets, finding that multiple-token perturbations generally outperform single-token edits. The authors introduce probing metrics, including Base Success Rate (BSR) and Baseline Distance Difference ($\Delta_2$), to predict attack success and show that high BSR combined with negative $\Delta_2$ strongly indicates higher ASR, up to around 60% in favorable conditions. These results reveal a bias in T2I models’ internal beliefs that influences vulnerability to adversarial prompts, with implications for safety, robustness, and future research across diverse T2I architectures.
Abstract
The widespread use of Text-to-Image (T2I) models in content generation requires careful examination of their safety, including their robustness to adversarial attacks. Despite extensive research on adversarial attacks, the reasons for their effectiveness remain underexplored. This paper presents an empirical study on adversarial attacks against T2I models, focusing on analyzing factors associated with attack success rates (ASR). We introduce a new attack objective - entity swapping using adversarial suffixes and two gradient-based attack algorithms. Human and automatic evaluations reveal the asymmetric nature of ASRs on entity swap: for example, it is easier to replace "human" with "robot" in the prompt "a human dancing in the rain." with an adversarial suffix, but the reverse replacement is significantly harder. We further propose probing metrics to establish indicative signals from the model's beliefs to the adversarial ASR. We identify conditions that result in a success probability of 60% for adversarial attacks and others where this likelihood drops below 5%.
