Jailbreaking mainstream safety-aligned large language models with a simple adaptive attackJailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attacks
Using simple adaptive attacks such as handcrafted prompt templates plus random search, the authors achieved 100% ASR on 50 AdvBench requests against models including Llama, GPT, and Claude (GPT-4 judge).
The attacker's goal is to construct a prompt that makes the target LLM generate harmful content for a harmful request (a GPT-4 judge giving 10/10 counts as success). Knowledge is tiered by model: Full (open-source weights), Logprobs (top-20 logprobs provided by the OpenAI API), Tokens (Claude does not expose logprobs and only generates text, so the prefilling feature can be used). Attacks are customized per model, not per request; the victim systems are safety-aligned open-source and proprietary LLMs.
- Can safety-aligned LLMs withstand jailbreak attacks? The authors argue that existing evaluations mostly use fixed attacks, which overestimates model robustness, and that adaptive attacks designed for each model and defense are needed for accurate evaluation.
- Handcraft general prompt templates, then use random search to optimize adversarial suffixes to maximize the logprob of a target token (e.g., Sure); combined per model with self-transfer initialization, transfer attacks, and Claude's prefilling feature.
- On 50 AdvBench requests with GPT-4 judging, 100% ASR is reached on models including Llama-2/3, Gemma, R2D2, GPT-3.5/4/4o, and the entire Claude family (GPT-4 Turbo is 96%); the same method also won first place in the SaTML'24 trojan detection competition.
- The authors note that a GPT-4 judge score of 10/10 does not mean the content is genuinely useful to an attacker, and that false positives on Claude 2.1 are about 20%; test-time defenses such as SmoothLLM were not evaluated, and the authors confirm that their static attack does not directly work against Llama-2-Chat-7B protected by SmoothLLM.
- Evaluated models
- Llama-2-Chat-7BLlama-2-Chat-13BLlama-2-Chat-70BLlama-3-Instruct-8BGemma-7BR2D2-7BGPT-3.5 Turbo (gpt-3.5-turbo-1106)GPT-4 Turbo (gpt-4-1106-preview)GPT-4o (gpt-4o-2024-05-13)Claude Instant 1.2Claude 2.0Claude 2.1Claude 3 HaikuClaude 3 SonnetClaude 3 OpusClaude 3.5 SonnetVicuna-13BMistral-7BPhi-3-Mini-128kNemotron-4-340BLlama-2-7B (five poisoned models M1–M5)
- Benchmarks
- AdvBench(Chao et al. 2023 筛选的 50 条有害请求)JailbreakBench JBB-Behaviors(100 条)SaTML'24 Trojan Detection Competition(5 个中毒的 Llama-2-7B 模型)
- Metrics
- ASR(GPT-4 评审 10/10 判成功)rule-based judge ASR奖励模型平均分(trojan 检测,越低越成功)
Researchers Andriushchenko, Croce and Flammarion propose a simple adaptive attack against safety-aligned large language models, achieving a 100% attack success rate on the 50 harmful requests of AdvBench, using GPT-4 as the semantic judge, against models including Llama-2-Chat-7B/13B/70B, Llama-3-Instruct-8B, Gemma-7B, GPT-3.5, GPT-4o, and R2D2 adversarially trained against GCG. The attack combines hand-designed prompt templates with random search, optimizing the suffix to maximize the logprob of a target token (such as "Sure"), and uses self-transfer to improve efficiency; for Claude models that do not provide logprobs, transfer attacks or the prefilling feature likewise achieve a 100% success rate. The authors also use random search with a restricted token search space to find trojan strings in poisoned models, winning first place in the SaTML'24 trojan detection competition.
Why it was selectedThe paper's adaptive attack achieves a 100% jailbreak success rate against more than ten mainstream models under GPT-4 judging, and the authors argue that static attack evaluations substantially overestimate robustness.
Related events and news
0 events · 1 news mentions
News that mentions this paper
- OpenAI Alignment Researchcites the paper's id or linkOpenAI 训练智能体自我举报违规行为
Jailbreaks exploit this offensively, hijacking the model's tendency to continue a pattern.
Paper analysis
What problem does this paper attempt to solve?
The authors examine the robustness of mainstream safety-aligned LLMs under simple adaptive jailbreak attacks, arguing that fixed attacks overestimate robustness.
Core question: whether current mainstream safety-aligned LLMs (including open-source and proprietary models) are robust under simple adaptive jailbreak attacks customized for each model.
- Setting and motivation: safety alignment (refusal training) is widely used to make models refuse harmful requests, but prior work has shown that adversarial prompts can bypass alignment; the authors argue that accurately evaluating robustness is critical for defense research.
- Shortcomings of existing methods: the authors state that existing attack effectiveness varies by model, and that the Llama-2-Chat and Claude families remain relatively robust to existing attacks; directly applying fixed attacks (including HarmBench-style large static attack suites) overestimates robustness.
- Core observation: different models have different vulnerabilities to different prompt templates and API features (e.g., R2D2 is sensitive to in-context prompts, Claude has a prefilling feature), so no single method works for all models, and adaptivity is key.
- Proposed in the paper: a set of simple adaptive attack building blocks—handcrafted prompt templates, logprobs-based random search, self-transfer, transfer attacks, prefilling attacks—and the same idea applied to trojan string detection.
- Threat model:
- Goal: find a prompt P such that the target LLM's output for a harmful request R is judged by the evaluator as a successful jailbreak (GPT-4 gives 10/10).
- Knowledge: three tiers by model (Table 1): Full (open-source weights), Logprobs (top-20 logprobs from the OpenAI API), Tokens (Claude exposes only text output, not logprobs).
- Capabilities: attacks are customized per model but not per request; no gradients, auxiliary LLMs, or multi-turn dialogue are required.
- Victim systems: safety-aligned open-source models and production-grade API models from OpenAI and Anthropic.
What related research exists?
Related work falls into three categories: manual jailbreaks, direct search, and LLM-assisted attacks; the authors position their work as an adaptive combination requiring neither gradients nor auxiliary LLMs.
Manual attacks
- Wei et al. (2023a) systematically categorized manual jailbreaks into two failure modes, competing objectives and mismatched generalization, and achieved high success rates on GPT-4 and Claude v1.3.
- Wei et al. (2023b) jailbroke models with in-context learning prompts containing a small number of harmful examples; Anil et al. (2024) used a large number of in-context examples (Many-Shot Jailbreaking) and reported scaling trends for long-context models.
Direct search attacks
- Zou et al. (2023) proposed the gradient-based GCG, which generates universal transferable adversarial suffixes; Lapid et al. (2023) and Liu et al. (2023) used genetic algorithms to search for jailbreaks in the black-box setting; Zhu et al. (2023) improved GCG to generate low-perplexity suffixes; Liao & Sun (2024) trained a separate model to generate adversarial prefixes.
- Sitawarin et al. (2024) and Hayase et al. (2024) are closest to this paper: they use predicted probabilities for random search on black-box models. The paper notes that both rely on the logit bias parameter for OpenAI models, but the behavior of this parameter has changed and it no longer affects logprobs, rendering their attacks ineffective.
LLM-assisted attacks
- Chao et al. (2023) proposed PAIR, which uses an auxiliary LLM to iteratively find jailbreaks; Mehrotra et al. (2023) improved it to tree search (TAP); Shah et al. (2023) used persona modulation; Yu et al. (2023) proposed GPTFUZZER; Zeng et al. (2024) fine-tuned GPT-3.5 to rewrite harmful requests (PAP).
Baselines and benchmarks: The comparison baselines are GCG, PAIR, TAP, PAP, Persona Modulation, Foot-in-the-Door, and AIM (JailbreakChat templates); the main evaluation uses 50 harmful requests selected from AdvBench by Chao et al. (2023), and additionally directly compares with GCG, PAIR, and AIM on the 100 JBB-Behaviors of JailbreakBench (Table 21).
Positioning: The authors state that their method requires no gradients, auxiliary LLMs, or multi-turn dialogue, emphasize adaptively combining simple components per model, and draw an analogy to the adaptive attack evaluation frameworks established for image classification by Carlini et al. (2019) and Tramèr et al. (2020).
How does the paper address this problem?
Handcrafted prompt templates plus random search to optimize adversarial suffixes, then combined per model with self-transfer, transfer, or prefilling.
Overall approach: for each target model, customize and combine simple building blocks—handcrafted prompt templates + random-search-optimized adversarial suffixes, supplemented by self-transfer, transfer attacks, or prefilling; attacks are customized per model, not per request. The method has no unified name; the authors call it simple adaptive attacks.
Problem setup
- Given a harmful request R and a judge function JUDGE, the attacker seeks a prompt P such that JUDGE(LLM(P), R) = YES; the GPT-4 judge scores 1–10, and only 10/10 counts as success.
- The targets are the 50 harmful requests filtered from AdvBench by Chao et al. (2023); except for Claude, each model's default system prompt is used by default.
Prompt templates
- The structure is "rule set + harmful request + adversarial suffix", guiding the model to begin with a specified string and deviate from default aligned behavior; the rules are optimized one by one on GPT-3.5 Turbo, using the logprob of the first target token as the signal. The full template is in Figure 1.
- There is also a template customized for GPT-4o (split into system and user parts, Table 7) and an in-context template containing one harmful example to imitate (Table 6, used for R2D2).
Random search and self-transfer
- Random search (Algorithm 1): a 25-token suffix (initialized with exclamation marks) is appended after the request; in each round, several consecutive tokens are modified at random positions, and the change is accepted if the logprob of the target token (default "Sure") at the start of the response increases; at most 10 000 rounds and at most 10 random restarts, with one restart usually sufficient in most cases. The objective can be written as maximizing log PLLM(t ∣ x, s), i.e., the log probability of the target token t given the request and suffix.
- Reasons given by the authors for choosing random search: it requires only logprobs, not gradients, has low memory requirements, and has precedents of success in attacks on vision models.
- Self-transfer: suffixes found on easier requests (those with higher target-token logprob) are used as initialization for random search on harder requests; the authors state this improves query efficiency and ASR, and that suffixes transfer to some extent across model sizes.
Transfer and prefilling
- Transfer attack: Claude does not expose logprobs, so random search cannot be applied directly; instead, suffixes optimized on GPT-4 are transferred, with multiple random restarts at temperature 1; placing the rule part in the system prompt improves ASR.
- Prefilling attack: exploits the Claude API's feature allowing the start of the response to be prefilled, directly beginning with the string corresponding to the target behavior, with no iterative optimization; for open-source models this can also be implemented by modifying the chat template.
Trojan detection (SaTML'24 competition)
- Task: find a universal 5–15 token trigger string in 5 poisoned Llama-2-7B models; direct random search over a 32001-token vocabulary is inefficient.
- Key design: exploiting the fact that the 5 models share initialization, rank tokens by the pairwise ℓ2 distance of embeddings across models and take the intersection of the top-k as the candidate token pool (at k=1000 the pool shrinks to 33–62 tokens; for M1, k=3000 gives 480 tokens), then run random search over the restricted pool, minimizing the reward model's average score on the training batch; the trigger string length is fixed at 5 tokens.
What experiments did the paper conduct?
Evaluated on more than 20 models over 50 AdvBench requests, with most reaching 100% ASR; a trojan competition and multiple judge comparisons are also conducted.
Experimental setup
- Models tested: Llama-2-Chat-7B/13B/70B, Llama-3-Instruct-8B, Gemma-7B, R2D2-7B, GPT-3.5 Turbo (gpt-3.5-turbo-1106), GPT-4 Turbo (gpt-4-1106-preview), GPT-4o (gpt-4o-2024-05-13), Claude Instant 1.2, Claude 2.0/2.1, Claude 3 Haiku/Sonnet/Opus, Claude 3.5 Sonnet; the appendix additionally tests Vicuna-13B, Mistral-7B, Phi-3-Mini-128k, and Nemotron-4-340B.
- Datasets: 50 harmful requests selected from AdvBench by Chao et al. (2023); the direct comparison experiment uses the 100 JBB-Behaviors of JailbreakBench.
- Metric and judge: ASR, with GPT-4 as the main judge (10/10 judged as success; the judge prompt is in Table 8); Appendix C.6 compares three judges: rule-based, Llama-3-70B, and Llama Guard 2.
- Attack parameters: suffix length 25 tokens, at most 10 000 iterations, at most 10 restarts; the prefilling attack on Claude 2.1 used 100 restarts.
- Baselines: GCG, PAIR, TAP, PAP, Persona Modulation, Foot-in-the-Door; some baseline numbers are taken from HarmBench and others, and the paper notes that their request sets or judges differ.
- Sample size: each cell in the main tables corresponds to 50 requests; Table 21 corresponds to 100; the paper does not report the number of repeated runs.
Main results
According to Table 2, Table 3, and Table 4 (GPT-4 judge, 50 AdvBench requests):
Swipe horizontally to read the table
Model Best attack combination This paper's ASR Previous best Llama-2-Chat-7B Prompt+RS+Self-Transfer 100% 92% (PAP) Llama-2-Chat-13B Prompt+RS+Self-Transfer 100% 30%* (GCG) Llama-2-Chat-70B Prompt+RS+Self-Transfer 100% 38%* (GCG) R2D2-7B In-context Prompt+RS 100% 61%* (TAP) GPT-3.5 Turbo Prompt only 100% 94% (PAP) GPT-4 Turbo Prompt+RS+Self-Transfer 96% 59%* (TAP Transfer) GPT-4o Custom Prompt+RS+Self-Transfer 100% not reported Claude 2.0/2.1/3 full family/3.5 Sonnet Prompt+Prefilling 100% 61%α (Claude 2.0) (* taken from HarmBench, with different request sets and judges; α taken from Shah et al. 2023, with a different request set.)
- The authors state that the combined attack surpasses existing methods on all these models; on Llama-2-Chat, Prompt alone is 0%, which the authors consider to reflect that its safety alignment is effective against static prompts.
- Exceptions: GPT-4 Turbo is 96% rather than 100%; the 100% for Claude 2.1 is annotated with the note that the GPT-4 judge has about 20% false positives on this model (below 5% for other models).
- The authors state that adaptivity matters: the default template gives 0% on GPT-4o, while the custom template alone gives 72%; the in-context template gives 90% on R2D2 but 0% on Llama-2-Chat-7B (Table 22).
Trojan detection competition
- What was tested: the SaTML'24 competition, 5 poisoned Llama-2-7B models, with the metric being the reward model's average score on held-out harmful prompts (lower is more successful).
- Results (Table 5): this paper's constrained random search scored -30.22 overall, better than the second place's -29.21 and the third place's -19.89; it achieved the lowest score on 3 of the 5 models; the true trigger string scored -37.48 overall.
- Authors' interpretation: similar to jailbreaking, the adaptive part (selection of the candidate token pool) exploits task-specific information, and random search then automatically optimizes.
Multi-judge comparison and direct baseline comparison
- Multi-judge (Table 20): on 10 models, the GPT-4 and Llama-3-70B judges agree completely (both 100%); the rule-based judge gives at least 90% for each model; Llama Guard 2 is lowest at 86% for Phi-3-Mini.
- Direct comparison (Table 21, 100 JBB-Behaviors, Llama-3-70B judge): this paper's method gives 89%, 90%, 93%, and 78% on Vicuna 13B, Llama-2-Chat-7B, GPT-3.5, and GPT-4 Turbo respectively; GCG gives 80%, 3%, 47%, and 4%; PAIR gives 69%, 0%, 71%, and 34%; AIM gives 90%, 0%, 0%, and 0%. The authors explain that the ASR drops from 100% to the 80%–90% range because the Llama-3-70B judge is stricter than the GPT-4 judge used as the stopping condition.
Other ablations and analyses
- Suffix length (Figure 4, Gemma-7B, 1 000 iterations): logprob and ASR show a U-shape with respect to length, with 25 tokens being optimal; ASR is lowest at 60 tokens.
- Number of restarts (Table 15, Claude transfer attack): after 100 restarts, Claude 2.0, 3 Haiku, and 3 Sonnet approach or reach 100%; Claude 2.1 and 3 Opus are 0% at every restart level.
- Prefilling structure (Tables 16–17): the system+user+assistant structure is strongest overall; prefilling only the start of the assistant turn (no template) with 1 restart gives a markedly lower ASR, e.g., 30%/70% for Claude 2.0 (GPT-4/rule-based).
- Runtime (Appendix C.2): on Llama-3-8B, 4 000 iterations of random search take 20.9 minutes on a single A100; with self-transfer, fewer than 10% of requests require this many iterations, and most require fewer than 200.
- GPT nondeterminism (Figure 3): repeating the same query 1 000 times on GPT-4 Turbo (temperature 0, fixed seed) still returns nondeterministic logprobs; the authors state that this degrades random search but it still largely succeeds.
What are some points that can be further explored?
The authors note that judge scores do not equal actual harm, that test-time defenses are not covered, and recommend designing adaptive attacks against system-level defenses.
Limitations and future directions noted by the authors
- A GPT-4 judge score of 10/10 does not always mean the generated content is genuinely useful to an attacker (Section 6 Limitations).
- The GPT-4 judge produced many false positives on Claude 2.1 (about 20%, Table 1 footnote); the authors hope that newer generations of frontier models will provide more capable judges (Section 6).
- Test-time defenses were not evaluated: the authors confirm that their static attack (template + random search) does not directly work against Llama-2-Chat-7B protected by SmoothLLM, and attacking SmoothLLM would require a new adaptive attack; the authors state that SmoothLLM increases inference time by more than an order of magnitude and does not support streaming generation (Appendix A.3).
- The authors suggest that future work could design adaptive attacks against system-level defenses (e.g., harmfulness probes, output filtering, representation-based methods such as Circuit Breakers) (Section 6 and Appendix A.3).
- The authors note that a perplexity filter can defend relatively directly against random-search suffixes, templates containing suspicious rule lists can be blocked, and prefilling can be mitigated through data augmentation (Appendix A.3).
Scope of experiments
- A total of 21 models were tested (as stated by the authors in Appendix A.3), covering the full Llama-2/3, Gemma, R2D2, GPT, and Claude families as well as Vicuna, Mistral, Phi-3, and Nemotron.
- The main evaluation uses 50 AdvBench requests; the direct baseline comparison uses 100 JBB-Behaviors; the paper does not report the number of repeated runs per condition.
- Defense evaluation covers only R2D2 (a model adversarially trained against GCG); SmoothLLM received only a single qualitative check with a static attack, with no numerical results.
- Judge consistency: Appendix C.6 compares 4 judges on 10 models, but does not report quantitative measures of agreement between human evaluation and the judges (the authors state that all generations were manually checked).
- Attack knowledge settings cover three levels, Full, Logprobs, and Tokens; trojan detection covers 5 poisoned models with the same base model.
Summarize the main content of the paper
Simple adaptive attacks reach 100% ASR on more than 20 safety-aligned models; the authors state that fixed attacks overestimate robustness.
An ICLR 2025 jailbreak attack paper whose core claim is: current mainstream safety-aligned LLMs are completely non-robust to simple adaptive attacks, whereas evaluating with fixed attack suites overestimates their robustness.
- Problem: existing jailbreak attacks have low success rates on models such as Llama-2-Chat and Claude; the authors argue this is not because the models are robust, but because the attacks are not customized to the model.
- Method: based on handcrafted prompt templates (rule set + harmful request + adversarial suffix), random search maximizes the logprob of a target token (e.g., "Sure") to optimize a 25-token suffix; per model, this is combined with self-transfer (using a suffix from an easier request as initialization), transferring a suffix from GPT-4, or Claude's prefilling. No gradients, auxiliary LLMs, or multi-turn dialogue are required.
- Result one: on 50 AdvBench requests with GPT-4 judging (10/10 counted as success), Llama-2-Chat-7B/13B/70B, Llama-3-8B, Gemma-7B, R2D2, GPT-3.5, GPT-4o, and the entire Claude family all reach 100% ASR; GPT-4 Turbo is 96% (Table 2–4).
- Result two: on the adversarially trained R2D2, the standard template yields only 8%, switching to the in-context template alone yields 90%, and adding random search reaches 100% (Table 2)—the authors use this to show that models each have unique vulnerabilities.
- Result three: the same idea applied to the SaTML'24 trojan detection competition, filtering candidate tokens by embedding distance and then running random search, achieves a total score of -30.22 and first place (Table 5).
- Result four: on 100 JBB-Behaviors with Llama-3-70B judging, this paper's method achieves 90% ASR on Llama-2-Chat-7B, whereas GCG achieves only 3% (Table 21).
- Authors' conclusion: no single attack works for all models, and robustness evaluation must combine multiple static and adaptive techniques; API design (exposing logprobs, prefilling) introduces new attack surfaces. The authors also note that a full GPT-4 judge score does not mean the content is genuinely useful, and that test-time defenses such as SmoothLLM are not covered.
Related papers
- Deep Research Agents Brings Deeper HarmAttacksarXiv