Text to image models catch unsafe prompts early to prevent bad content

When Guidance Becomes a Guard: Early Interception of Unsafe Inputs in Text-to-Image Generation

Computer Vision and Pattern Recognition

Summary

Text-to-image AI models sometimes create unsafe or troubling pictures based on the words given to them, and current systems only check the final images to block bad content. This paper shows that by looking at certain signals inside the AI while it is still creating the image, it’s possible to catch unsafe prompts much earlier. The authors propose a method that uses differences in the AI’s behavior with and without guidance to spot risky inputs before the image is even finished. This approach works well on many models and cuts down the time spent on making unsafe images.

What this means in practice

  • For ai developers: Reduce time and resources wasted on generating unsafe images by intercepting risky inputs early in the generation process.
  • For content moderation teams: Improve safety systems by integrating early warning signals from AI generators to block unsafe content before full image output.

Authors

Yanchun Li, Yujin Wu, Gangkai Shen, Ming Yang, Li Zeng, Xianlong Wang, Hangtao Zhang, Shujuan Tian

Abstract

Text-to-image diffusion models can produce unsafe content, while output filtering intervenes only after synthesis. We investigate whether native generation signals enable early detection of unsafe and adversarial inputs. We find that classifier-free guidance exposes strong safety signals in conditional responses, accessible through compact statistics and linear readouts. Based on this finding, we propose Conditional Semantic Trajectory Interception (CSTI), which aggregates activation contrasts between conditional and unconditional responses at early checkpoints for calibrated risk detection. CSTI fits concept-specific detectors using canonical concept and safe examples, without attack samples, intermediate image decoding, or generator modification. Across five generators, four adversarial attack collections, and two general NSFW datasets, CSTI achieves the strongest overall performance among six baselines at a matched 5% FPR. Early interception reduces generation latency by over 60% on intercepted paths. These results demonstrate the effectiveness of native conditional responses for early safety interception.