- The paper introduces online group relative policy optimization to update diffusion models dynamically, reducing unsafe content without catastrophic forgetting.
- It leverages CLIP-based geometric reward steering by shifting unsafe prompt embeddings toward safe anchors, eliminating the need for costly paired data.
- Empirical results demonstrate marked safety improvements, with nudity detections dropping from 646 to as few as 15, while maintaining semantic fidelity and compositional quality.
SafeDiffusion-R1: Online Reward Steering for Safe Diffusion Post-Training
Text-to-image (T2I) diffusion models pretrained on internet-scale datasets reliably propagate unsafe and explicit visual concepts—nudity, violence, harassment—whenever activatable via user prompts. Existing safety interventions for T2I models have major operational limitations: dataset filtering is computationally intractable and incomplete, post-hoc output filtering does not change the underlying generation distribution, and post-training methods (supervised fine-tuning, offline RL) require costly labeled data and are prone to catastrophic forgetting, harming utility on benign prompts. Critically, most prior works use static (offline) training signals or reward models, decoupled from the model’s evolving on-policy behavior, resulting in poor adaptability and limited generalization when confronted with novel (OOD) unsafe categories.
Method: Online Policy Optimization with Geometric Reward Steering
SafeDiffusion-R1 addresses these challenges with two major contributions:
- Online Group Relative Policy Optimization (GRPO): Rather than relying on synthetic or fixed datasets, SafeDiffusion-R1 employs GRPO, updating the diffusion model based on current generations in response to both safe and unsafe prompts. Group-based advantage normalization in GRPO ensures stable credit assignment despite high-variance, prompt-dependent reward magnitudes, avoiding overcorrection and catastrophic forgetting.
- CLIP-based Geometric Reward Steering: Instead of training dedicated safe/unsafe reward models, the method encodes “safety” as a direction in CLIP embedding space—obtained by contrasting mean text embeddings of curated safe and unsafe anchors. For an unsafe prompt, its embedding is steered towards the safe direction before reward computation. Thus, the model is not rewarded for explicit content but for producing images aligned with steered, semantically safer versions of unsafe prompts. This reward manipulation requires only anchor texts and a vision-LLM, not annotated image pairs.
Figure 1: GRPO-based reward steering: unsafe prompt embeddings are steered towards safety anchors before reward computation, aligning generation with safe semantic attributes.
This framework enables safe RL post-training with minimal supervision and robust generalization to unseen unsafe prompt classes.
Empirical Results
SafeDiffusion-R1 delivers strong numerical improvements and makes bold claims regarding OOD safety generalization and utility preservation (as detailed below):
Quantitative Safety Evaluations
Utility and Compositional Generalization
Qualitative Assessment
Qualitative evaluation confirms that SafeDiffusion-R1 not only removes unsafe content but also consistently preserves or improves semantic fidelity and image realism compared to prior methods, which often suffer from over-smoothing, structure collapse, or severe utility loss.
Figure 6: On challenging unsafe prompts, SafeDiffusion-R1 robustly suppresses explicit content while retaining compositional coherence, outperforming leading concept erasure and recent RL safety alignment methods.
Figure 8: Nudity-focused I2P prompt outputs: SafeDiffusion-R1 exhibits both effective suppression and higher visual quality than EraseDiff, ESD-x, and adversarial unlearning baselines.
Ablations and Geometric Analysis
SafeDiffusion-R1 includes detailed ablations:
- Reward design ablations: Pure negative-reward training collapses utility and fails to generalize, while geometric anchor scaling with safe/unsafe anchors and moderate steering strength achieves the best Pareto point on safety–utility tradeoff.
- Schedule robustness: Safety enhancement remains stable and scheduler-agnostic, converging to low unsafe scores regardless of inference sampler.
- Embedding space analyses: UMAP projections confirm that steering increases safety scores monotonically for unsafe prompts without collapsing semantic boundaries between safe and unsafe regions.
Figure 9: UMAP and embedding analyses: Anchor-based steering shifts unsafe prompt clusters into the safe region without collapsing structure, and scores improve with steering strength.
Figure 2: Safety steering geometry: unsafe text embeddings are rotated towards the safe region, reshaping the reward signal for RL without altering model inputs.
Implications and Future Directions
Practically, SafeDiffusion-R1 eliminates expensive requirements for paired data or reward model finetuning, is compatible with publicly released models (e.g., SD v1.4), and supports continuous online safety tuning, making deployment feasible at scale for open platforms.
Theoretically, this work shifts the paradigm from static, external constraint-based alignment to geometric, reward-driven post-training, promising more adaptive, scalable, and generalizable safety alignment in generative models. The embedding-based abstraction of safety could be extended to other modalities and prompt classes, assuming rich enough pre-trained cross-modal models (e.g., recent advances in alignment benchmarking (Alam et al., 24 Nov 2025), interpretability (Wang et al., 5 Feb 2026), and control (Tater et al., 26 Mar 2025)).
Open directions include combinatorial geometric steering for multi-attribute safety, reward model co-adaptation, extending to large-scale vision-language diffusion backbones, and integration with real-time or user feedback driven RLHF pipelines.
Conclusion
SafeDiffusion-R1 demonstrates that online RL with anchor-based geometric reward steering achieves robust safety alignment in T2I diffusion models, delivering both state-of-the-art inappropriate content reduction (down to 18.07% OOD) and improved compositional utility (GenEval +6%). It establishes a scalable post-training template for safety alignment that avoids catastrophic forgetting, requires minimal supervision, and generalizes strongly across harm categories—suggesting a path forward for safe open-domain generative AI deployment (2605.18719).