Skip to content

SafeRoPE: Risk-Specific Head-Level Embedding Rotation for Safe Generation with Rectified Flow TransformersSafeRoPE: Risk-specific Head-wise Embedding Rotation for Safe Generation in Rectified Flow Transformers

arXiv· arXiv:2604.01826· Xiang Yang, Feifei Li, Mi Zhang, Geng Hong, Xiaoyu You, Min Yang·Indexed by this site · 25 days ago· Originally publishedDefenses
AI summary

Researchers propose SafeRoPE, a lightweight safe generation framework for MMDiT-architecture text-to-image models (such as SD3 and FLUX), which suppresses unsafe content and preserves generation fidelity through risk-specific head-level embedding rotation. Existing concept-erasure methods that rely on fine-tuning or attention modulation are computationally expensive and designed for U-Net denoisers, making them difficult to transfer directly to such models. After analyzing the MMDiT attention mechanism, the authors found that unsafe semantics are concentrated in a head-level interpretable low-dimensional subspace, extracted by a limited set of safety-critical heads, and that perturbations applied to the query and key vectors via Rotary Positional Embedding (RoPE) can modify specific concepts in generated images. Based on this, SafeRoPE decomposes unsafe embeddings within safety-critical heads to construct a head-level unsafe subspace, computes a Latent Risk Score (LRS) for input vectors through projection, and combines head-level RoPE perturbation to perform risk-specific rotation, suppressing unsafe outputs without harming benign content and image quality.

Read originalarxiv.org