什么概念在其中?在扩散变换器中检测和抑制危险内容
What Concepts Lie Within? Detecting and Suppressing Risky Content in Diffusion Transformers
AI总结:
本文研究了如何在扩散变换器中检测和抑制危险内容,提出了一种无需训练的推理时安全机制AHV-D&S,通过分析注意力头对概念的敏感性来检测和抑制危险生成倾向,有效压制了性内容、受版权保护的内容及有害内容,同时保持视觉质量。
摘要:
文本到图像(T2I)模型的兴起日益引发了关于生成危险内容(如性、暴力和受版权保护的图像)的担忧,突显了在模型内部需要有效安全措施的必要性。尽管已有方法被提出以消除T2I模型中的危险概念,但它们主要针对早期的U-Net架构,使得最先进的基于扩散变换器(DiTs)的T2I模型缺乏充分保护。这一差距源于根本性的架构转变:扩散变换器(DiTs)通过联合注意力将语义注入和视觉合成结合起来,这使得在生成过程中隔离和消除危险内容变得困难。为了弥合这一差距,我们研究了DiTs中语义概念的表示方式,并发现注意力头表现出对概念的特定敏感性。这一特性使得能够同时检测和抑制危险内容。基于这一发现,我们提出AHV-D&S,一种无需训练的推理时图像生成安全机制。具体而言,AHV-D&S量化每个文本标记在所有注意力头上的敏感性作为注意力头向量(AHV),该向量用作检测危险生成倾向的判别签名。在推理阶段,我们提出了一种基于动量的策略,用于在去噪步骤中动态跟踪标记级别的AHVs,并提出一种基于敏感度的自适应抑制策略,该策略根据头特定的风险分数抑制已识别的危险标记的注意力权重。广泛的实验表明,AHV-D&S有效抑制了性内容、受版权保护的内容以及各种有害内容,同时保持了视觉质量,并进一步表现出对对抗性提示的强鲁棒性和在不同DiT-based T2I模型中的可转移性。
英文摘要:
The rise of text-to-image~(T2I) models has increasingly raised concerns regarding the generation of risky content, such as sexual, violent, and copyright-protected images, highlighting the need for effective safeguards within the models themselves.Although existing methods have been proposed to eliminate risky concepts from T2I models, they mainly focus on the erasure of risk-associated textual or latent representations, limiting their ability to defend against adversarial prompts without explicit risk words, especially in recent Diffusion-Transformer-based T2I models. To bridge this gap, we investigate how semantic concepts activate the generation process within Diffusion Transformers~(DiTs) and discover that attention heads exhibit concept-specific sensitivity. This property enables both the detection and suppression of risky content. Building on this discovery, we propose a training-free inference-time safeguard for image generation in DiTs. Specifically, our method quantifies each textual token's sensitivity across all attention heads as an Attention Head Vector~(AHV), which serves as a discriminative signature for detecting risky generation tendencies. In the inference stage, we propose a momentum-based strategy to dynamically track token-wise AHVs across denoising steps, and a sensitivity-guided adaptive suppression strategy that suppresses the attention logits of identified risky tokens based on head-specific risk scores. Extensive experiments demonstrate that our method effectively suppresses sexual, copyrighted-style, and various harmful content while preserving visual quality, and further exhibits strong robustness against adversarial prompts and transferability across different DiT-based T2I models. These results establish our method as a practical safeguard for the safe deployment of modern T2I models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。