Training-Free Safe Denoisers for Safe Use of Diffusion Models

Mingyu Kim, Dongjun Kim, Amman Yusuf, Stefano Ermon, Mijung Park
2/1/2025
23 citations
diffusion-flow

No official code found. Best implementation: MingyuKim87/Safe_Denoiser (4 stars, Python, last commit 2026-02-23).

Abstract

There is growing concern over the safety of powerful diffusion models (DMs), as they are often misused to produce inappropriate, not-safe-for-work (NSFW) content or generate copyrighted material or data of individuals who wish to be forgotten. Many existing methods tackle these issues by heavily relying on text-based negative prompts or extensively retraining DMs to eliminate certain features or samples.

Show full abstract

In this paper, we take a radically different approach, directly modifying the sampling trajectory by leveraging a negation set (e.g., unsafe images, copyrighted data, or datapoints needed to be excluded) to avoid specific regions of data distribution, without needing to retrain or fine-tune DMs. We formally derive the relationship between the expected denoised samples that are safe and those that are not safe, leading to our $\textit{safe}$ denoiser which ensures its final samples are away from the area to be negated. Inspired by the derivation, we develop a practical algorithm that successfully produces high-quality samples while avoiding negation areas of the data distribution in text-conditional, class-conditional, and unconditional image generation scenarios. These results hint at the great potential of our training-free safe denoiser for using DMs more safely.

View on arXivView PDF

Code Implementations(1)

Official PyTorch implementation of Safe Denoiser: "Training-Free Safe Denoisers For Safe Use of Diffusion Models (NeurIPS2025)"

40PythonFeb 23, 20269 months ago

Similar Papers

Cite this paper

@article{kim2025trainingfree,
  title  = {Training-Free Safe Denoisers for Safe Use of Diffusion Models},
  author = {Mingyu Kim and Dongjun Kim and Amman Yusuf and Stefano Ermon and Mijung Park},
  year   = {2025},
  eprint = {2502.08011},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2502.08011},
  url    = {https://doi.org/10.48550/arXiv.2502.08011},
  journal = {Neural Information Processing Systems}
}

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/2502.08011.svg)](https://codeofpaper.com/paper/2502.08011)

Discussion