Skip to main content
QUICK REVIEW

[Paper Review] Tree of Attacks: Jailbreaking Black-Box LLMs Automatically

Anay Mehrotra, Manolis Zampetakis|arXiv (Cornell University)|Dec 4, 2023
Topic ModelingComputer Science22 citations
TL;DR

The paper introduces TAP, an automatic, black-box jailbreaking method that uses tree-of-thought reasoning and pruning to generate semantically meaningful prompts, achieving higher jailbreak success with fewer queries than prior work.

ABSTRACT

While Large Language Models (LLMs) display versatile functionality, they continue to generate harmful, biased, and toxic content, as demonstrated by the prevalence of human-designed jailbreaks. In this work, we present Tree of Attacks with Pruning (TAP), an automated method for generating jailbreaks that only requires black-box access to the target LLM. TAP utilizes an attacker LLM to iteratively refine candidate (attack) prompts until one of the refined prompts jailbreaks the target. In addition, before sending prompts to the target, TAP assesses them and prunes the ones unlikely to result in jailbreaks, reducing the number of queries sent to the target LLM. In empirical evaluations, we observe that TAP generates prompts that jailbreak state-of-the-art LLMs (including GPT4-Turbo and GPT4o) for more than 80% of the prompts. This significantly improves upon the previous state-of-the-art black-box methods for generating jailbreaks while using a smaller number of queries than them. Furthermore, TAP is also capable of jailbreaking LLMs protected by state-of-the-art guardrails, e.g., LlamaGuard.

Motivation & Objective

  • Motivate the study of automatic, black-box jailbreaking to understand LLM safety limits and alignment vulnerabilities.
  • Develop a query-efficient method to generate jailbreaking prompts without model internals access.
  • Leverage tree-of-thought reasoning and pruning to explore a large prompt space while reducing unnecessary queries.
  • Evaluate TAP on a diverse set of target LLMs and compare to state-of-the-art baselines.
  • Analyze factors such as pruning, tree-of-thoughts, evaluator choice, and transferability of attacks.

Proposed method

  • TAP uses three LLMs: an attacker to generate jailbreaking prompts, an evaluator to judge jailbreak success and on-topic relevance, and a target LLM to be jailbroken.
  • Prompts are refined in a tree structure with a depth d, width w, and branching factor b using tree-of-thought reasoning.
  • Phase 1 pruning removes off-topic prompts before querying the target, reducing wasted queries.
  • Phase 2 pruning keeps the top-w prompts by evaluator scores to form the next layer of the tree.
  • The process repeats until a jailbreak is found or the maximum depth is reached, with the total target queries bounded by a function of b, w, and d.
  • The method is a generalization of PAIR, with improvements from tree-of-thought reasoning and pruning to reduce redundancies and off-topic prompts.

Experimental results

Research questions

  • RQ1Can automatic, black-box jailbreaking be effectively achieved with a query-efficient search over semantically meaningful prompts?
  • RQ2Do tree-of-thought reasoning and on-topic pruning improve jailbreak success rate and reduce the number of queries to the target model?
  • RQ3How does TAP compare to PAIR and other baselines across a range of target LLMs?
  • RQ4What is the impact of evaluator choice and pruning on Jailbreak success and query efficiency?
  • RQ5Is there transferability of generated jailbreak prompts across different LLMs?

Key findings

  • TAP finds jailbreaks for a significantly larger fraction of prompts than PAIR across target models.
  • On GPT4-Turbo, TAP jailbreaks 84-90% of prompts with substantially fewer queries than PAIR (e.g., 22.5–28.8 average queries).
  • Pruning off-topic prompts (Phase 1) substantially reduces total target queries and improves success rate.
  • Tree-of-thought branching (nonzero b) substantially improves success rate over single-branch variants.
  • Evaluator power matters; using GPT-4 as evaluator yields better performance than some alternatives, with open problems remaining for optimal evaluator choice.
  • Transferability: many TAP-generated jailbreaks transfer to other models, with notable exceptions like Llama-2-Chat-7B.

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.