Large language models (LLMs) have achieved remarkable success across diverse applications but remain vulnerable to jailbreak attacks, where attackers craft prompts that bypass safety alignment and elicit unsafe responses. Among existing approaches, optimization-based attacks have shown strong effectiveness, yet current methods often suffer from frequent refusals, pseudo-harmful outputs, and inefficient token-level updates. In this work, we propose TAO-Attack, a new optimization-based jailbreak method. TAO-Attack employs a two-stage loss function: the first stage suppresses refusals to ensure the model continues harmful prefixes, while the second stage penalizes pseudo-harmful outputs and encourages the model toward more harmful completions. In addition, we design a direction-priority token optimization (DPTO) strategy that improves efficiency by aligning candidates with the gradient direction before considering update magnitude. Extensive experiments on multiple LLMs demonstrate that TAO-Attack consistently outperforms state-of-the-art methods, achieving higher attack success rates and even reaching 100% in certain scenarios.
Figures & tables
Figure 1: Comparison of optimization-based jailbreak attacks. GCG and MAC can result in refusals, while I -GCG reduces refusals but produces pseudo-harmful outputs. Our TAO-Attack employs a two-stage loss to suppress refusals and penalize pseudo-harmful outputs, leading to more effective harmful completions.
Figure 2: Illustration of the token optimization. GCG prefers ej due to its large step size, even though it deviates from the negative gradient direction (red arrow). Our method instead selects el , which achieves both strong alignment with the negative gradient and a sufficient step size.
Method
Vicuna-7B-1.5
Llama-2-7B-chat
Mistral-7B-Instruct-0.2
GCG ( Zou et al., 2023 )
98 %
54%
92 %
MAC ( Zhang and Wei, 2025 )
100%
56%
94%
AutoDAN ( Liu et al., 2024a )
100%
26%
96%
Probe-Sampling ( Zhao et al., 2024 )
100%
56%
94%
AmpleGCG ( Liao and Sun, 2024 )
66%
28%
-
AdvPrompter* ( Paulus et al., 2024 )
64%
24%
74%
Table 1: Attack success rates of baseline jailbreak methods and TAO-Attack on AdvBench. Results marked with * are taken from the original papers.
Method
Llama-2-7B-Chat
Mistral-7B-Instruct-0.2
Qwen2.5-7B-Instruct
ASR
Iterations
ASR
Iterations
ASR
Iterations
I -GCG ( Jia et al., 2025 )
68%
604
80 %
406
100%
66
TAO-Attack
92%
305
100%
86
100%
21
Table 2: Comparison of TAO-Attack and I -GCG under fixed suffix initialization. All methods run for up to 1,000 iterations per query. Bold numbers indicate the best results.
Model
Method
GPT3.5 Turbo
GPT4 Turbo
Gemini 1.5
Gemini 2
Vicuna-7B-1.5
GCG ( Zou et al., 2023 )
30%
0%
4%
0%
I -GCG ( Jia et al., 2025 )
30%
0%
0%
4%
TAO-Attack
82%
8%
6%
4%
Table 3: Transferability evaluation of universal jailbreak suffixes optimized on Vicuna-7B-1.5.
Figure 3: Average loss for GCG (Softmax) and DPTO, with shaded areas indicating standard deviation, computed over samples where both methods succeed.
Stage One
Stage Two
DPTO
GCG (Softmax)
GCG
Harmful Guidance
ASR
Iterations
✓
✓
55%
702
✓
✓
55%
687
✓
✓
65%
620
✓
✓
100%
261
✓
✓
✓
100%
243
Table 4: Ablation and component analysis of TAO-Attack. The last row presents the full method.
Method
0.8
0.9
1.0
ASR
Iterations
ASR
Iterations
ASR
Iterations
Qwen3-Embedding-0.6B
95%
325
95%
273
100%
263
Rouge-L
100%
262
100%
255
100%
243
Table 5: Comparing different switching mechanisms on Llama-2-7B-Chat.
Model
Llama-2-7B-Chat
Qwen2.5-7B-Instruct
Qwen2.5-VL-7B-Instruct
ASR
Iterations
ASR
Iterations
ASR
Iterations
I -GCG
45%
792
100%
26
90%
248
TAO-Attack
90%
357
100%
11
95%
132
Table 6: Comparison across additional datasets and models.
Method
I -GCG
Stage One
Stage Two
Peak Allocated Memory (GB)
32.99
34.80
35.99
Time per iteration (s)
5.7
6.1
7.1
Table 7: Comparison of peak GPU memory and per-iteration time for I -GCG and TAO-Attack.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Evaluation prompt for GPT-4-based (GPT-4 Turbo) checking.
Figure 5: The universal jailbreaking suffix prompts response generation from GPT-3.5 Turbo (left) and GPT-4 Turbo (right) on the OpenRouter platform.
Method
PAT ( Mo et al., 2024 )
RPO ( Zhou et al., 2024 )
ASR
Iterations
ASR
Iterations
I -GCG
60 %
257
86%
133
TAO-Attack
80 %
138
92%
71
Appendix
Table 8: Jailbreak performance under advanced defense methods. The number in bold indicates the best jailbreak performance.
Method
CAA ( Rimsky et al., 2024 )
SCANS ( Cao et al., 2025 )
Original
99%
94%
I -GCG
90%
4%
TAO-Attack
41%
0%
Appendix
Table 9: Jailbreak performance against CAA and SCANS defenses. The number in bold indicates the best attack performance.
τ
α
β
γ
0.8
0.9
1
0.1
0.2
0.3
0.1
0.2
0.3
0.4
0.5
0.6
ASR
100%
100%
100%
95%
100%
95%
100%
100%
100%
95%
100%
95%
Iterations
262
255
243
285
243
221
264
243
257
268
243
291
Appendix
Table 10: Hyperparameter study of the Rouge-L threshold τ , stage-one weight α , stage-two weight β , and temperature γ under the Llama-2-7B-Chat threat model.
Method
Information Extraction
Influence Operations
ASR
Iterations
ASR
Iterations
I -GCG
100%
36
100%
16
TAO-Attack
100%
29
100%
9
Appendix
Table 11: Comparison of attack performance for TAO-Attack and I -GCG in security-sensitive scenarios. Bold numbers indicate the best performance.
Metric
”@ @ …@”
”# # …#”
”! ! …!”
ASR
Iterations
ASR
Iterations
ASR
Iterations
I -GCG
65%
611
60%
666
65%
582
TAO-Attack
95%
201
90%
326
100%
243
Appendix
Table 12: Comparison of performance across different suffixes. Bold numbers indicate the best performance.
K
1
3
5
7
ASR
Iterations
ASR
Iterations
ASR
Iterations
ASR
Iterations
Llama-2-7B-Chat
95%
242
100%
243
100%
250
90%
360
Vicuna-7B-v1.5
100%
21
100%
17
100%
18
100%
18
Appendix
Table 13: Effect of the refusal set size K on Llama-2-7B-Chat and Vicuna-7B-v1.5. Bold numbers indicate the best performance.
Method
Original
DPTO
ASR
Iterations
ASR
Iterations
GCG
55%
702
65%
620
I -GCG
65%
582
75%
496
Appendix
Table 14: Effect of applying DPTO to GCG and I -GCG. Bold numbers indicate the best performance.
Method
Llama-2-13B-Chat
Vicuna-13B
ASR
Iterations
ASR
Iterations
I -GCG
53%
704
73%
600
TAO-Attack
67%
569
100%
82
Appendix
Table 15: Evaluation of I -GCG and TAO-Attack on 13B-scale models. Bold numbers indicate the best performance.
Variant
ASR
Iterations
I -GCG
65%
582
TAO-Attack
100%
243
TAO-Attack + harmful-guidance prefix
65%
716
TAO-Attack + multi-coordinate updating
85%
325
Appendix
Table 16: Ablation on integrating components of I -GCG into TAO-Attack. Bold numbers indicate the best performance.
Method
Non-reasoning
Reasoning-enabled
ASR
Iterations
ASR
Iterations
I -GCG
100%
49
90%
92
TAO-Attack
100%
39
90%
79
Appendix
Table 17: Results on Qwen3-8B under different settings.
Adversarial attacks on large language models probe how crafted inputs, internal changes, and agent interactions bypass safety or disrupt reliable behavior.
Jailbreak attacks expose persistent safety weaknesses in large language models (LLMs), but existing stateless single-turn methods face a trade-off: hand-crafted prompts are expressive but static, while iterative prompt optimization can adapt but often relies on low-level mutations that require many target queries. We propose JailbreakOPT, a tool-assisted framework for improving iterative single-turn jailbreak prompt optimization. JailbreakOPT organizes diverse atomic jailbreak prompts into an attack tool library and composes them through a unified intra-episode optimization abstraction to generate stronger standalone attack prompts. To reuse experience across attack episodes, JailbreakOPT further frames tool selection as a contextual bandit problem and applies contextual Thompson sampling to guide exploration and exploitation based on past outcomes. Experiments across multiple target LLMs and attack goals show that JailbreakOPT improves attack success rate (ASR) while reducing the number of attacks until success (No.A) compared with atomic single-turn attacks and existing iterative optimization baselines. This paper may contain offensive or harmful content.
Ge Shi, Jun Yin, Donglin Xie +3
University of California, Davis · The Renmin University of China · Independent Researcher +3
Despite the significant efforts devoted to aligning large language models (LLMs) with human values and ensuring safe deployment, recent work has revealed that LLMs remain vulnerable to adversarial jailbreak attacks that can bypass safety guardrails and elicit harmful responses. Many defense methods are proposed to detect jailbreaks but they are limited in their effectiveness to counter wide-range optimization-based jailbreak mechanisms that can yield highly fluency-optimized or harmful semantic obfuscated prompts. To tackle this challenge, we propose a unified detection framework SAFEGuard which incorporates a hybrid fluency measurement based on cross-layer distribution distance and perplexity, and the analysis of harmful semantics through gradient matching. Our method is grounded in a paramount observation: high fluency prompts maintain their malicious intention close to harmful prompts while harmful semantic obfuscated prompts often inject gibberish token sequences. Our evaluation demonstrates that SAFEGuard consistently outperforms state-of-the-art baselines and achieves significant improvement in accuracy across different optimization-based jailbreaks. This underscores the effectiveness of SAFEGuard against evolving jailbreak attacks.
Quoc Viet Vo, Trung Le, Damith C. Ranasinghe +1
Australian Institute for Machine Learning · Adelaide University · Monash University
Despite rigorous safety alignment, Large Language Models (LLMs) remain vulnerable to jailbreak attacks. Existing black-box methods often rely on heuristic templates or exhaustive trials, lacking mechanistic interpretability and query efficiency. In this study, we investigate an intrinsic vulnerability in the safety mechanisms of LLMs, where safety alignment relies on a small set of sparsely distributed attention heads, leaving much of the representational space weakly monitored. We formalize this phenomenon with a mathematical jailbreaking model that characterizes the delicate boundary of effective text obfuscation and analytically explains observed jailbreak behaviors. Guided by this model, we propose Babel, an efficient black-box attack framework that exploits the identified safety gap through systematic obfuscation sampling with iterative, feedback-driven distribution refinement, enabling reliable and high-success jailbreak attacks without access to model internals. Comprehensive evaluations on frontier commercial models demonstrate that Babel achieves state-of-the-art attack success rates and superior query efficiency. Specifically, compared to state-of-the-art methods, Babel increases the attack success rate on GPT-4o from 41.33% to 82.67% and on Claude-3-5-haiku from 38.33% to 78.33% within an average of 40 queries, providing a robust red-teaming methodology for LLMs safety research.
Ziwei Wang, Jing Chen, Ruichao Liang +6
Wuhan University · Nanyang Technological University · Southeast University +1