Diffusion models have been widely studied for removing unsafe content learned during pre-training. Existing methods require expensive supervised data, either unsafe-text paired with safe-image groundtruth or negative/positive image pairs, making them impractical to scale. Furthermore, offline reinforcement learning and supervised fine-tuning approaches that generate synthetic data offline suffer from catastrophic forgetting, degrading generation quality. We propose a novel online reinforcement learning framework that addresses both data scarcity and model degradation through post-training with Group Relative Policy Optimization (GRPO) on both negative and positive text prompts. To eliminate the need for fine-tuning specialized safe/unsafe reward models, we introduce a \textit{steering reward mechanism} that exploits an inherent property of CLIP embeddings: steering text representations toward positive safety directions and away from negative ones in the embedding space. Our online-policy approach enables the model to learn from diverse prompts, including explicit unsafe content, without catastrophic forgetting. Extensive experiments demonstrate that our method reduces inappropriate content to 18.07\% (vs. 48.9\% for SD v1.4) and nudity detections to 15 (vs. 646 baseline) while improving compositional generation quality from 42.08\% to 47.83\% on GenEval. Remarkably, these safety gains generalize to out-of-domain unsafe prompts across seven harm categories, achieving state-of-the-art performance without supervised paired data or reward tuning. Github: https://github.com/MAXNORM8650/SafeDiffusion-R1.


翻译:扩散模型在去除预训练阶段学习的不安全内容方面已得到广泛研究。现有方法需要昂贵的监督数据,要么是配对不安全文本与安全图像的真实标注,要么是负/正图像对,这使得它们难以规模化应用。此外,离线强化学习和监督微调方法通过离线生成合成数据,会遭受灾难性遗忘,从而降低生成质量。我们提出一种新颖的在线强化学习框架,通过在后训练阶段对负向和正向文本提示运用组相对策略优化,同时解决了数据稀缺和模型退化两大问题。为消除对专用安全/不安全奖励模型微调的需求,我们引入了一种导向奖励机制,该机制利用了CLIP嵌入的固有属性:在嵌入空间中,将文本表示导向正向安全方向并远离负向不安全方向。我们的在线策略方法使模型能够从包括显式不安全内容在内的多样化提示中学习,且不会发生灾难性遗忘。大量实验表明,我们的方法将不当内容降至18.07%(对比SD v1.4的48.9%),裸体检测降至15次(基线为646次),同时在GenEval上的组合生成质量从42.08%提升至47.83%。值得注意的是,这些安全收益可泛化至七个危害类别的域外不安全提示,无需监督配对数据或奖励调优即可实现最先进的性能。Github:https://github.com/MAXNORM8650/SafeDiffusion-R1。

0
下载
关闭预览

相关内容

ACM/IEEE第23届模型驱动工程语言和系统国际会议,是模型驱动软件和系统工程的首要会议系列,由ACM-SIGSOFT和IEEE-TCSE支持组织。自1998年以来,模型涵盖了建模的各个方面,从语言和方法到工具和应用程序。模特的参加者来自不同的背景,包括研究人员、学者、工程师和工业专业人士。MODELS 2019是一个论坛,参与者可以围绕建模和模型驱动的软件和系统交流前沿研究成果和创新实践经验。今年的版本将为建模社区提供进一步推进建模基础的机会,并在网络物理系统、嵌入式系统、社会技术系统、云计算、大数据、机器学习、安全、开源等新兴领域提出建模的创新应用以及可持续性。 官网链接:http://www.modelsconference.org/
生成扩散模型的攻击与防御:全面综述
专知会员服务
22+阅读 · 2024年8月11日
【博士论文】安全的线上和线下强化学习,142页pdf
专知会员服务
23+阅读 · 2024年6月12日
【CVPR2024】扩散模型的结构指导对抗训练
专知会员服务
27+阅读 · 2024年2月28日
【ICML2023】面向决策Transformer的未来条件无监督预训练
专知会员服务
44+阅读 · 2023年5月30日
ICML2020 图神经网络的预训练
图与推荐
12+阅读 · 2020年4月4日
论文浅尝 | 远程监督关系抽取的生成式对抗训练
开放知识图谱
17+阅读 · 2018年7月12日
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
31+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月8日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关基金
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
31+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员