AutoPrompt:通过LLM驱动的对抗提示对文本生成图像模型进行自动化红队测试
AutoPrompt: Automated Red-Teaming of Text-to-Image Models via LLM-Driven Adversarial Prompts
AI总结:
针对现有文本生成图像模型红队测试需白盒访问、生成无意义提示易被拦截的问题,提出黑盒框架APT,通过LLM交替优化微调与双规避策略生成人类可读对抗提示,实现优异红队性能与零样本迁移,可暴露商业API漏洞。
摘要:
尽管文本生成图像(T2I)模型发展迅速,但其安全机制易受对抗提示的攻击,这类提示会恶意生成不安全图像。当前用于主动评估此类漏洞的红队测试方法通常需要白盒访问T2I模型,依赖低效的逐提示优化,且不可避免地会生成易被过滤器拦截的语义无意义提示。本文提出APT(AutoPrompT,自动提示器),这是一个黑盒框架,利用大语言模型(LLMs)为良性提示自动生成人类可读的对抗后缀。我们首先提出一种交替优化-微调流水线,在对抗后缀优化与利用优化后后缀微调LLM之间交替进行。此外,我们在优化阶段整合了双规避策略,可同时绕过基于困惑度的过滤器和黑名单词过滤器:(1)通过辅助LLM的困惑度评分约束LLM生成人类可读提示,这与此前的令牌级乱码形成鲜明对比;(2)引入禁用令牌惩罚,抑制黑名单中禁用令牌的显式生成。大量实验证明,我们的人类可读、抗过滤对抗提示具备出色的红队测试性能,还拥有优异的零样本迁移能力,可即时适配未见过的提示,甚至能暴露商业API(如Leonardo.Ai.)中的关键漏洞。
英文摘要:
Despite rapid advancements in text-to-image (T2I) models, their safety mechanisms are vulnerable to adversarial prompts, which maliciously generate unsafe images. Current red-teaming methods for proactively assessing such vulnerabilities usually require white-box access to T2I models, and rely on inefficient per-prompt optimization, as well as inevitably generate semantically meaningless prompts easily blocked by filters. In this paper, we propose APT (AutoPrompT), a black-box framework that leverages large language models (LLMs) to automatically generate human-readable adversarial suffixes for benign prompts. We first introduce an alternating optimization-finetuning pipeline between adversarial suffix optimization and fine-tuning the LLM utilizing the optimized suffix. Furthermore, we integrates a dual-evasion strategy in optimization phase, enabling the bypass of both perplexity-based filter and blacklist word filter: (1) we constrain the LLM generating human-readable prompts through an auxiliary LLM perplexity scoring, which starkly contrasts with prior token-level gibberish, and (2) we also introduce banned-token penalties to suppress the explicit generation of banned-tokens in blacklist. Extensive experiments demonstrate the excellent red-teaming performance of our human-readable, filter-resistant adversarial prompts, as well as superior zero-shot transferability which enables instant adaptation to unseen prompts and exposes critical vulnerabilities even in commercial APIs (e.g., Leonardo.Ai.).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。