Sculpting Memory: Multi-Concept Forgetting in Diffusion Models via Dynamic Mask and Concept-Aware Optimization

Gen Li, Yang Xiao, Jie Ji, Kaiyuan Deng, Bo Hui, Linke Guo, Xiaolong Ma

TL;DR

This paper introduces a novel framework, "Sculpting Memory," for effectively removing multiple concepts from diffusion models without degrading overall performance. It achieves this through a "Dynamic Mask" that adaptively updates model weights and a "Concept-Aware Loss" that guides the unlearning process towards semantically meaningful alternatives.

What Problem Does This Paper Address?

Text-to-image diffusion models have become incredibly powerful, but their ability to store vast amounts of knowledge raises concerns. Scenarios like removing copyrighted content, mitigating biases, or eliminating harmful imagery necessitate selective "unlearning" – erasing specific concepts while preserving the model's general capabilities. Existing unlearning methods often struggle with multi-concept unlearning, where multiple concepts need to be forgotten simultaneously or sequentially. This can lead to concepts reappearing, generation quality degradation, and a lack of semantic consistency in the outputs. The core challenge is to achieve stable and effective multi-concept forgetting without compromising the model's ability to generate diverse and coherent images for other concepts.

Methods

The proposed framework, "Sculpting Memory," comprises two main innovations:

  • Dynamic Mask: This mechanism adaptively updates gradient masks during training. Instead of using static masks, it dynamically adjusts which weights are updated based on the current optimization state. This allows for selective weight modifications, preventing interference with unrelated knowledge and adapting to the evolving unlearning task over time. It's inspired by dynamic sparse training techniques.
  • Concept-Aware Loss: This loss function has two key components:
  • Forgetting Loss: This goes beyond simply erasing a concept. It guides the model to generate semantically meaningful alternatives by aligning the output with the superclass of the forgotten concept (e.g., unlearning "tench" and guiding towards "fish").
  • Regularization Loss: Based on knowledge distillation, this loss ensures that previously unlearned concepts remain forgotten, especially during sequential unlearning. A checkpoint of the model after a prior unlearning step acts as a fixed "teacher" to guide the current model.

The overall training objective combines these losses with the standard diffusion model loss.

Datasets

  • Imagenette: Used for multi-concept unlearning experiments. It's a subset of ImageNet containing 10 classes.
  • I2P (Inappropriate Image Prompts) dataset: Used for NSFW (Not-Safe-For-Work) concept unlearning.
  • MS-COCO: Used for evaluating overall generative capability (FID and CLIP scores) after unlearning.

Key Insights and Ideas

  • Adaptive Unlearning is Crucial: Static approaches to unlearning fail when dealing with multiple concepts due to complex interdependencies. A dynamic, adaptive strategy for modifying model weights is essential for stable multi-concept forgetting.
  • Beyond Erasure: Semantic Replacement: Simply removing a concept can lead to meaningless outputs. Guiding the model to replace forgotten concepts with semantically related alternatives (like superclasses) is key to maintaining output quality and prompt integrity.
  • Preventing Relearning: Sequential unlearning is a significant challenge. The proposed regularization loss, acting as a knowledge distillation mechanism, effectively prevents previously forgotten concepts from resurfacing.
  • Balancing Forgetting and Preservation: The framework demonstrates a strong ability to balance thorough forgetting with the preservation of unrelated concepts and overall generation quality, a common trade-off in existing methods.

Key Results

  • Superior Forgetting Effectiveness: The proposed method achieves the lowest "Total Accuracy" (a metric indicating forgetting effectiveness) across various multi-concept unlearning scenarios (10-class, 6-class, 3-class) on the Imagenette dataset, outperforming existing methods like FMN, AC, ESD, SalUn, MACE, and SPM.
  • High Output Fidelity and Semantic Coherence: The method maintains competitive CLIP scores, indicating that generated images remain semantically aligned with prompts. Visual results show coherent images, unlike the noisy or chaotic outputs from some baselines.
  • Effective NSFW Unlearning: On the I2P dataset, the framework achieves the lowest total NSFW detection count while maintaining strong FID and CLIP scores, demonstrating effective removal of inappropriate content without significantly compromising generation quality.
  • Ablation Studies: Dynamic masking was shown to be critical for effective multi-concept forgetting. The regularization loss was found to stabilize the unlearning process and prevent concept relearning.

Limitations and Future Work

  • Limitations: While the paper demonstrates strong performance, the authors acknowledge that the framework's effectiveness is evaluated on specific datasets and model architectures (Stable Diffusion v1.4). Further testing on diverse models and datasets would be beneficial. The paper also mentions that some methods struggle with "adversarial attacks" to reintroduce concepts, suggesting a need for more robust unlearning.
  • Future Work: The authors aim to extend unlearning to hierarchical and compositional concepts for finer control over forgetting specific attributes while retaining related general concepts. They also plan to explore defenses against adversarial attacks to ensure secure and irreversible unlearning.

Summary updated

BibTeX
@inproceedings{li2025sculpting,
  author = {Gen Li and Yang Xiao and Jie Ji and Kaiyuan Deng and Bo Hui and Linke Guo and Xiaolong Ma},
  title = {{Sculpting Memory: Multi-Concept Forgetting in Diffusion Models via Dynamic Mask and Concept-Aware Optimization}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure