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.0 queries per success on Vicuna-13B (88% JB%), 23.5 on Gemini-Pro (73%), 23.7 on GPT-4 (48%), and 33.0 on GPT-3.5 (51%), versus 256K queries 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 34 seconds, 366 MB of RAM, and $0.026 per behavior on Vicuna, versus 1.8 hours and 72 GB of 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 only 4% (Table 3).
  • Perplexity filters barely slow it down: a perplexity filter dropped GCG from 56% to 3% on Vicuna (-95%) and 4% to 0% on GPT-4, while PAIR retained 81% on Vicuna (-8%) and 40% on GPT-4 (-17%) (Table 5).
Direct jailbreak success rate on JailbreakBench (100 behaviors, Llama Guard judge; higher = more vulnerable)
Vicuna-13B
88% (10.0 q)
Gemini-Pro
73% (23.5 q)
GPT-3.5
51% (33.0 q)
GPT-4
48% (23.7 q)
Llama-2-7B
4% (56.0 q)
Claude-1
3% (13.7 q)
Claude-2
0% (no break)

Source: Chao et al. (2024), Table 2. PAIR uses Mixtral-8x7B attacker (N = 30 streams, K = 3 depth). Baselines: GCG hits 56% on Vicuna and 2% on Llama-2 at 256K queries; JBC templates average 56% on Vicuna, 20% on GPT-3.5, 17% on Gemini, 3% on GPT-4, and 0% on Llama-2 and Claude.

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):

  1. Attack generation: A receives a system prompt specifying the harmful objective O and 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 prompt P.
  2. Target response: T sees only P (with no conversation history) and returns R.
  3. Scoring: a JUDGE(P, R) classifier scores whether R fulfills O. To keep evaluation reproducible and avoid false alarms on refusals, the authors benchmarked six judges against a three-human majority (95% inter-annotator agreement) across 100 AdvBench pairs (Table 1): GPT-4 reached 88% agreement (16% FPR, 7% FNR), GCG’s keyword list hit 80% agreement with a 23% false-positive rate, and Llama Guard was chosen for all main experiments because it matched a low 7% false-positive rate with 76% agreement.
  4. Iterative refinement: if the judge scores 0, [P, R, S] is appended to A’s chat history so A adapts its framing. PAIR runs N = 30 parallel streams up to depth K = 3 (capped at 90 queries 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":".

Static defenses and compute cost: PAIR vs. white-box GCG
PAIR (Black-box, semantic)

Cost: 34s, 366 MB CPU, $0.026.
Against SmoothLLM: Vicuna 39% (-56%), GPT-3.5 10% (-88%), GPT-4 25% (-48%).
Against Perplexity filter: Vicuna 81% (-8%), GPT-4 40% (-17%).

GCG (White-box, token suffix)

Cost: 1.8 hours, 72 GB GPU.
Against SmoothLLM: Vicuna 5% (-91%), GPT-3.5 0% (-100%), GPT-4 1% (-75%).
Against Perplexity filter: Vicuna 3% (-95%), GPT-4 0% (-100%).

Source: Chao et al. (2024), Tables 4 and 5. Defenses were evaluated statically using attacks discovered against undefended models.

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.