# Removing Undesirable Concepts in Text-to-Image Diffusion Models with Learnable Prompts

**Authors:** Anh Bui, Khanh Doan, Trung Le, Paul Montague, Tamas Abraham, Dinh Phung  
**arXiv:** [2403.12326](https://arxiv.org/abs/2403.12326)  
**Date:** 2024-03-18  
**Summary page:** https://www.summarizepaper.com/en/paper/2403.12326v2/

## Key points

- Proposal of a novel method to remove undesirable concepts from text-to-image diffusion models by incorporating a learnable prompt into the cross-attention module
- Utilization of a learnable prompt as additional memory to capture knowledge of undesirable concepts and reduce their dependency on model parameters and textual inputs
- Achieving more stable erasure of unwanted content with minimal impact on other concepts compared to state-of-the-art methods
- Outperformance of existing erasure methods in removing undesirable content while preserving unrelated elements, demonstrated through qualitative results
- Discussion on addressing ethical concerns regarding Not-Safe-For-Work (NSFW) content generated by text-to-image generative models by fine-tuning non-cross-attention modules for better effectiveness in erasing unethical content before public release
- Exploration of using CLIP alignment scores as an alternative metric for evaluating erasure performance when detecting artistic style concepts in generated images, highlighting challenges in accurately assessing the presence of artistic styles without pre-trained detectors
- Conclusion emphasizing high flexibility and extensibility of the proposed prompting mechanism for addressing various challenges involving cross-attention layers, such as continual learning
- Future research directions include exploring more complex prompting mechanisms for improved performance in concept erasure tasks

## Summary

In this paper, we propose a novel method to remove undesirable concepts from text-to-image diffusion models by incorporating a learnable prompt into the cross-attention module. Our approach utilizes a learnable prompt as additional memory to capture knowledge of undesirable concepts and reduce their dependency on model parameters and textual inputs. This results in more stable erasure of unwanted content with minimal impact on other concepts. Our method outperforms state-of-the-art erasure methods in removing undesirable content while preserving unrelated elements. We present qualitative results through figures showcasing our method's performance compared to baselines. To address ethical concerns regarding Not-Safe-For-Work (NSFW) content generated by text-to-image generative models, we discuss recent studies that fine-tune non-cross-attention modules for better effectiveness in erasing unethical content before public release. Additionally, we explore using CLIP alignment scores as an alternative metric for evaluating erasure performance when detecting artistic style concepts in generated images. This experiment highlights the challenges of accurately assessing the presence of artistic styles without pre-trained detectors. In conclusion, our proposed prompting mechanism offers high flexibility and can be extended to address various challenges involving cross-attention layers, such as continual learning. Future research directions include exploring more complex prompting mechanisms for improved performance in concept erasure tasks.
