A single adversarial suffix optimized with Greedy Coordinate Gradient (GCG) solely on open-weight Vicuna and Guanaco models transfers without any target-model queries to bypass safety alignment across 388 held-out harmful requests on GPT-3.5 (86.6% ensemble attack success rate), PaLM-2 (66.0%), Claude-1 (47.9%), and GPT-4 (46.9%).

  • White-box breakthrough on AdvBench: Optimizing a 20-token suffix for 500 steps achieves 88.0% exact harmful-string elicitation on Vicuna-7B (vs. 25.0% for AutoPrompt and 0.0% for PEZ and GBDA) and 57.0% on Llama-2-7B-Chat (vs. 3.0% AutoPrompt).
  • Universal single-suffix jailbreaks: Optimizing one suffix across 25 harmful behaviors yields 98.0% held-out test ASR on Vicuna-7B and 84.0% on Llama-2-7B-Chat (more than double AutoPrompt’s 35.0%).
  • Zero-query commercial transfer: Against 388 held-out AdvBench behaviors, direct prompts succeed 1.8% on GPT-3.5, 8.0% on GPT-4, and 0.0% on Claude-1, Claude-2, and PaLM-2; an ensemble of GCG suffixes jumps those rates to 86.6%, 46.9%, 47.9%, 2.1%, and 66.0%.
  • Over-optimization hurts transfer: Transfer ASR to black-box APIs peaks partway through the 500-step optimization on open models and declines later as the suffix overfits source weights.
Black-box transfer across 388 held-out behaviors from Vicuna and Guanaco suffixes
GPT-3.5 (baseline 1.8%, single GCG 47.4%, concat 79.6%)86.6%
PaLM-2 (baseline 0.0%, single GCG 36.1%, concat 14.4%)66.0%
Claude-1 (baseline 0.0%, single GCG 37.6%, concat 38.4%)47.9%
GPT-4 (baseline 8.0%, Vicuna-only 34.5%, concat 24.2%)46.9%
Claude-2 (baseline 0.0%, single GCG 1.8%, concat 1.3%)2.1%

Source: Zou et al. (2023), Table 2 (ensemble Attack Success Rate across 4 GCG suffixes; higher ASR means greater alignment failure).

How It Works

Earlier automated NLP attacks failed on aligned chat models for two reasons: continuous embedding methods like PEZ and GBDA lose precision when projected back to discrete tokens, while discrete searches like AutoPrompt pick a single suffix position in advance before evaluating replacements. Zou et al. fix both bottlenecks with Greedy Coordinate Gradient (GCG) across three design choices:

  1. Affirmative prefix loss: Rather than targeting full harmful instructions or a single "Sure" token (which the suffix can hijack into "Sure, here's a joke"), GCG minimizes negative log-likelihood on a query-echoing affirmation such as "Sure, here is how to build a bomb:". Once the model enters an affirmative continuation mode, it keeps generating the requested content.
  2. All-coordinate candidate search: At each of 500 steps, GCG computes one-hot token gradients across all 20 suffix positions, extracts the top k = 256 negative-gradient token replacements per slot, samples B = 512 single-token edits uniformly across all positions, evaluates their exact cross-entropy loss in a batch, and commits the lowest-loss swap.
  3. Incremental multi-prompt, multi-model optimization: To build universal transferable suffixes, Algorithm 2 starts on one harmful prompt, clips gradients to unit norm across four LLaMA-tokenizer models (Vicuna-7B, Vicuna-13B, Guanaco-7B, and Guanaco-13B), and adds the next training prompt (up to 25) only after the current suffix solves earlier ones.

Key Findings

On AdvBench’s 500 harmful strings and 500 harmful behaviors, searching across all token coordinates dramatically beat prior discrete optimizers. On Llama-2-7B-Chat, GCG jumped individual harmful-string ASR from 3.0% (AutoPrompt) and 0.0% (PEZ/GBDA) to 57.0%, and lifted held-out universal behavior ASR from 35.0% to 84.0%.

Optimizer comparison on AdvBench white-box targets (100 test cases)
Embedding projection (PEZ, GBDA)
Hits 0.0% exact harmful strings on both models and 0.0% to 1.0% universal test ASR on Llama-2-7B-Chat.
Single-slot discrete (AutoPrompt)
Matches GCG on Vicuna-7B universal behaviors (98.0%) but stalls at 25.0% strings and 35.0% Llama-2 test ASR.
All-coordinate discrete (GCG)
Reaches 88.0% strings / 98.0% universal on Vicuna-7B and 57.0% strings / 84.0% universal on Llama-2-7B-Chat.

Source: Zou et al. (2023), Table 1 (500 optimization steps, 20 modifiable tokens, batch size 512, top-k 256).

Transfer to commercial systems depended strongly on model lineage and ensembling. Optimizing across both Vicuna and Guanaco models jumped Claude-1 ASR from 2.6% (Vicuna alone) to 37.6% and GPT-3.5 from 34.3% to 47.4%. Concatenating three suffixes nearly doubled GPT-3.5 ASR to 79.6% but dropped GPT-4 from 29.1% to 24.2% and PaLM-2 from 36.1% to 14.4%, because overly long gibberish suffixes prompted clarification instead of compliance. Checking four suffixes in an ensemble fixed that penalty, pushing GPT-3.5 to 86.6%, PaLM-2 to 66.0%, Claude-1 to 47.9%, and GPT-4 to 46.9%, while also transferring to Pythia-12B, Falcon-7B, MPT-7B, ChatGLM-6B, and Stable-Vicuna.

Two mechanisms help explain these transfer patterns. First, Vicuna was distilled from ChatGPT-3.5 outputs, creating shared vulnerabilities; in a follow-up check, optimizing suffixes on Claude-distilled LLaMA models boosted transfer across black-box targets too. Second, Claude-2’s 2.1% automated rate reflected an input content detector on the chat interface rather than robust weights: spending 30 seconds on GPT-3.5 failures pushed manual rephrasing near 100%, and pairing a word-substitution preamble with a GCG suffix bypassed Claude-2 as well.

Caveats and Builder Takeaway

GCG suffixes are high-perplexity strings, meaning simple perplexity filters catch naive unmodified GCG suffixes unless attacks incorporate readability constraints (as later AutoDAN defenses and black-box PAIR jailbreaks demonstrated). Table 2 also reflects the December 2023 v2 evaluation over 388 deduplicated AdvBench behaviors (slightly different from early v1 intro snapshots of 87.9% and 53.6% on GPT-3.5 and GPT-4), and disclosed exploits were patched by providers after responsible disclosure.

For engineers deploying aligned APIs, closing weight access does not eliminate gradient-based attacks: open proxy models distilled from or trained on similar web corpora leak transferable failure modes. Refusal fine-tuning alone acts as a thin surface barrier unless paired with representation-level circuit breakers, system-level baseline defenses, and downstream tool/data permission boundaries.