用轻量分类器在生成时擦除有害概念,既安全又不降质。
CGCE: Classifier-Guided Concept Erasure in Generative Models
- 通过文本嵌入分类器检测并修正含不良概念的提示词。
- 对多种图像/视频生成模型有效,抗红队攻击能力达顶尖水平。
- 无需修改模型权重,适合快速部署到现有生成系统中。
大规模生成模型虽能生成高质量图像与视频,但也带来生成有害内容的安全隐患。为缓解此问题,已有概念擦除方法被提出以移除预训练模型中的不良概念,但现有方法仍易受对抗攻击影响,且实现强健擦除常导致对良性概念生成质量下降,形成安全与性能间的权衡难题。为此,我们提出分类器引导的概念擦除框架(CGCE),一种高效、即插即用的方案,可在不修改原始模型权重的前提下,为多种生成模型提供鲁棒的概念擦除能力。CGCE利用轻量级分类器对文本嵌入进行检测与精炼,仅在推理阶段修改不安全的嵌入,从而防止有害内容生成,同时保持模型对良性提示的原有生成质量。大量实验表明,CGCE在抵御多种红队攻击方面达到当前最优水平,且维持了较高的生成实用性,展现出在安全与性能间更优的平衡。我们通过在多种现代文生图(T2I)和文生视频(T2V)模型上的成功应用,验证了其通用性,确立其为安全生成式AI的实用有效解决方案。
原文摘要 · Abstract (English)
Recent advancements in large-scale generative models have enabled the creation of high-quality images and videos, but have also raised significant safety concerns regarding the generation of unsafe content. To mitigate this, concept erasure methods have been developed to remove undesirable concepts from pre-trained models. However, existing methods remain vulnerable to adversarial attacks that can regenerate the erased content. Moreover, achieving robust erasure often degrades the model's generative quality for safe, unrelated concepts, creating a difficult trade-off between safety and performance. To address this challenge, we introduce Classifier-Guided Concept Erasure (CGCE), an efficient plug-and-play framework that provides robust concept erasure for diverse generative models without altering their original weights. CGCE uses a lightweight classifier operating on text embeddings to first detect and then refine prompts containing undesired concepts. By modifying only unsafe embeddings at inference time, our method prevents harmful content generation while preserving the model's original quality on benign prompts. Extensive experiments show that CGCE achieves state-of-the-art robustness against a wide range of red-teaming attacks. Our approach also maintains high generative utility, demonstrating a superior balance between safety and performance. We showcase the versatility of CGCE through its successful application to various modern T2I and T2V models, establishing it as a practical and effective solution for safe generative AI.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。