mlsanityData to 14 Oct 2026

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

arXiv 2604.01826 ↗First posted 2 Apr 2026cs.CVcited by 2

On the map: Diffusion models → Robustness, privacy and adversarial aspects

also in 1 more
Abstract (arXiv)

Recent Text-to-Image (T2I) models based on rectified-flow transformers (e.g., SD3, FLUX) achieve high generative fidelity but remain vulnerable to unsafe semantics, especially when triggered by multi-token interactions. Existing mitigation methods largely rely on fine-tuning or attention modulation for concept unlearning; however, their expensive computational overhead and design tailored to U-Net-based denoisers hinder direct adaptation to transformer-based diffusion models (e.g., MMDiT). In this paper, we conduct an in-depth analysis of the attention mechanism in MMDiT and find that unsafe semantics concentrate within interpretable, low-dimensional subspaces at head level, where a finite set of safety-critical heads is responsible for unsafe feature extraction. We further observe that perturbing the Rotary Positional Embedding (RoPE) applied to the query and key vectors can effectively modify some specific concepts in the generated images. Motivated by these insights, we propose SafeRoPE, a lightweight and fine-grained safe generation framework for MMDiT. Specifically, SafeRoPE first constructs head-wise unsafe subspaces by decomposing unsafe embeddings within safety-critical heads, and computes a Latent Risk Score (LRS) for each input vector via projection onto these subspaces. We then introduce head-wise RoPE perturbations that can suppress unsafe semantics without degrading benign content or image quality. SafeRoPE combines both head-wise LRS and RoPE perturbations to perform risk-specific head-wise rotation on query and key vector embeddings, enabling precise suppression of unsafe outputs while maintaining generation fidelity. Extensive experiments demonstrate that SafeRoPE achieves SOTA performance in balancing effective harmful content mitigation and utility preservation for safe generation of MMDiT. Codes are available at https://github.com/deng12yx/SafeRoPE.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Robustness, privacy and adversarial aspects, one of 14 directions in Diffusion models. Builds on 51 of its 60 references that are in the map. First posted on arXiv 2 Apr 2026.

Builds on

51 of 60 references.

Closest ancestors · 22

Same direction, newest first

  1. 2025Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models28 Oct
  2. 2025Responsible Diffusion: A Comprehensive Survey on Safety, Ethics, and Trust in Diffusion Models25 Sep
  3. 2025TAIGen: Training-Free Adversarial Image Generation via Diffusion Models20 Aug
  4. 2025Responsible Diffusion Models via Constraining Text Embeddings within Safe Regions21 May
  5. 2025Silent Branding Attack: Trigger-free Data Poisoning Attack on Text-to-Image Diffusion Models12 Mar
  6. 2025TRCE: Towards Reliable Malicious Concept Erasure in Text-to-Image Diffusion Models10 Mar
  7. 2025Training-Free Safe Denoisers for Safe Use of Diffusion Models11 Feb
  8. 2024EraseAnything: Enabling Concept Erasure in Rectified Flow Transformers29 Dec
  9. 2024Meta-Unlearning on Diffusion Models: Preventing Relearning Unlearned Concepts16 Oct
  10. 2024SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generation16 Oct
  11. 2024Attacks and Defenses for Generative Diffusion Models: A Comprehensive Survey6 Aug
  12. 2024Reliable and Efficient Concept Erasure of Text-to-Image Diffusion Models17 Jul
10 more
  1. 2024Unlearning Concepts in Diffusion Model via Concept Domain Correction and Concept Preserving Gradient24 May
  2. 2024Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models24 May
  3. 2024Jailbreaking Prompt Attack: A Controllable Adversarial Attack against Diffusion Models2 Apr
  4. 2024MACE: Mass Concept Erasure in Diffusion Models10 Mar
  5. 2023One-Dimensional Adapter to Rule Them All: Concepts, Diffusion Models and Erasing Applications26 Dec
  6. 2023Unified Concept Editing in Diffusion Models25 Aug
  7. 2023Forget-Me-Not: Learning to Forget in Text-to-Image Diffusion Models30 Mar
  8. 2023Erasing Concepts from Diffusion Models13 Mar
  9. 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Models9 Nov
  10. 2022Red-Teaming the Stable Diffusion Safety Filter3 Oct

Other references · 29

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
  2. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
  3. 2014Microsoft COCO: Common Objects in Contextcited by 17,608
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  5. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  6. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  7. 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,585
  8. 2022Photorealistic Text-to-Image Diffusion Models with Deep Language Understandingcited by 6,355
  9. 2022Flow Matching for Generative Modelingcited by 5,702
  10. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  11. 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,356
  12. 2021Zero-Shot Text-to-Image Generationcited by 4,288
17 more
  1. 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,181
  2. 2021GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Modelscited by 3,614
  3. 2025FLUX.1 Kontext: Flow Matching for In-Context Image Generation and Editing in Latent Spacecited by 1,006
  4. 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
  5. 2024Evaluating Text-to-Visual Generation with Image-to-Text Generationcited by 474
  6. 2024PixArt-Sigma: Weak-to-Strong Training of Diffusion Transformer for 4K Text-to-Image Generationcited by 329
  7. 2024Direct Unlearning Optimization for Robust and Safe Text-to-Image Modelscited by 50
  8. 2024Talking Heads: Understanding Inter-layer Communication in Transformer Language Modelscited by 41
  9. 2024Infinite Limits of Multi-head Transformer Dynamicscited by 39
  10. 2025ComRoPE: Scalable and Robust Rotary Position Embedding Parameterized by Trainable Commuting Angle Matricescited by 18
  11. 2024Efficient Fine-Tuning and Concept Suppression for Pruned Diffusion Modelscited by 16
  12. 2023Bias A-head? Analyzing Bias in Transformer-Based Language Model Attention Headscited by 14
  13. 2025MMDT: Decoding the Trustworthiness and Safety of Multimodal Foundation Modelscited by 14
  14. 2025RoPECraft: Training-Free Motion Transfer with Trajectory-Guided RoPE Optimization on Diffusion Transformerscited by 14
  15. 2024Cross-Attention Head Position Patterns Can Align with Human Visual Concepts in Text-to-Image Generative Modelscited by 7
  16. 2024Not Just Text: Uncovering Vision Modality Typographic Threats in Image Generation Modelscited by 7
  17. 2024SNP: Structured Neuron-level Pruning to Preserve Attention Scorescited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Beyond the Safety Tax: Mitigating Unsafe Text-to-Image Generation via External Safety Rectification
  2. 2026Introspective Attention Modulation for Safe Text-to-Image Generation
  3. 2026SafeRedir: Prompt Embedding Redirection for Robust Unlearning in Image Generation Models
  4. 2026Safe Few-Step Generation via Velocity Editing
  5. 2025Erased, But Not Forgotten: Erased Rectified Flow Transformers Still Remain Unsafe Under Concept Attack
  6. 2025SafeGuider: Robust and Practical Content Safety Control for Text-to-Image Models
  7. 2026A Hidden Semantic Bottleneck in Conditional Embeddings of Diffusion Transformers
  8. 2026Modular Energy Steering for Safe Text-to-Image Generation with Foundation Models