運用紅隊策略之對於擴散模型的除蟲演算法
Prompting4Debugging: Red-Teaming Text-to-Image Diffusion Models by Finding Problematic Prompts
摘要
近年來,擴散模型在高品質之數據內容生成方面表現出卓越的能力,特別是從文字到圖像之生成模型的相關應用。然而,人們對這項技術的濫用越來越擔憂,特別是用於生成受版權保護或不宜辦公場所觀看的圖像。雖然近期有些研究工作或模型已經開始通過微調過濾不適當的圖像/提示(擴散模型的條件輸入)、或者刪除不需要的概念/風格來引入了一些保護機制,但是對於各種提示或條件輸入所建立的安全機制之可靠性仍然未被廣泛探討。在此論文中,我們提出了一種基於紅隊演練概念的演算法,自動查找具有潛在問題的提示或條件輸入,用以測試現今已經部署安全機制之擴散模型的可靠性。我們展示了此工具在揭示擴散模型與安全機制之漏洞的效力。我們的實驗結果顯示,有 20\% - 50\% 的資料原本可以透過現存的安全機制(概念移除、否定提示或是擴散模型內建的過濾器)來移除不適當的生成圖像內容;但是經由我們的除蟲演算法可以讓擴散模型仍然由同樣的資料產生不適當的圖片,由此可見目前文字到圖像之生成擴散模型的安全性仍有很大的疑慮。整體來說,我們提出的除蟲演算法能扮演一個更全面的評估工具,用其來驗證擴散模型之安全性。
Text-to-image (T2I) generative models, such as Stable Diffusion (SD), have shown remarkable ability in high-quality content generation. However, there has been an intensifying concern about the misuse of this technology, especially for generating copyrighted or NSFW (i.e. not safe for work) images. Although efforts have been made to filter inappropriate images/prompts or remove undesirable concepts/styles via fine-tuning, the reliability of these safety mechanisms against diversified problematic prompts remains largely unexplored. In this work, we propose \textbf{Prompting4Debugging (P4D)} as a debugging and red-teaming tool that automatically finds problematic prompts for diffusion models to test the reliability of a deployed safety mechanism. We demonstrate the effectiveness of our P4D tool in uncovering new vulnerabilities of SD models with safety mechanisms. In particular, our result shows 20%-50% of prompts in existing safe prompting benchmarks that were originally considered "safe" can actually be manipulated to bypass many deployed safety mechanisms, including concept removal, negative prompt, and built-in NSFW filters. Our findings suggest that without comprehensive testing, the evaluations on limited safe prompting benchmarks can lead to a false sense of safety for T2I models.