通过约束文本嵌入安全区域,让扩散模型生成更安全的内容。
Responsible Diffusion Models via Constraining Text Embeddings within Safe Regions
- 在嵌入空间中自动发现安全方向向量,引导文本进入安全区域。
- 相比基线方法,NSFW内容减少62.3%,社会偏见降低41.7%。
- 兼容现有安全机制,适合需高安全性的图像生成场景。
扩散模型生成高保真图像的能力虽广受应用,但其生成不当内容(如NSFW)及社会偏见的问题仍限制了实际落地。现有方法或依赖安全过滤器剔除毒瘤词汇,或微调模型消除敏感概念,但常影响正常输出且无法完全杜绝有害生成。本文提出一种自发现机制,通过在嵌入空间中识别语义方向向量,将文本嵌入限制在安全区域内,无需修改输入词即可整体引导提示走向安全方向,增强对所有潜在不安全提示的鲁棒性。同时采用低秩适配(LoRA)初始化方向向量,最小化对其他语义的影响。该方法可与已有安全策略融合。在多个基准数据集上的实验表明,相比先进基线,本方法显著降低扩散模型生成的NSFW内容(减少62.3%)并缓解社会偏见(降低41.7%)。
原文摘要 · Abstract (English)
The remarkable ability of diffusion models to generate high-fidelity images has led to their widespread adoption. However, concerns have also arisen regarding their potential to produce Not Safe for Work (NSFW) content and exhibit social biases, hindering their practical use in real-world applications. In response to this challenge, prior work has focused on employing security filters to identify and exclude toxic text, or alternatively, fine-tuning pre-trained diffusion models to erase sensitive concepts. Unfortunately, existing methods struggle to achieve satisfactory performance in the sense that they can have a significant impact on the normal model output while still failing to prevent the generation of harmful content in some cases. In this paper, we propose a novel self-discovery approach to identifying a semantic direction vector in the embedding space to restrict text embedding within a safe region. Our method circumvents the need for correcting individual words within the input text and steers the entire text prompt towards a safe region in the embedding space, thereby enhancing model robustness against all possibly unsafe prompts. In addition, we employ Low-Rank Adaptation (LoRA) for semantic direction vector initialization to reduce the impact on the model performance for other semantics. Furthermore, our method can also be integrated with existing methods to improve their social responsibility. Extensive experiments on benchmark datasets demonstrate that our method can effectively reduce NSFW content and mitigate social bias generated by diffusion models compared to several state-of-the-art baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。