English

Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models

Machine Learning 2025-10-29 v1 Artificial Intelligence

Abstract

Text-to-image models have recently made significant advances in generating realistic and semantically coherent images, driven by advanced diffusion models and large-scale web-crawled datasets. However, these datasets often contain inappropriate or biased content, raising concerns about the generation of harmful outputs when provided with malicious text prompts. We propose Safe Text embedding Guidance (STG), a training-free approach to improve the safety of diffusion models by guiding the text embeddings during sampling. STG adjusts the text embeddings based on a safety function evaluated on the expected final denoised image, allowing the model to generate safer outputs without additional training. Theoretically, we show that STG aligns the underlying model distribution with safety constraints, thereby achieving safer outputs while minimally affecting generation quality. Experiments on various safety scenarios, including nudity, violence, and artist-style removal, show that STG consistently outperforms both training-based and training-free baselines in removing unsafe content while preserving the core semantic intent of input prompts. Our code is available at https://github.com/aailab-kaist/STG.

Keywords

Cite

@article{arxiv.2510.24012,
  title  = {Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models},
  author = {Byeonghu Na and Mina Kang and Jiseok Kwak and Minsang Park and Jiwoo Shin and SeJoon Jun and Gayoung Lee and Jin-Hwa Kim and Il-Chul Moon},
  journal= {arXiv preprint arXiv:2510.24012},
  year   = {2025}
}

Comments

Accepted at NeurIPS 2025

R2 v1 2026-07-01T07:08:53.068Z