HackerPapers

arXiv:2310.13828cs.CR

Nightshade: Prompt-Specific Poisoning Attacks on Text-to-Image Generative Models

Shawn Shan, Wenxin Ding, Josephine Passananti, Stanley Wu, Haitao Zheng, Ben Y. Zhao

Abstract

Data poisoning attacks manipulate training data to introduce unexpected behaviors into machine learning models at training time. For text-to-image generative models with massive training datasets, current understanding of poisoning attacks suggests that a successful attack would require injecting millions of poison samples into their training pipeline. In this paper, we show that poisoning attacks can be successful on generative models. We observe that training data per concept can be quite limited in these models, making them vulnerable to prompt-specific poisoning attacks, which target a model's ability to respond to individual prompts. We introduce Nightshade, an optimized prompt-specific poisoning attack where poison samples look visually identical to benign images with matching text prompts. Nightshade poison samples are also optimized for potency and can corrupt an Stable Diffusion SDXL prompt in <100 poison samples. Nightshade poison effects "bleed through" to related concepts, and multiple attacks can composed together in a single prompt. Surprisingly, we show that a moderate number of Nightshade attacks can destabilize general features in a text-to-image generative model, effectively disabling its ability to generate meaningful images. Finally, we propose the use of Nightshade and similar tools as a last defense for content creators against web scrapers that ignore opt-out/do-not-crawl directives, and discuss possible implications for model trainers and content creators.

arXiv comments
IEEE Security and Privacy 2024
Journal reference
DOI
Subjects
cs.CRCryptography and Security cs.AIArtificial Intelligence

On Hacker News

Linked by 4 identifiable commenters in 5 comments across 4 threads, from Oct 2023 to Jan 2026. Found in 6 HN submissions from Oct 2023 to Feb 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments4 threads

    • It is kind of unfortunate how people don't actually read the paper but only run with the conclusions, speculating whether this would or would not work. Here's the paper in question: https://arxiv.org/abs/2310.13828 My two cents is that in its current implementation the…

      torginusView on HNParent context

    • What the article doesn't illustrate is that it destroys fine detail in the image, even in the thumbnails of the reference paper: https://arxiv.org/pdf/2310.13828.pdf Also... Maybe I am naive, but it seems rather trivial to work around with a quick prefilter? I don't know if…

      brucethemoose2View on HNParent context

    • Paper is here: https://arxiv.org/abs/2310.13828

      ink404View on HNParent context

    • What the article doesn't illustrate is that it destroys fine detail in the image, even in the thumbnails of the reference paper: https://arxiv.org/pdf/2310.13828.pdf Also... Maybe I am naive, but it seems rather trivial to work around with a quick prefilter? I don't know if…

      brucethemoose2View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.