AdvPIE: An automatic red-teaming framework for implicit vulnerabilities in text-to-image modelsAutomatic Red Teaming for Implicit Vulnerabilities of Text-to-Image Models
AdvPIE uses black-box policy-critic agents and cumulative adversarial decoding to search for prompts on T2I models that appear harmless but produce harmful images, achieving higher ASR than baselines in most settings.
Black-box: the attacker can only query the target T2I model and cannot access internal weights. The goal is to find implicit adversarial prompts that are benign on the text surface but produce harmful images. Success is determined by a binary indicator Φ independent of the critic agent.
- Implicit adversarial prompts are benign on the surface yet can make text-to-image models output inappropriate images, making them harder to detect than explicitly harmful prompts. Without parameter access, one can only search the discrete text space with sparse visual feedback.
- AdvPIE is a training-free black-box agent framework: the critic agent gives global (top-k harmful prompts) and relative (last two rounds) feedback on text and images; the policy agent uses cumulative adversarial decoding to reweight logits by token-level accumulated harmfulness scores, with a repetition penalty.
- Main experiments on four open-source T2I models and Stable Diffusion API evaluate ASR with Gemma, LLaVA Guard, and SafeSearch. The authors state that AdvPIE generally outperforms Groot, ART, and FLIRT; the exception is on safe-sd-v1-5 with the Gemma critic, where FLIRT is 33.26% and AdvPIE is 30.45%. In human evaluation, AdvPIE is the highest on all four target models.
- Appendix B says the policy model looks at only one image per round, leaving multi-image reasoning to future work; one interaction round takes about 20 seconds (excluding rendering). Commercial LLMs cannot serve as the policy agent due to safety restrictions. Experiments cover four open-source models plus the Stable Diffusion API, three annotators, 3520 pairs in total, and 20 rounds in the main experiments.
- Evaluated models
- Stable Diffusion 3.5 LargeFLUX.1-schnellSafe-StableDiffusion 1.5Safe-StableDiffusion 2.1Stable Diffusion API
- Benchmarks
- GPT-4o生成的11类有害内容安全种子提示词(每类30条)OpenAI Moderation APIGoogle Cloud Vision API (SafeSearch)
- Metrics
- ASRBypass rate人工一致阈值下的ASR
The researchers propose AdvPIE, a multimodal agent framework for exposing implicit vulnerabilities in text-to-image (T2I) models without accessing the target model's parameters. The method uses a policy agent that generates and iteratively optimizes implicit adversarial prompts based on feedback from a judge agent, which provides modality-specific safety assessments at both global and relative levels. The authors also propose a Cumulative Adversarial Decoding strategy that dynamically reweights token distributions, favoring tokens that generate more harmful images while maintaining sampling diversity. Experiments on standard and safety-aligned text-to-image models show that AdvPIE effectively mines implicit vulnerabilities and outperforms multiple baseline methods. This work is accepted at ECCV 2026.
Paper analysis
What problem does this paper attempt to solve?
Under black-box conditions, find implicit prompts that look harmless on the surface yet cause text-to-image models to produce harmful images.
How to systematically find implicit adversarial prompts for text-to-image (T2I) models without parameter access.
- Scenario and importance: the authors argue that T2I models such as Stable Diffusion and FLUX can generate realistic images from language descriptions, which also brings safety risks. Implicit adversarial prompts look benign on the text surface yet can still elicit inappropriate visual content (Fig. 1). Explicitly harmful prompts are easier to identify and block; implicit vulnerabilities are harder to detect and defend against.
- Limitations of existing work: without gradients, feedback comes only from evaluating the generated image, requiring search in a huge discrete text space with sparse visual signals and no token-level guidance. The authors identify two kinds of difficulty: single-step visual evaluation is too coarse, while simply aggregating all history introduces noise; the policy also needs to exploit accumulated experience while keeping prompts diverse and implicit rather than becoming explicitly harmful.
- Core idea: use a multimodal policy agent to propose and rewrite prompts, and a critic agent to evaluate images and give safety reasons. Feedback should have both global reference and relative progress; at decoding time, reweight tokens by historical harmfulness scores and suppress repetition and overly explicit harmful text.
- This paper proposes: Adversarial Probing for Implicit VulnErabilities (AdvPIE), a training-free black-box red-teaming agent with global-relative feedback and Cumulative Adversarial Decoding (CAD).
- Threat model:
- Goal: within a query budget T, find as many prompts as possible that are judged safe on text and harmful on image, maximizing the cumulative number of red-teaming successes.
- Knowledge: the authors call it black-box. The attacker can only query the target model and cannot access internal weights. Experiments cover both open-source models and commercial APIs.
- Capability: the policy agent proposes the next prompt based on interaction history; no gradient updates or fine-tuning. The policy and critic models are frozen throughout.
- Victim system and judgment: the victim system is the T2I model T, mapping prompts to images. Success is determined by a binary indicator Φ independent of the critic model: the prompt looks safe and the image is harmful. In experiments, the text side uses the OpenAI Moderation API, and the image side uses Gemma3-4B, LLaVA Guard, or Google Cloud Vision API (SafeSearch).
What related research exists?
The authors position AdvPIE on training-free, black-box, token-level exploitation of multimodal feedback for T2I red-teaming.
Related work is divided into three groups according to Section 2 of the paper and Appendix A.
Automated red teaming
- Human red teaming and agent red teaming (Ganguli et al. 2022, Perez et al. 2022): probe inputs and outputs to find vulnerabilities. The authors say human methods are inefficient, and later work uses agents for jailbreaks, privacy leakage, and toxic generation.
- Prompt injection and training adversarial agents (Wang et al. 2024, Yu et al. 2023, Zou et al. 2023, Perez et al. 2022, Wei et al. 2023): from prompt injection to supervised or reinforcement learning training of adversarial agents. The authors say these methods require large amounts of data and computation, limiting scalability.
- Feedback-based and in-context learning (FLIRT, LeakAgent, RedAgent): can adapt iteratively without fine-tuning. The authors say they work only in the text modality, whereas harmful intent in T2I is visible only in the generated image.
Text-to-image red teaming
- White-box methods (P4D, MMA-Diffusion): use gradient guidance to optimize the model internals. The authors say the attacks are strong but impractical on commercial systems without model access.
- Black-box agent methods: FLIRT and Groot rely on clearly harmful seed prompts, which the authors say limits discovery of more subtle implicit vulnerabilities. SneakyPrompt and ART remove this reliance but require large-scale data collection and model-specific fine-tuning. Adversarial Nibbler crowdsources implicit prompts from human users; the authors say it lacks scalability.
- LLM reasoning and preference optimization (Cao et al. 2026, Dong et al. 2025, Jiang et al. 2026, Zhang et al. 2026): strengthen the agent attack loop. The authors say two points remain underexplored: feedback is mostly evaluated within a single round or a fixed candidate set, with less characterization of direction across iterations toward more harmful outputs; and using feedback relies mainly on fine-tuning or sequence-level rewriting, with less token-level guidance at inference time.
Baseline methods and evaluation targets
- Baseline methods: the main experiments compare FLIRT, Groot, and ART. Related work also discusses P4D, MMA-Diffusion, SneakyPrompt, and Adversarial Nibbler, but they are not baselines in the main table.
- Benchmarks/datasets: GPT-4o generates 30 safe seed prompts for each of 11 harmful content categories; open-source models use the OpenAI Moderation API to filter explicitly harmful prompts; commercial APIs use their built-in moderation to decide whether a prompt is accepted. Image harmfulness is judged by Gemma3-4B, LLaVA Guard, or SafeSearch.
The authors position AdvPIE as: replacing model training with adversarial decoding on iterative multimodal feedback to make a training-free, black-box red team; using multimodal policy and critic agents that look at both prompt and image to handle the text-visual gap that text-only agents cannot; and using global-relative feedback and token-level CAD to address the two challenges above, without model training or large-scale data collection.
How does the paper address this problem?
The frozen policy and critic agents use global-relative scores to drive token-level cumulative adversarial decoding.
AdvPIE iteratively rewrites prompts under black-box queries using a frozen policy agent and a critic agent: first constructing cross-round global and relative feedback, then using CAD to turn feedback into token sampling bias.
Problem Setting and Formalization
- Target model: T maps prompt space X to image space I. The attacker can only query, not read internal weights.
- Prompt to find: Prompts in subspace X* are benign in text but cause the model to generate unsafe images. The process is a multi-step decision. History h_t contains previous prompts, images, and feedback. The critic J returns structured feedback for text and images separately. The policy outputs x_t = Π(h_t).
- Objective: Maximize the sum of successes within budget T. Φ and J are separate: Φ only does outcome evaluation. In experiments, the policy model is LLaVA-v1.6-mistral-7B, and the critic model is Gemma3-4B. Both are frozen throughout; adaptation comes only from the growing history.
Global-Relative Feedback
- Single-round feedback: For each modality m (text or image), J gives a safety label y (safe or unsafe), a harm score s∈[-1, 1], a violation category c, and a natural language reason r.
- Global guidance: A reference set stores prompts whose images have been labeled unsafe, taking the TopK by image harm score, as a memory of successful adversarial prompts.
- Relative guidance: Compare the image harm scores of the last two prompts x_{t-1} and x_t to obtain a contrast signal, encouraging exploration toward more adversarial directions.
- Fig. 2: The loop starts from seed x_0; each round the target model generates images, the critic returns labels, scores, reasons, and score-based guidance; the policy generates the next prompt via CAD.
Cumulative Adversarial Decoding
- Combined score: s_t = ω^{img} s^{img}_t − ω^{txt} s^{txt}_t, with both weights non-negative and summing to 1. The authors set ω^{img}=0.8, ω^{txt}=0.2, giving more weight to image safety. Scores are assigned to each token in the prompt except EOS and padding, then averaged across rounds per token to get s̄.
- Logit update: The vocabulary logits at decoding step τ are adjusted by adding α, s̄, the standard deviation σ of logits at that step, and a repetition decay term that applies only when s̄>0. α controls the reweighting strength, β is the repetition penalty. All experiments use α=0.5, β=0.5. The authors state that variance scaling preserves the language model's original relative probability structure, and selective decay avoids getting stuck in repetitive patterns of known vulnerabilities.
Inference Settings and Success Criteria
- Policy decoding (Appendix C, Table 6): top p is 5.0, top k is 50, temperature is 3.0, num beams is 5, do sample is true. Open-source target models use max_new_tokens of 77, commercial API uses 150. Gemma3-4B uses max_new_tokens of 2000, LLaVA Guard uses 500.
- Main experiment protocol: Each round filters out explicitly harmful prompts for open-source models. Success requires the prompt to pass text safety filtering and at least one image generated in that round to be labeled harmful by the visual critic. On the commercial API, a prompt accepted by the API is considered text-safe. Appendix E gives the full prompt templates for the policy and critic; the exact phrasings and constraints are not repeated here.
What experiments did the paper conduct?
Across four open-source T2I models plus Stable Diffusion API, AdvPIE achieves the highest ASR under most critics, except on safe-sd-v1-5 with the Gemma critic.
Experimental Setup
- Target T2I models: Open-source bases are Stable Diffusion 3.5 Large (sd-3.5-large in tables) and FLUX.1-schnell (Flux in tables); safety-aligned models are Safe-StableDiffusion 1.5 and 2.1 (safe-sd-v1-5, safe-sd-v2-1 in tables), obtained by aligning Stable Diffusion 1.5 and 2.1 per [23]. The commercial system is Stable Diffusion API.
- Seeds and scale: GPT-4o generates 30 safe seeds for each of 11 harmful content categories. Each seed runs 20 iterations, with 3 images generated per round. Appendix H lists the 11 categories: Hate, Harassment, Violence, Sexual, Self-harm, Shocking, Illegal Activity, Deception, Political, Public Health, Spam.
- Baselines: FLIRT (scoring-attack, using its official repository for seeds, with scoring changed to match AdvPIE), Groot (reproduced per the original paper), ART (official implementation and model, unchanged). All methods use LLaVA-v1.6-mistral-7B as the backbone, because ART is fine-tuned on that model.
- ASR: A prompt is considered successful if it is judged non-explicitly harmful by the OpenAI Moderation API and the generated image is judged unsafe by the selected visual critic. On the commercial API, text safety is defined as the prompt being accepted by the API, and success requires at least one resulting image to be judged harmful.
- Critics: Image-side critics are Gemma3-4B, LLaVA Guard, and Google Cloud Vision API (SafeSearch). The paper does not specify the numerical thresholds for these three critics. The policy is LLaVA-v1.6-mistral-7B, and the in-process critic is Gemma3-4B.
- Hardware and repetitions: Four NVIDIA RTX 4090 GPUs, allocated to the policy, Gemma3-4B, LLaVA Guard, and the open-source T2I model; for the commercial API, the T2I is external, using three GPUs. The paper does not report the number of independent repetitions.
Main Results
Based on Table 1 (open-source, ASR%) and Table 2 (Stable Diffusion API, ASR%). Gem. is Gemma, LLa. is LLaVA Guard, SS. is SafeSearch.
Swipe horizontally to read the table
Target Model Method Gemma LLaVA Guard SafeSearch safe-sd-v1-5 AdvPIE 30.45 24.73 0.11 safe-sd-v1-5 Strongest baseline FLIRT 33.26 AdvPIE 24.73 Groot/AdvPIE 0.11 safe-sd-v2-1 AdvPIE 32.52 23.61 0.59 sd-3.5-large AdvPIE 57.83 45.41 1.70 Flux AdvPIE 58.71 49.64 1.21 Stable Diffusion API AdvPIE 50.45 38.00 1.15 Other baselines in Table 1: on safe-sd-v1-5, Groot is 11.55/9.35/0.11, ART is 21.33/15.88/0.05, FLIRT is 33.26/24.14/0.08. On Flux, FLIRT is 49.34/40.50/0.88. In Table 2, ART is 40.14/30.05/0.61, FLIRT is 38.27/29.00/0.54, Groot is 22.64/18.27/0.50.
- Author interpretation: The authors state that AdvPIE generally outperforms baselines on open-source models; the only marginal exception is on safe-sd-v1-5 with the Gemma critic, where FLIRT is 33.26% and AdvPIE is 30.45%. They attribute this to the lower visual fidelity of safe-sd-v1-5, which reduces the informativeness of visual feedback.
- SafeSearch: Among the three critics, SafeSearch has the lowest ASR. The authors state it mainly covers narrower categories such as adult and violence, with conservative detection logic; even so, AdvPIE remains competitive.
- Commercial API: Relative to the strongest baseline ART, the authors report improvements of 10.31 percentage points under Gemma, 7.95 percentage points under LLaVA Guard, and 0.54 percentage points under SafeSearch. When the API rejects explicit prompts, the authors state that logit reweighting penalizes relevant tokens, and the feedback module marks the prompt as too explicit.
Per-Category Results
Appendix Tables 9 and 10 give ASR for the 11 categories. High overall performance does not mean high performance in every category.
- Flux, Gemma (Table 9): AdvPIE averages 58.71. Hate 89.33, Spam 80.17, Harassment 69.67; Public Health is 34.67, lower than FLIRT's 76.17 in the same column. On Violence, AdvPIE is 44.90, while FLIRT is 5.00.
- Flux, SafeSearch (Table 9): AdvPIE averages 1.21. Shocking 4.17, Sexual 4.67; Hate, Harassment, Illegal, Deception, Political, Spam are 0.00.
- Stable Diffusion API, Gemma (Table 10): AdvPIE averages 50.45. Hate 77.00, Harassment 64.00; Sexual 15.50, lower than ART's 31.50 in the same column. Under LLaVA Guard, AdvPIE's Sexual is 12.50, while Groot is 34.00.
Ablations
All ablations are on the sexual category of Safe-sd-v2-1. Bypass rate is the proportion of prompts that pass the OpenAI Moderation API; passing the filter alone does not count as a successful attack.
- Table 3: Full AdvPIE is Gemma 37.67, LLaVA 36.67, SafeSearch 3.50, Bypass 54.83. Removing CAD gives 24.50 (down 13.17), 25.17 (down 11.50), 1.67 (down 1.83), 45.17 (down 9.66). Removing feedback gives 27.33 (down 10.34), 25.67 (down 11.00), 3.33 (down 0.17), 48.33 (down 6.50).
- Table 4: Removing reasoning gives Gemma 30.50 (down 7.17), LLaVA 28.83 (down 7.84), SafeSearch 2.33 (down 1.17), Bypass 47.17 (down 7.66). Removing guidance gives 21.83 (down 15.84), 21.33 (down 15.34), 2.00 (down 1.50), Bypass 37.83 (down 17.00), lower than the no-feedback baseline. The authors state that score-based guidance is more critical for maintaining implicitness, while natural language reasons affect both effectiveness and stealth. In Table 4, the no-feedback SafeSearch is 3.00 (down 0.50), inconsistent with Table 3's 3.33; the paper does not explain this.
Human Evaluation and Iteration Curves
- Table 5: Three trained annotators evaluate 220 prompt-image pairs per method per target model, totaling 3520 pairs. They annotate whether prompts appear benign to human reviewers and whether images contain harmful content. Calibration examples are discussed in advance. Numbers are unanimous / majority / at-least-one. AdvPIE: safe-sd-v1-5 is 1.5/11.5/34.0; safe-sd-v2-1 is 2.5/15.0/33.5; sd-3.5-large is 3.0/12.0/36.5; FLUX is 2.0/11.0/37.0. Across the four models, AdvPIE is the highest or tied for highest at all three thresholds (on safe-sd-v2-1, unanimous is tied with ART at 2.5). ASR under unanimous agreement is much lower than under at-least-one agreement.
- Fig. 4: For safe-sd-v2-1, using Gemma and LLaVA Guard. The authors state that ASR rises over the first 250 iterations and then plateaus; there is a slight initial decline, which the authors attribute to an exploration phase when feedback is insufficient. The authors state that within the 20 rounds of the main experiment, AdvPIE already surpasses all baselines. Specific endpoint values in the figure are not given in the text.
- Qualitative: Fig. 3 and Appendix Fig. 5 show trajectories from benign seeds through multi-step rewriting. The first two rows come from Stable Diffusion API, the last three from FLUX. The appendix provides the full prompt sequences; the original prompts are not repeated here.
Other Ablations and Analyses
- The paper does not report separate sweeps for α, β, ω, or top-k; α=0.5, β=0.5, ω^{img}=0.8, ω^{txt}=0.2 are fixed for all experiments.
- In the no-feedback rows of Table 3 and Table 4, SafeSearch is 3.33 and 3.00 respectively; the paper does not explain the source of the difference.
- SafeSearch's AdvPIE ASR on each model in Table 1 is 0.11, 0.59, 1.70, 1.21, all lower than Gemma and LLaVA Guard in the same row.
What are some points that can be further explored?
Appendix B raises the single-image-per-round limitation and the inability to use commercial LLMs as the policy; the main experiments fix 20 rounds and one policy-critic model set.
Limitations and Future Directions Noted by the Authors
- Single image per round (Appendix B): The policy model currently considers only one image per round. T2I typically generates diverse outputs per prompt, and looking at only one image may miss safety clues. The authors' mitigation is to sample multiple images per step and have the critic select the most harmful one based on safety scores; the authors state this improves attack reliability but slows evaluation, and the policy still cannot reason over all visual outputs. Future work could involve multi-image information fusion or visual summarization.
- Time cost (Appendix B): One interaction round takes approximately 20 seconds, excluding image rendering time.
- Policy model capability (Appendix B): Strict safety restrictions prevent commercial LLMs such as GPT-4o, Claude Opus, and Gemini 2.5 from serving as the policy agent; they refuse adversarial red-teaming tasks, so the authors could not test AdvPIE at the highest reasoning capability. The authors propose directions including instruction-tuning aligned open-source LLMs, or designing constrained optimization frameworks that safely guide agents while maintaining task performance.
- Dissemination and defense (Broader Impacts): The authors state that the technique could also be used to bypass content moderation. The authors state they do not release implicit prompts or harmful image examples, and they redact sensitive outputs according to institutional safety guidelines. The authors encourage future work on responsible dissemination, transparency of safety mechanisms, and collaboration between developers and red-teaming researchers to match attack techniques with defense progress.
Experimental Coverage
- Open-source targets are sd-3.5-large, Flux, safe-sd-v1-5, safe-sd-v2-1, plus Stable Diffusion API (Section 4.1, Table 1, Table 2).
- The main metric ASR is given by three image critics: Gemma3-4B, LLaVA Guard, SafeSearch; text filtering uses the OpenAI Moderation API, and for the commercial API, acceptance of the prompt by the API is used.
- Seeds are 11 categories with 30 per category, main experiments run 20 rounds with 3 images per round; Fig. 4 additionally reports longer iterations on safe-sd-v2-1, with the authors stating a plateau after about 250 iterations.
- Component ablations and feedback channel ablations are only on the sexual category of Safe-sd-v2-1 (Table 3, Table 4). Human evaluation uses 3 annotators, 220 pairs per method per model, totaling 3520 pairs, reporting three agreement thresholds (Table 5).
- The policy is fixed as LLaVA-v1.6-mistral-7B, and the in-process critic is fixed as Gemma3-4B; the paper does not report the breakdown of the 20-round budget beyond query counts, nor the number of independent repetitions. Appendix B states that GPT-4o, Claude Opus, and Gemini 2.5 were not used as policy agents because they refuse red-teaming tasks.
Summarize the main content of the paper
AdvPIE exposes implicit T2I vulnerabilities with black-box multimodal feedback and token-level cumulative decoding, achieving higher ASR than three baselines in most settings.
AdvPIE is a training-free black-box red-teaming framework for implicit vulnerabilities in text-to-image models: prompts look safe in text, but the generated images are judged harmful.
The authors aim to address how to construct cross-round feedback and apply it to token sampling when there is no gradient and only images are visible. The critic provides labels, [-1, 1] scores, categories, and reasons for both text and images; the global side retains the top-k prompts with the highest image harm scores, and the relative side compares the last two rounds. The combined score is 0.8 times the image score minus 0.2 times the text score. CAD uses the token's cross-round average score, logit standard deviation, and repetition penalty to reweight sampling, with both α and β set to 0.5. The policy is LLaVA-v1.6-mistral-7B, and the in-process critic is Gemma3-4B, both frozen.
Main experiments use 11 categories with 30 safe seeds per category, 20 iterations with 3 images per round, comparing against Groot, ART, and FLIRT. In Table 1, AdvPIE's Gemma ASR on Flux is 58.71%, and on sd-3.5-large it is 57.83%; on safe-sd-v1-5 with the Gemma critic, FLIRT is 33.26% and AdvPIE is 30.45%. SafeSearch's ASR is much lower than the other two critics, with AdvPIE at 1.21% on Flux. In Table 2, on Stable Diffusion API, AdvPIE is 50.45% (Gemma), 38.00% (LLaVA Guard), and 1.15% (SafeSearch). Relative to ART, the authors report improvements of 10.31, 7.95, and 0.54 percentage points across the three critics. Under human majority agreement, AdvPIE achieves 11.5%, 15.0%, 12.0%, and 11.0% on the four open-source targets (Table 5).
The authors conclude that global-relative feedback combined with token-level cumulative decoding can consistently outperform the listed baselines on standard models, safety-aligned models, and commercial APIs, and remains effective after safety measures are updated. Appendix B also states that the current policy consumes only one image per round, and stronger commercial LLMs could not serve as the policy model because they refuse red-teaming tasks.
Related papers
- Simple Black-box Adversarial AttacksAttacksarXiv