Skip to main content
QUICK REVIEW

[Paper Review] Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attacks

Maksym Andriushchenko, Francesco Croce|arXiv (Cornell University)|Apr 2, 2024
Information and Cyber SecurityComputer Science7 citations
TL;DR

The paper shows that safety-aligned LLMs are highly vulnerable to simple adaptive jailbreaking attacks leveraging prompts, random search on logprobs, self-transfer, and prefilling, achieving near-perfect jailbreak success on many models. It provides code and practical guidance for adaptive attack construction.

ABSTRACT

We show that even the most recent safety-aligned LLMs are not robust to simple adaptive jailbreaking attacks. First, we demonstrate how to successfully leverage access to logprobs for jailbreaking: we initially design an adversarial prompt template (sometimes adapted to the target LLM), and then we apply random search on a suffix to maximize a target logprob (e.g., of the token "Sure"), potentially with multiple restarts. In this way, we achieve 100% attack success rate -- according to GPT-4 as a judge -- on Vicuna-13B, Mistral-7B, Phi-3-Mini, Nemotron-4-340B, Llama-2-Chat-7B/13B/70B, Llama-3-Instruct-8B, Gemma-7B, GPT-3.5, GPT-4o, and R2D2 from HarmBench that was adversarially trained against the GCG attack. We also show how to jailbreak all Claude models -- that do not expose logprobs -- via either a transfer or prefilling attack with a 100% success rate. In addition, we show how to use random search on a restricted set of tokens for finding trojan strings in poisoned models -- a task that shares many similarities with jailbreaking -- which is the algorithm that brought us the first place in the SaTML'24 Trojan Detection Competition. The common theme behind these attacks is that adaptivity is crucial: different models are vulnerable to different prompting templates (e.g., R2D2 is very sensitive to in-context learning prompts), some models have unique vulnerabilities based on their APIs (e.g., prefilling for Claude), and in some settings, it is crucial to restrict the token search space based on prior knowledge (e.g., for trojan detection). For reproducibility purposes, we provide the code, logs, and jailbreak artifacts in the JailbreakBench format at https://github.com/tml-epfl/llm-adaptive-attacks.

Motivation & Objective

  • Demonstrate the vulnerability of leading safety-aligned LLMs to adaptive jailbreaking tactics.
  • Develop a universal prompt template plus simple optimization (random search) to maximize jailbreak success.
  • Show model-specific vulnerabilities and transferability of jailbreaks across models and APIs.
  • Provide practical recommendations and open-source tools to evaluate and stress-test LLM safety.

Proposed method

  • Design universal adversarial prompt templates tailored per model family.
  • Apply random search on constrained token suffixes to maximize a target logprob (e.g., ‘Sure’).
  • Use self-transfer by reusing adversarial suffixes across related, harder prompts.
  • Employ prefilling attacks for Claude models to bypass logprob access constraints.
  • For Claude, leverage transfer from GPT-4 suffixes and multiple restarts; for R2D2, use an in-context prompt with random search.
  • Provide code, prompts, and attack logs at the authors’ GitHub repository.

Experimental results

Research questions

  • RQ1Can safety-aligned LLMs be reliably jailbroken using adaptive prompts and simple optimization when logprobs or prefilling are available?
  • RQ2How transferable are jailbreaks across model families and sizes, and what model-specific vulnerabilities exist?
  • RQ3Does a combination of prompting, random search, self-transfer, and prefilling yield near-100% jailbreak success on leading models?
  • RQ4What are the practical implications for evaluating safety and robustness of frontier LLMs?
  • RQ5What open-source tooling can reproduce and extend these adaptive attacks?

Key findings

  • Adaptive attacks achieve near-100% jailbreak success on several models (GPT-3.5/4, Llama-2-Chat variants, Gemma, R2D2, Claude family) using a universal template plus random search and transfers.
  • Prompt templates alone can yield very high success on some models (e.g., 100% on GPT-3.5 Turbo), while adding random search and self-transfer increases effectiveness on others (e.g., 96% on GPT-4 Turbo).
  • Llama-2-Chat and Gemma require self-transfer to reach full success; R2D2 relies on in-context prompting with random search; Claude models enable prefilling or transfer-based jailbreaks to achieve high success even without logprobs.
  • GPT-3.5 Turbo is highly brittle to prompts; GPT-4 Turbo shows stronger resistance but is overcome with prompt+RS+self-transfer (96%).
  • Claude models show strong robustness to static prompts but are vulnerable to transfer from GPT-4 and to prefilling (100% ASR in several cases).
  • The Trojan detection competition results illustrate that RS on token pools can rival or approach true trojans in backdoor discovery.

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.