Robust and Generalizable Safety Steering for Text-to-Image Diffusion Transformers
Diffusion Transformers (DiTs) have become the standard for high-quality image generation, but their complex internal structure makes traditional safety measures—like filtering prompts or checking final images—insufficient. Because harmful concepts evolve from text into visual patterns deep within the model, safety interventions must happen inside the model's "brain." This paper introduces SafeDIG, a framework designed to identify the most effective locations within a DiT to intervene and to transfer safety knowledge across different types of risks, ensuring models remain safe even when encountering new, unseen harmful content.
Identifying Where to Intervene
In a DiT, information flows through different stages: from text understanding to cross-modal binding (where text meets image) and finally to rendering. SafeDIG recognizes that a "one-size-fits-all" intervention layer is ineffective. Instead, it uses a "robustness-aware" routing system that analyzes these stages before training. By predicting which intervention sites will remain stable when the model faces new risks, SafeDIG prioritizes the most reliable locations for safety control, moving beyond simple trial-and-error layer selection.
Transferring Safety Knowledge
A major challenge in AI safety is ensuring that a model trained to avoid one type of harm can also avoid others. SafeDIG addresses this by using Sparse Autoencoders (SAEs), which act as a dictionary for safety-related features. The framework separates the "what" (the safety features) from the "where" (the specific way the model renders images). By freezing the encoder—the part that identifies safety features—and only adapting the decoder to the specific target domain, SafeDIG can learn to block new risks without needing to be fully retrained, effectively reusing its safety knowledge.
Steering During Generation
During the actual image generation process, SafeDIG uses two specific operations to keep the model on a safe path. The "Blend" operation gently pulls the model’s internal activations toward a safe, stable state. The "Repel" operation identifies specific "harmful" directions in the model's internal space and pushes the generation process away from them. These techniques allow the model to steer away from unsafe outputs while maintaining the high visual quality and creative flexibility that users expect from modern diffusion models.
Proven Performance
Experiments conducted on powerful models like FLUX.1 Dev and Stable Diffusion 3.5 Large demonstrate that SafeDIG significantly reduces the rate of unsafe image generation. By successfully transferring safety protocols to new, held-out risk categories, the framework proves that it can maintain protection across diverse scenarios. The results show that SafeDIG consistently outperforms existing safety methods, providing a more robust and adaptable way to keep generative AI models aligned with safety standards.
Comments (0)
to join the discussion
No comments yet
Be the first to share your thoughts!