TL;DR
This paper demonstrates that safety representations share a common geometric structure across entirely different AI models, allowing a "safety direction" learned in a text LLM to be transferred directly to image and video generators. By aligning the models using only benign, safe data, the authors successfully suppress harmful visual generations at inference time without ever exposing the target model to unsafe content during training.
What Problem Does This Paper Address?
As generative models for images and videos grow more powerful, controlling their safety (e.g., preventing the generation of violence, hate, or explicit content) has become a critical challenge. Currently, safety alignment is highly model-specific, requiring researchers to retrain or fine-tune each new architecture using curated datasets of harmful content.
Collecting, storing, and processing toxic data for every new model is risky, legally fraught, and highly inefficient. This paper tackles a fundamental question: Is safety a portable latent concept? If different models share a similar internal geometry for high-level concepts, we should be able to learn a safety mechanism once in a source model (like a text LLM) and reuse it across completely different target models (like text-to-image diffusion models) without needing any target-side unsafe data.
Methods
The authors introduce a framework for cross-model safety steering that operates in four main steps:
- Source Safety Direction Estimation: They take a source LLM (e.g., Llama 3.1) and feed it pairs of contrastive prompts (one safe, one unsafe, differing by only a single attribute, like "a man lying on the sidewalk" vs. "a bloodied corpse lying on the sidewalk"). By subtracting the internal activations of the unsafe prompt from the safe prompt and averaging these differences, they isolate a vector representing the "safety direction" ($v_s$).
- Cross-Model Alignment: To map this vector from the source LLM to a target visual generator, they learn a lightweight transformation ($T_{s \to t}$) using a set of shared, purely benign anchor prompts (e.g., standard captions from COCO or WikiText). Crucially, no unsafe data is used here. They experiment with three mapping types: Orthogonal Procrustes via SVD (rigid rotation), Ridge Regression (linear mapping with scaling), and a small MLP (mildly non-linear).
- Magnitude Calibration: Because different models operate at different activation scales, they decouple the direction from the scale, normalizing the transferred vector based on the median activation norms of the benign anchors.
- Target-Side Steering: At inference time, they add this calibrated safety vector to the target model's text encoder activations, scaled by a steering strength parameter ($\alpha$).
They also introduce a Multi-Category Steering variant, which extracts separate vectors for specific harms (e.g., hate speech vs. sexual content) to allow for more granular control.
Datasets
- Safety Vector Estimation: SafeSteerDataset (1,000 semantically matched safe-unsafe prompt pairs across 6 safety categories).
- Cross-Model Alignment: A custom set of 27,000 benign textual samples aggregated from WikiText, COCO, and Flickr.
- Evaluation Benchmarks:
- I2P (Image-to-Prompt) benchmark (4,703 prompts across 7 inappropriate content categories) for text-to-image safety.
- MMA-Diffusion (1,000 prompts) for adversarial safety testing.
- T2VSafetyBench (286 prompts) for text-to-video safety evaluation.
- LAION-5B subsets (5,000 safe prompts for image, 300 for video) to evaluate whether steering degrades general generation quality (utility).
Key Insights and Ideas
- Validation of the Platonic Representation Hypothesis: The fact that a safety vector can be cleanly mapped from a text-only LLM to a text-to-video diffusion model suggests that sufficiently capable models naturally converge toward a shared internal understanding of abstract concepts like "harm."
- Unsafe Data is a One-Time Requirement: You do not need to collect toxic images or videos to secure a visual generator. You can inherit the safety boundaries established by text models, using safe data as the bridge.
- Linear Mappings Suffice: Simple linear transformations (like SVD and Ridge Regression) perform remarkably well compared to non-linear MLPs. This indicates that the geometric relationship between the latent spaces of different models is highly structured and largely linear.
Key Results
- Substantial ASR Reduction: On the Flux1-Schnell image generator, transferring a safety direction from a Llama 3.1 source model using SVD alignment slashed the Attack Success Rate (ASR) from 30.7% down to 3.8%. On Z-Image-Turbo, it brought the ASR down to 0.1% on MMA-Diffusion prompts.
- Comparable to Native Oracles: The transferred safety directions achieved safety-utility trade-offs (measured via CLIP similarity and FID scores) comparable to a "native" safety vector calculated directly on the target model using target-side unsafe data.
- Cross-Modality Success: The framework successfully extended to text-to-video generation. When steering the Wan2.2 video model, the transferred vector dropped the ASR from roughly 75% to 7%.
Limitations and Future Work
- Text-Conditioning Bottleneck: The intervention occurs entirely within the text encoder space. While effective at blocking prompt-driven harms, it does not alter the downstream visual generation weights, meaning it might not prevent safety bypasses that exploit the image decoder directly.
- The Safety-Utility Trade-off: As steering strength ($\alpha$) increases, safety improves, but it can occasionally result in over-refusal or minor drops in image quality/prompt fidelity for benign prompts.
- Scope Constraints: The study was limited to English prompts and a specific subset of open-source models. Future work will need to verify if these shared safety geometries hold true across different languages, cultural contexts, and proprietary closed-source models.
Summary updated