Large language model jailbreaks improved by pairing two optimization methods
Pair-Aware Optimization: Coordinating Exploration and Refinement for Jailbreaking LLM Agents
Machine LearningArtificial Intelligence
Summary
Large language models can be tricked into producing harmful or unintended answers, known as jailbreaking. The authors studied two main ways to create such trick prompts: one that uses feedback from model outputs and one that uses internal gradient signals. They found that combining these two approaches—using one to explore possible trick starts and the other to refine them—works better than using either alone. They also showed that trying different random generations from the model helps find stronger tricks. This combined, pair-aware method leads to more effective jailbreak prompts.
What this means in practice
- •For ai safety teams: Evaluate and strengthen language models against jailbreaking by using hybrid optimization to discover more effective adversarial inputs.
- •For security red teams: Generate more potent prompt-based attacks on language model agents to test robustness and identify vulnerabilities.
Authors
Juanyang Xu, Zheng Wang, Xingyu Zhao, Siddartha Khastgir, Andi Zhang
Abstract
Large Language Model (LLM) agents are vulnerable to adversarial inputs that induce attacker-specified malicious behaviors, commonly referred to as jailbreaking. Existing optimization-based jailbreak attacks primarily employ first-order (FO) methods that leverage gradient information or zeroth-order (ZO) methods that rely on function-value feedback. However, their complementarity and optimization ordering remain underexplored. We systematically investigate four strategies: pure ZO, pure FO, ZO->FO, and FO->ZO, and develop a ZO-FO framework that explores adversarial prefixes through ZO optimization and refines their corresponding suffixes through FO optimization. To coordinate the two processes, we introduce Pair-aware optimization, which retains multiple prefix candidates, conditionally refines their suffixes and selects among the resulting prefix-suffix pairs. We further investigate agent jailbreaking from a more general stochastic-generation perspective, where the same adversarial input can induce diverse reasoning trajectories and actions that a single greedy output cannot capture. Accordingly, we adopt consistent stochastic decoding during both optimization and evaluation. Experiments across malicious-instruction and malicious-environment benchmarks demonstrate that hybrid optimization improves attack effectiveness over single-optimizer methods, while optimization order substantially influences performance.