Abstract
Large Language Models (LLMs) are increasingly deployed behind restrictive APIs, making traditional white-box adversarial attacks impractical. This paper introduces QROA (Query-Response Optimization Attack), a black-box optimization framework that treats jailbreaking as a reinforcement learning problem. By utilizing a surrogate model and an automated reward function, QROA discovers adversarial suffixes that compel models to generate harmful content. Our results show that QROA achieves high attack success rates (ASR) across various state-of-the-art models, including GPT-3.5-Turbo and GPT-4o-mini, while remaining significantly more cost-effective than existing black-box alternatives.
Introduction
The safety of Large Language Models (LLMs) is a critical concern, often addressed through "jailbreak" testing. Most effective attacks, such as Greedy Coordinate Gradient (GCG), are "white-box," requiring access to internal model weights and logit information. However, high-stakes commercial models like GPT-4 are typically "black boxes" accessible only via text-based APIs. Existing black-box methods often rely on manual prompt engineering or expensive LLM-based attackers. QROA bridges this gap by providing an automated, query-only optimization method that is both model-agnostic and highly efficient.
Methodology
QROA frames the search for a jailbreak suffix as a Multi-Armed Bandit problem. The system aims to find a sequence of tokens (a suffix) that, when appended to a malicious instruction, maximizes the probability of a compliant (harmful) response from the target LLM.
The core components of the QROA pipeline include:
- Surrogate Model: To minimize the cost of querying the target LLM, a small local MLP surrogate model predicts the likelihood of success for various suffixes based on historical data.
- Deep Q-Learning & UCB: The framework uses Deep Q-learning with experience replay. It employs the Upper Confidence Bound (UCB) algorithm to balance the exploration of new token combinations with the exploitation of known successful patterns.
- Reward Function: A fine-tuned RoBERTa model serves as an "alignment function," evaluating the target LLM's output. High rewards are granted when the model complies with a harmful prompt.
- Universal Suffixes (QROA-UNV): An extension of the method optimizes a single suffix against a set of prompts, creating a "universal" string capable of jailbreaking the model across diverse forbidden topics in a single query.
Experimental Results
The researchers evaluated QROA using benchmarks like AdvBench and HarmBench against models including Vicuna-7B, Llama-2-7B-chat, GPT-3.5-Turbo, and GPT-4o-mini.
Key findings include:
- High Success Rates: QROA achieved a 92% ASR on GPT-3.5-Turbo within a 30,000-query budget.
- Superior Efficiency: As shown in the comparison table, QROA often outperforms or matches established methods like AutoDAN and ReNeLLM while being significantly cheaper. For instance, the cost per successful jailbreak on GPT-3.5 was approximately $0.18, compared to over $1.00 for LLM-based attackers like TAP.
- Generalization: QROA-UNV demonstrated remarkable transferability. Suffixes optimized for Vicuna-7B were successful on 90% of unseen malicious instructions.
- Robustness to Defenses: By incorporating a perplexity penalty into the optimization objective, QROA can generate more "readable" suffixes that bypass simple gibberish-detection filters.
Discussion and Conclusion
QROA demonstrates that LLM alignment has systemic vulnerabilities that can be exploited through efficient black-box optimization. The success of the surrogate model suggests that different LLMs share underlying token relationship patterns.
However, the method has limitations. Its performance is tied to the precision of the RoBERTa reward model; inaccuracies here can lead to sub-optimal optimization. Additionally, the high query volume required for the "warm-up" phase might be detectable by API providers. Future work includes developing richer surrogate models and using the QROA framework defensively to identify and patch vulnerabilities before model deployment.
Summary updated