Abstract: Despite their impressive capabilities, current Text-to-Image (T2I) models remain prone to generating unsafe and toxic content. While activation steering offers a promising inference-time intervention, we observe that linear activation steering frequently degrades image quality when applied to benign prompts. To address this trade-off, we first construct SafeSteerDataset, a contrastive dataset containing 2300 safe and unsafe prompt pairs with high cosine similarity. Leveraging this data, we propose Conditioned Activation Transport (CAT), a framework that employs a geometry-based conditioning mechanism and nonlinear transport maps. By conditioning transport maps to activate only within unsafe activation regions, we minimize interference with benign queries. We validate our approach on two state-of-the-art architectures: Z-Image and Infinity. Experiments demonstrate that CAT generalizes effectively across these backbones, significantly reducing Attack Success Rate while maintaining image fidelity compared to unsteered generations. Warning: This paper contains potentially offensive text and images.
Introduction
Text-to-Image (T2I) models like Stable Diffusion or Infinity are incredibly powerful but prone to generating unsafe content such as gore, hate symbols, and nudity, even without explicit jailbreak prompts. Current safety interventions typically fall into two categories: output filters, which are inefficient and easily bypassed, and activation steering, which intervenes in the model's internal processing during inference. However, standard activation steering methods often suffer from a Utility-Safety Trade-off. These methods assume that unsafe content exists along a simple linear direction in the model's latent space. When this assumption fails, linear steering acts as a blunt instrument, distorting benign requests and degrading overall image quality.
Methodology: Conditioned Activation Transport (CAT)
We propose Conditioned Activation Transport (CAT) to move beyond linear assumptions and minimize interference with safe prompts through two key innovations:
Non-Linear Transport Maps ($T_\theta$)
Instead of adding a single safety vector, CAT utilizes a Multi-Layer Perceptron (MLP) to learn complex, non-linear mappings. This allows the framework to "morph" or "fold" specific unsafe activations into safe regions without collapsing the entire distribution, even when unsafe activations reside on non-convex manifolds.
Geometry-Aware Conditioning ($C$)
To prevent steering from affecting safe prompts, CAT employs a geometric gate based on the Mahalanobis distance. This measure determines how far a specific activation is from the known unsafe cluster. If an activation falls within the unsafe region, steering is applied; if it is outside (a benign prompt), the gate remains closed ($C=0$), leaving the model's original function untouched.
SafeSteerDataset
To train and evaluate CAT, we introduced the SafeSteerDataset, designed to isolate the toxic dimensions of generative tasks. The dataset consists of 2,300 contrastive prompt pairs (e.g., "A person with a tattoo" vs. "A person with a swastika tattoo") with high semantic similarity (cosine similarity > 0.7). This alignment ensures the steering mechanism learns precisely what to change without affecting unrelated image elements. The dataset covers 23 subcategories across hate, violence, sexual content, illegal acts, and more.
Experimental Results
We evaluated CAT on two state-of-the-art architectures: Z-Image (Diffusion Transformer) and Infinity (Autoregressive model).
- Safety Performance: CAT significantly reduced the Attack Success Rate (ASR). On Z-Image, ASR dropped from 33.91% (unsteered) to 6.96%.
- Utility Preservation: Unlike linear baselines where CLIP scores plummeted, CAT maintained high fidelity. For the Infinity model, CAT achieved a CLIP score of 0.32, nearly identical to the unsteered model's 0.33, while linear methods crashed to 0.16.
- Qualitative Precision: CAT successfully removes specific harmful elements while keeping backgrounds, lighting, and identities consistent.
Conclusion and Future Work
CAT demonstrates that non-linear, conditioned steering is essential for balancing safety and utility in T2I models. While highly effective, current limitations include the use of mean-pooled activations, which might miss localized unsafe features. Future research will explore token-level or region-level conditioning to address these more granular safety violations.
Summary updated