Skip to main content
QUICK REVIEW

[Paper Review] Jailbreaking Black Box Large Language Models in Twenty Queries

Patrick Chao, Alexander Robey|arXiv (Cornell University)|Oct 12, 2023
Topic ModelingComputer Science45 citations
TL;DR

PAIR automatically generates semantic jailbreak prompts for target LLMs using a black-box attacker, often finding jailbreaks within twenty queries and transferring to other models.

ABSTRACT

There is growing interest in ensuring that large language models (LLMs) align with human values. However, the alignment of such models is vulnerable to adversarial jailbreaks, which coax LLMs into overriding their safety guardrails. The identification of these vulnerabilities is therefore instrumental in understanding inherent weaknesses and preventing future misuse. To this end, we propose Prompt Automatic Iterative Refinement (PAIR), an algorithm that generates semantic jailbreaks with only black-box access to an LLM. PAIR -- which is inspired by social engineering attacks -- uses an attacker LLM to automatically generate jailbreaks for a separate targeted LLM without human intervention. In this way, the attacker LLM iteratively queries the target LLM to update and refine a candidate jailbreak. Empirically, PAIR often requires fewer than twenty queries to produce a jailbreak, which is orders of magnitude more efficient than existing algorithms. PAIR also achieves competitive jailbreaking success rates and transferability on open and closed-source LLMs, including GPT-3.5/4, Vicuna, and Gemini.

Motivation & Objective

  • Motivate and enable rapid evaluation of LLM alignment by stress-testing with automated jailbreaks.
  • Develop a scalable, human-interpretable prompt-level jailbreak method that minimizes human input.
  • Enable black-box interaction between attacker and target LLMs to discover jailbreaks efficiently.
  • Assess transferability of prompts across multiple open- and closed-source LLMs.

Proposed method

  • Introduce PAIR, which pits an attacker LLM against a target LLM in a fully automated loop.
  • Use an attacker system prompt and chat history to iteratively refine candidate jailbreak prompts.
  • Evaluate candidate prompts with a JUDGE function powered by an LLM to score jailbreaks from 1 to 10.
  • Parallelize the search with multiple streams to balance breadth and depth of exploration.
  • Choose Vicuna-13B-v1.5 as the attacker for its balance of expressivity and safety alignment.
  • Operate entirely with black-box access, enabling use without model weights or GPUs.
Figure 1 : Schematic of PAIR. PAIR pits an attacker and target language model against one another, where the attacker model aims to generate adversarial prompts that jailbreak the target model. The generated prompt $P$ is input into the target model to generate response $R$ . The attacker model uses
Figure 1 : Schematic of PAIR. PAIR pits an attacker and target language model against one another, where the attacker model aims to generate adversarial prompts that jailbreak the target model. The generated prompt $P$ is input into the target model to generate response $R$ . The attacker model uses

Experimental results

Research questions

  • RQ1Can PAIR discover semantic, prompt-level jailbreaks with black-box access to target LLMs?
  • RQ2How does PAIR perform in terms of jailbreak success rate and query efficiency across open- and closed-source models?
  • RQ3What is the transferability of PAIR-generated jailbreak prompts to other LLMs?
  • RQ4How do attacker choice and system prompts affect PAIR’s effectiveness?
  • RQ5What are the trade-offs in using parallel streams and iteration depth for jailbreak discovery?

Key findings

  • PAIR often finds jailbreaks in under twenty queries to the target LLM.
  • PAIR achieves high jailbreak rates on several models, including GPT-3.5/4, Vicuna, and PaLM-2.
  • PAIRS’ attacks transfer to other models more effectively when prompts are semantically grounded.
  • Compared to GCG, PAIR uses orders of magnitude fewer queries (up to five orders) and is faster.
  • Attacker model choice and system prompt design significantly impact jailbreak success and efficiency.
  • Transferability is strong for Vicuna prompts to GPT-4 and PaLM-2 but limited for Claude models.
Figure 2 : Example of a prompt-level jailbreak from PAIR and token-level jailbreak from GCG.
Figure 2 : Example of a prompt-level jailbreak from PAIR and token-level jailbreak from GCG.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.