Leveraging Catastrophic Forgetting to Develop Safe Diffusion Models against Malicious Finetuning

Jiadong Pan, Hongcheng Gao, Zongyu Wu, Taihang Hu, Li Su +2 more
2/3/2026

No confident code implementation found for this paper.

Abstract

Diffusion models (DMs) have demonstrated remarkable proficiency in producing images based on textual prompts. Numerous methods have been proposed to ensure these models generate safe images. Early methods attempt to incorporate safety filters into models to mitigate the risk of generating harmful images but such exter-nal filters do not inherently detoxify the model and can be easily bypassed. Hence, model unlearning and data cleaning are the most essential methods for maintaining the safety of models, given their impact on model parameters. However, malicious fine-tuning can still make models prone to generating harmful or undesirable images even with these methods. Inspired by the phenomenon of catastrophic forgetting, we propose a training policy using contrastive learning to increase the latent space distance between clean and harmful data distribution, thereby protecting models from being fine-tuned to generate harmful images due to forgetting. The experimental results demonstrate that our methods not only maintain clean image generation capabilities before malicious fine-tuning but also effectively prevent DMs from producing harmful images after malicious fine-tuning. Our method can also be combined with other safety methods to maintain their safety against malicious fine-tuning further.

DOISemantic Scholar

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pan2026leveraging,
  title  = {Leveraging Catastrophic Forgetting to Develop Safe Diffusion Models against Malicious Finetuning},
  author = {Jiadong Pan and Hongcheng Gao and Zongyu Wu and Taihang Hu and Li Su and Qin Huang and Liang Li},
  year   = {2026},
  doi    = {10.52202/079017-3658},
  url    = {https://doi.org/10.52202/079017-3658},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/4f49343543dccadc7a0b64fe6d881eee4e19a9a8.svg)](https://codeofpaper.com/paper/4f49343543dccadc7a0b64fe6d881eee4e19a9a8)

Discussion