Towards Universal and Black-Box Query-Response Only Attack on LLMs with QROA

Hussein Jawad, Yassine Chenik, Nicolas J-b. Brunel

TL;DR

This paper introduces QROA, a novel black-box attack method that discovers adversarial "suffixes" to bypass LLM safety guardrails without needing internal model access or human-crafted templates. Their universal version, QROA-UNV, finds single suffixes that can jailbreak LLMs across many different malicious instructions, achieving over 80% success rates.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly powerful but also vulnerable to "jailbreaking" – prompts designed to make them produce harmful, unethical, or otherwise undesirable content, bypassing their safety mechanisms. Existing methods often require access to internal model details (like logits) or rely on manually crafted prompts, limiting their applicability and effectiveness in real-world, black-box scenarios. This paper addresses the need for a black-box attack that can automatically discover adversarial prompts, specifically focusing on appending "suffixes" to malicious instructions, and can generalize across various instructions and models.

Methods

QROA frames the jailbreaking problem as a reinforcement learning (RL) task, specifically a multi-armed bandit problem. The core idea is to optimize an adversarial suffix (the "action") to maximize a "harmfulness" score (the "reward") when appended to a malicious instruction.

Key techniques include:

  • Query-Response Only Interface: QROA operates solely through the standard input/output of LLMs, requiring no access to internal model states or gradients.
  • Surrogate Model: A small neural network is trained to predict the effectiveness of potential suffixes, significantly reducing the need for computationally expensive direct LLM queries.
  • Deep Q-Learning with Experience Replay: The surrogate model learns from past interactions (suffix-score pairs) stored in a memory buffer, enabling efficient exploration and exploitation of the suffix space.
  • Universal Suffix Optimization (QROA-UNV): This extension aims to find a single suffix that is effective across a wide range of malicious instructions, enabling one-query jailbreaks.
  • Statistical Validation: A z-test is used to statistically confirm that discovered suffixes achieve a desired attack success rate with a given confidence level.

Datasets

  • AdvBench: A benchmark containing 500 instances of harmful behaviors.
  • HarmBench: Another dataset for evaluating LLM safety.
  • The authors randomly selected 50 behaviors from these datasets for their analysis.

Key Insights and Ideas

  • Suffixes as a Powerful Attack Vector: Appending carefully crafted suffixes can be a highly effective way to bypass LLM safety mechanisms, even without internal model access.
  • RL for Black-Box Optimization: Framing the search for adversarial suffixes as a reinforcement learning problem, specifically a bandit problem, allows for efficient exploration and exploitation in a black-box setting.
  • Surrogate Models are Crucial: Using a surrogate model dramatically reduces computational costs by pre-screening potential suffixes before querying the target LLM.
  • Universality is Achievable: The QROA-UNV extension demonstrates that it's possible to find single adversarial suffixes that generalize across a broad set of malicious instructions, making attacks more efficient and potent.
  • Alignment Function Choice Matters: The effectiveness of the attack is significantly influenced by the choice of the alignment function used to score the LLM's output.

Key Results

  • High Attack Success Rates (ASR): QROA achieved ASRs exceeding 80% on multiple LLMs (Vicuna, LLama2-chat, Mistral-Large, GPT-3.5, GPT-4) within practical query budgets.
  • QROA-UNV Effectiveness: The universal suffix version demonstrated strong performance, enabling one-query jailbreaks on unseen instructions. For example, on Vicuna-7B, QROA-UNV achieved 90% ASR on unseen instructions.
  • Robustness to Defenses: QROA showed adaptability, maintaining a significant ASR (58%) even when tested against a perplexity-based defense mechanism.
  • Efficiency: QROA significantly outperforms methods like TAP and PAIR in terms of query cost and efficiency, especially when using LLMs for evaluation.

Limitations and Future Work

  • Alignment Function Dependency: The effectiveness of QROA relies heavily on the accuracy and appropriateness of the chosen alignment function. If the function doesn't accurately capture malicious intent, the attack may fail.
  • Computational Intensity: While QROA is more efficient than some alternatives, the process of generating, evaluating, and refining suffixes can still be computationally intensive.
  • Future Work: The authors suggest exploring richer surrogate models that can utilize more context and prompt information. They also propose using the QROA framework to improve LLM safety by filtering adversarial suffixes before they can be exploited.

Summary updated

BibTeX
@inproceedings{jawad2024towards,
  author = {Hussein Jawad and Yassine Chenik and Nicolas J-B. Brunel},
  title = {{Towards Universal and Black-Box Query-Response Only Attack on LLMs with QROA}},
  booktitle = {SPIRE},
  year = {2024},
  doi = {10.48550/arxiv.2406.02044},
}
Figure