title: TRCE: Towards Reliable Malicious Concept Erasure in Text-to-Image
    Diffusion Models
summary: Recent advances in text-to-image diffusion models enable photorealistic image
  generation, but they also risk producing malicious content, such as NSFW
  images. To mitigate risk, concept erasure methods are studied to facilitate the
  model to unlearn specific concepts. However, current studies struggle to fully
  erase malicious concepts implicitly embedded in prompts (e.g., metaphorical
  expressions or adversarial prompts) while preserving the model's normal
  generation capability. To address this challenge, our study proposes TRCE,
  using a two-stage concept erasure strategy to achieve an effective trade-off
  between reliable erasure and knowledge preservation. Firstly, TRCE starts by
  erasing the malicious semantics implicitly embedded in textual prompts. By
  identifying a critical mapping objective(i.e., the [EoT] embedding), we
  optimize the cross-attention layers to map malicious prompts to contextually
  similar prompts but with safe concepts. This step prevents the model from being
  overly influenced by malicious semantics during the denoising process.
  Following this, considering the deterministic properties of the sampling
  trajectory of the diffusion model, TRCE further steers the early denoising
  prediction toward the safe direction and away from the unsafe one through
  contrastive learning, thus further avoiding the generation of malicious
  content. Finally, we conduct comprehensive evaluations of TRCE on multiple
  malicious concept erasure benchmarks, and the results demonstrate its
  effectiveness in erasing malicious concepts while better preserving the model's
  original generation ability. The code is available at:
  http://github.com/ddgoodgood/TRCE. CAUTION: This paper includes model-generated
  content that may contain offensive material.
paper_authors._id: 67d03821fe8f90f34f04973d
paper_authors.name: Ruidong Chen
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2025-03-11T13:42:30.572Z
paper_authors._id: 6602650e1737e5cd4a8367a6
paper_authors.avatarUrl: /avatars/6c9271879739364fce22ece91412451b.svg
paper_authors.fullname: chendongdong
paper_authors.type: user
paper_authors.user: ddgoodgood
paper_authors._id: 67d03821fe8f90f34f04973e
paper_authors.name: Honglin Guo
paper_authors._id: 67d03821fe8f90f34f04973f
paper_authors.name: Lanjun Wang
paper_authors._id: 67d03821fe8f90f34f049740
paper_authors.name: Chenyu Zhang
paper_authors._id: 67d03821fe8f90f34f049741
paper_authors.name: Weizhi Nie
paper_authors._id: 67d03821fe8f90f34f049742
paper_authors.name: An-An Liu
paper_title: TRCE: Towards Reliable Malicious Concept Erasure in Text-to-Image
    Diffusion Models
paper_summary: Recent advances in text-to-image diffusion models enable photorealistic image
  generation, but they also risk producing malicious content, such as NSFW
  images. To mitigate risk, concept erasure methods are studied to facilitate the
  model to unlearn specific concepts. However, current studies struggle to fully
  erase malicious concepts implicitly embedded in prompts (e.g., metaphorical
  expressions or adversarial prompts) while preserving the model's normal
  generation capability. To address this challenge, our study proposes TRCE,
  using a two-stage concept erasure strategy to achieve an effective trade-off
  between reliable erasure and knowledge preservation. Firstly, TRCE starts by
  erasing the malicious semantics implicitly embedded in textual prompts. By
  identifying a critical mapping objective(i.e., the [EoT] embedding), we
  optimize the cross-attention layers to map malicious prompts to contextually
  similar prompts but with safe concepts. This step prevents the model from being
  overly influenced by malicious semantics during the denoising process.
  Following this, considering the deterministic properties of the sampling
  trajectory of the diffusion model, TRCE further steers the early denoising
  prediction toward the safe direction and away from the unsafe one through
  contrastive learning, thus further avoiding the generation of malicious
  content. Finally, we conduct comprehensive evaluations of TRCE on multiple
  malicious concept erasure benchmarks, and the results demonstrate its
  effectiveness in erasing malicious concepts while better preserving the model's
  original generation ability. The code is available at:
  http://github.com/ddgoodgood/TRCE. CAUTION: This paper includes model-generated
  content that may contain offensive material.
paper_ai_summary: TRCE employs a two-stage strategy to effectively erase malicious concepts from text-to-image diffusion models while preserving normal generation capabilities.
paper_ai_keywords: diffusion models text-to-image photorealistic image generation concept erasure malicious content NSFW images cross-attention layers denoising process contrastive learning sampling trajectory metaphorical expressions adversarial prompts