[Paper Review] Red-Teaming the Stable Diffusion Safety Filter
The paper reverse-engineers Stable Diffusion’s safety filter, showing it mainly blocks sexual content while neglecting violence, and argues for open, well-documented safety measures.
Stable Diffusion is a recent open-source image generation model comparable to proprietary models such as DALLE, Imagen, or Parti. Stable Diffusion comes with a safety filter that aims to prevent generating explicit images. Unfortunately, the filter is obfuscated and poorly documented. This makes it hard for users to prevent misuse in their applications, and to understand the filter's limitations and improve it. We first show that it is easy to generate disturbing content that bypasses the safety filter. We then reverse-engineer the filter and find that while it aims to prevent sexual content, it ignores violence, gore, and other similarly disturbing content. Based on our analysis, we argue safety measures in future model releases should strive to be fully open and properly documented to stimulate security contributions from the community.
Motivation & Objective
- Motivate safety concerns for open ML model releases and the need for robust, transparent safety features.
- Demonstrate that the Stable Diffusion safety filter is obfuscated and easily bypassed.
- Identify the limitations of the current safety mechanism, especially its focus on sexual content over violence or gore.
- Propose best practices for open documentation and vulnerability disclosure in ML safety features.
Proposed method
- Infer the safety filter’s workflow from public code by tracing CLIP-based embedding comparisons.
- Describe the 17 unsafe and 3 special-care concepts used by the filter and how thresholds operate.
- Show that a prompt-dilution strategy can bypass the filter without knowledge of the explicit concepts.
- Use a dictionary attack to recover the obfuscated concept embeddings and their text prompts.
- Demonstrate that the filter is biased toward sexual content and ignores violence, gore, and other non-sexual risks.
- Advocate for open safety documentation and vulnerability disclosure practices.
Experimental results
Research questions
- RQ1Does Stable Diffusion’s safety filter reliably detect and block explicit sexual content?
- RQ2Are there systematic blind spots in the filter, such as violence or gore, that remain unblocked?
- RQ3Can the hidden safety concepts be recovered or reverse-engineered to understand the filter’s true coverage?
- RQ4What governance and security practices best support safer open ML model releases?
Key findings
- The safety filter can be bypassed to generate explicit content using prompt dilution.
- The filter focuses on sexual content and neglects violence, gore, and other disturbing content.
- Simple dictionary attacks can recover most of the 17 unsafe concepts, revealing obfuscation in the embeddings.
- There is a two-tier filtering mechanism with special care concepts that lowers thresholds for the main concepts, which is vulnerable and undocumented.
- Prompt engineering and biased CLIP latent-space associations can cause false positives and negatives, including mislabeling non-SFW content as unsafe.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.