Nightshade: A Prompt-Targeted Poisoning Attack Against Text-to-Image ModelsNightshade: Prompt-Specific Poisoning Attacks on Text-to-Image Generative Models
Translation in progress — untranslated text is omitted.
University of Chicago researchers proposed Nightshade, a prompt-specific poisoning attack against text-to-image diffusion models; on Stable Diffusion SDXL, fewer than 100 poisoned samples are enough to fully manipulate the output of a specific prompt, for example only 50 optimized samples can with high probability make the car in the prompt generate a cow. The attack exploits the concept sparsity of training data: a single concept usually corresponds to only a few thousand samples among billions of training samples; poisoned images, after feature-space perturbation, are visually indistinguishable from normal images and can evade manual and automated detection. The poisoning effect spreads to related concepts, e.g., poisoning fantasy art also affects dragon and the painter Michael Whelan; after poisoning 250 concepts simultaneously on SDXL, the model's CLIP alignment score is below 0.24 and FID exceeds 39.6, and its overall generation capability approaches outputting random noise. After cross-model transfer, the attack's CLIP attack success rate still exceeds 72%, and it can resist defenses such as high-loss filtering and frequency analysis.
- Text-to-image diffusion models are considered immune to data poisoning because of their enormous training data; traditional attacks require poisoning about 20% of the training set. The authors argue that training samples associated with a specific concept are actually few (concept sparsity), so prompt-specific poisoning may be feasible.
- Proposes Nightshade: select high-activation prompts for a target concept, use an open-source model to generate anchor images of target concept A, then apply a guided perturbation to natural images of C so that their features are close to the anchor images, generating stealthy poisoned samples.
- The authors report that Nightshade succeeds with about 100 samples on four models, with ASR above 84% at 200 samples; the poisoning effect bleeds through to related concepts, and poisoning 250 concepts can cripple SD-XL's overall generation capability; it resists all four defenses.
- The authors note that the cause of the overall performance degradation is left for future work, and that customized alignment filters and coordinated deployment by multiple attackers are unexplored. The experiments cover 4 open-source models and 121 concepts, and were not tested on closed-source models such as Midjourney.
Text-to-image models are often considered difficult to poison; the paper uses concept sparsity to show that a small number of carefully constructed samples can distort the generation results for a specific concept.
Related papers
- Localizing Concepts in Visual Autoregressive ModelsAnalysis / interpretabilityarXiv