An attacker language model can automatically discover fluent, human-readable jailbreaks against black-box LLMs in tens of API queries rather than hundreds of thousands of gradient steps, cutting query volume by more than 250x relative to white-box token attacks. Patrick Chao, Alexander Robey, Edgar Dobriban, Hamed Hassani, George J. Pappas, and Eric Wong introduce Prompt Automatic Iterative Refinement (PAIR) and show across 100 JailbreakBench behaviors that semantic, iteratively refined prompts bypass GPT-4 (48%), GPT-3.5 (51%), Gemini-Pro (73%), and Vicuna (88%), while surviving perplexity filters that crush token-level attacks.
- Under 25 queries on frontier targets: PAIR averaged
10.0queries per success on Vicuna-13B (88%JB%),23.5on Gemini-Pro (73%),23.7on GPT-4 (48%), and33.0on GPT-3.5 (51%), versus256Kqueries for GCG on Vicuna (56%) and Llama-2 (2%) (Table 2). - Minimal compute footprint: running on CPU via API calls with a Mixtral-8x7B attacker took
34seconds,366 MBof RAM, and$0.026per behavior on Vicuna, versus1.8hours and72 GBof GPU memory for GCG (Table 4). - Strong cross-model transfer: PAIR prompts found against GPT-4 transferred to Vicuna (
71%), GPT-3.5 (65%), and Gemini-Pro (44%), whereas GCG’s Vicuna prompts transferred to GPT-4 and Gemini at only4%(Table 3). - Perplexity filters barely slow it down: a perplexity filter dropped GCG from
56%to3%on Vicuna (-95%) and4%to0%on GPT-4, while PAIR retained81%on Vicuna (-8%) and40%on GPT-4 (-17%) (Table 5).
How It Works
Prior automated attacks like GCG optimize adversarial token suffixes (! ! ...) using gradients from open weights, requiring 256,000 forward/backward evaluations and producing gibberish strings. Manual templates from JailbreakChat (JBC) are fluent but rely on fixed personas (“DAN”, “AIM”) that simple keyword or pattern filters can block.
PAIR automates social engineering as a four-step conversation loop between an attacker LLM A (primarily Mixtral-8x7B Instruct at temperature 1.0) and a stateless black-box target T (at temperature 0, generating 150 tokens):
- Attack generation:
Areceives a system prompt specifying the harmful objectiveOand one of three persuasion strategies (role-playing, logical appeal, or authority endorsement) with two in-context examples. It must emit JSON containing an"improvement"chain-of-thought critique and a candidate promptP. - Target response:
Tsees onlyP(with no conversation history) and returnsR. - Scoring: a
JUDGE(P, R)classifier scores whetherRfulfillsO. To keep evaluation reproducible and avoid false alarms on refusals, the authors benchmarked six judges against a three-human majority (95%inter-annotator agreement) across100AdvBench pairs (Table 1): GPT-4 reached88%agreement (16%FPR,7%FNR), GCG’s keyword list hit80%agreement with a23%false-positive rate, and Llama Guard was chosen for all main experiments because it matched a low7%false-positive rate with76%agreement. - Iterative refinement: if the judge scores
0,[P, R, S]is appended toA’s chat history soAadapts its framing. PAIR runsN = 30parallel streams up to depthK = 3(capped at90queries per behavior).
Key Findings
Ablations in Section 4.5 explain why this shallow-and-wide search (N >> K) works so consistently. Across streams of depth up to K = 12, most jailbreaks succeed on iteration 1 or 2, while very deep threads (K > 50) degrade as the attacker gets stuck in generation loops. Strategy choice also dominates: role-playing alone discovered 82 of the 88 successful Vicuna jailbreaks, far ahead of logical appeal and authority endorsement (Figure 6).
Removing pieces of the attacker prompt hurts measurably: dropping the two in-context examples cut Vicuna jailbreak rate from 93% to 76%, and removing the "improvement" chain-of-thought field dropped it to 87% (Table 7). Unexpectedly, smaller open attackers outperformed a much larger closed model: Mixtral (56B, 88% at 10.0 queries) and Vicuna (13B, 78% at 20.0 queries) both beat GPT-3.5 (175B, 69% at 28.6 queries) because GPT-3.5’s own safety alignment resisted red-teaming and closed APIs prevent pre-seeding JSON outputs with {"improvement":".
Caveats and Builder Takeaway
- Heavily aligned models still held out: Claude-2 (
0%), Claude-1 (3%), and Llama-2-7B (4%, often refusing even benign trigger words per Appendix G.1) resisted PAIR’s automated loop, showing that safety fine-tuning and over-refusal raise the bar substantially when attackers do not craft custom templates. - Static defense evaluation and judge false negatives: SmoothLLM and perplexity filters were evaluated only on pre-generated prompts rather than adaptive PAIR queries run directly against the defended endpoint, and Llama Guard’s
47%false-negative rate means absolute jailbreak percentages depend strongly on the judge chosen. - What this means for production teams: keeping model weights private provides zero protection against automated semantic red-teaming. As follow-on work on AutoDAN, baseline jailbreak defenses, Crescendo multi-turn attacks, and Constitutional Classifiers confirmed, perplexity filters only stop noisy suffixes like GCG; production deployments need intent-aware output classifiers and strict authorization checks before any model output can invoke a tool.


