AlignGuard: Scalable Safety Alignment for Text-to-Image Generation

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Liu, Runtao, Chen, I Chieh, Gu, Jindong, Zhang, Jipeng, Pi, Renjie, Chen, Qifeng, Torr, Philip, Khakzar, Ashkan, Pizzati, Fabio
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916816426631168
author Liu, Runtao
Chen, I Chieh
Gu, Jindong
Zhang, Jipeng
Pi, Renjie
Chen, Qifeng
Torr, Philip
Khakzar, Ashkan
Pizzati, Fabio
author_facet Liu, Runtao
Chen, I Chieh
Gu, Jindong
Zhang, Jipeng
Pi, Renjie
Chen, Qifeng
Torr, Philip
Khakzar, Ashkan
Pizzati, Fabio
contents Text-to-image (T2I) models are widespread, but their limited safety guardrails expose end users to harmful content and potentially allow for model misuse. Current safety measures are typically limited to text-based filtering or concept removal strategies, able to remove just a few concepts from the model's generative capabilities. In this work, we introduce AlignGuard, a method for safety alignment of T2I models. We enable the application of Direct Preference Optimization (DPO) for safety purposes in T2I models by synthetically generating a dataset of harmful and safe image-text pairs, which we call CoProV2. Using a custom DPO strategy and this dataset, we train safety experts, in the form of low-rank adaptation (LoRA) matrices, able to guide the generation process away from specific safety-related concepts. Then, we merge the experts into a single LoRA using a novel merging strategy for optimal scaling performance. This expert-based approach enables scalability, allowing us to remove 7x more harmful concepts from T2I models compared to baselines. AlignGuard consistently outperforms the state-of-the-art on many benchmarks and establishes new practices for safety alignment in T2I networks. Code and data will be shared at https://safetydpo.github.io/.
format Preprint
id arxiv_https___arxiv_org_abs_2412_10493
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle AlignGuard: Scalable Safety Alignment for Text-to-Image Generation
Liu, Runtao
Chen, I Chieh
Gu, Jindong
Zhang, Jipeng
Pi, Renjie
Chen, Qifeng
Torr, Philip
Khakzar, Ashkan
Pizzati, Fabio
Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
Text-to-image (T2I) models are widespread, but their limited safety guardrails expose end users to harmful content and potentially allow for model misuse. Current safety measures are typically limited to text-based filtering or concept removal strategies, able to remove just a few concepts from the model's generative capabilities. In this work, we introduce AlignGuard, a method for safety alignment of T2I models. We enable the application of Direct Preference Optimization (DPO) for safety purposes in T2I models by synthetically generating a dataset of harmful and safe image-text pairs, which we call CoProV2. Using a custom DPO strategy and this dataset, we train safety experts, in the form of low-rank adaptation (LoRA) matrices, able to guide the generation process away from specific safety-related concepts. Then, we merge the experts into a single LoRA using a novel merging strategy for optimal scaling performance. This expert-based approach enables scalability, allowing us to remove 7x more harmful concepts from T2I models compared to baselines. AlignGuard consistently outperforms the state-of-the-art on many benchmarks and establishes new practices for safety alignment in T2I networks. Code and data will be shared at https://safetydpo.github.io/.
title AlignGuard: Scalable Safety Alignment for Text-to-Image Generation
topic Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2412.10493