arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.24012cs.LGcs.AI
收藏

面向文本到图像扩散模型的免训练安全文本嵌入引导方法

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

KAIST(韩国科学技术院);NAVER AI Lab(NAVER人工智能实验室);SNU AIIS(首尔国立大学人工智能研究所)

Byeonghu Na, Mina Kang, Jiseok Kwak, Minsang Park, Jiwoo Shin, SeJoon Jun, Gayoung Lee, Jin-Hwa Kim, Il-Chul Moon

AI总结:

针对文本到图像扩散模型易生成有害内容的问题,提出免训练的安全文本嵌入引导方法STG,通过采样时引导文本嵌入提升安全性,在多场景下效果优于各类基线且保留语义意图。

摘要:

在先进扩散模型与大规模网络爬取数据集的推动下,文本到图像模型近期在生成逼真且语义连贯的图像方面取得了显著进展。但这些数据集通常包含不当或有偏见的内容,引发了人们对输入恶意文本提示时会生成有害输出的担忧。我们提出了安全文本嵌入引导(Safe Text embedding Guidance,STG),这是一种免训练方法,通过在采样过程中引导文本嵌入来提升扩散模型的安全性。STG 基于对预期最终去噪图像评估的安全函数调整文本嵌入,无需额外训练即可让模型生成更安全的输出。理论上,我们证明 STG 使底层模型分布与安全约束对齐,从而在最小化影响生成质量的同时实现更安全的输出。在裸露、暴力、艺术家风格移除等多种安全场景下的实验表明,STG 在移除不安全内容、保留输入提示核心语义意图方面,效果始终优于基于训练和免训练的基线方法。我们的代码可在 https://github.com/aailab-kaist/STG 获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑