Skip to content
All papers

Jailbroken: How Does LLM Safety Training Fail?

UC BerkeleyWei, Haghtalab and Steinhardt, 202312 min readarXiv 2307.02483Read the paper2023-07

Wei, Haghtalab and Steinhardt explain why safety-trained chat models can be jailbroken using two failure modes: competing objectives, where the model's drive to be helpful or follow instructions conflicts with its safety training, and mismatched generalization, where safety training does not cover inputs the model's capabilities do. Attacks designed from these two principles succeeded against GPT-4 and Claude v1.3 on most of the authors' red-teaming prompts, and the authors argue that scaling alone will not fix this.

Ready to ace your system design interview?

This article is just one piece. StackSweep gives you structured, interview-focused practice across every topic that comes up in senior engineering rounds.

  • 1,000+ quiz questions across system design and ML/AI
  • Spaced repetition to lock in what you learn
  • Full case study walkthroughs of real interview topics
  • Track streaks, XP, and progress over time

TL;DR

  • Jailbreaks are not random tricks: most fall into two failure modes of safety training, competing objectives and mismatched generalization.
  • Competing objectives: pretraining and instruction-following push the model to continue and comply, safety training pushes it to refuse, and a prompt can set these against each other.
  • Mismatched generalization: capabilities learned in pretraining (such as reading encoded or unusual formats) extend to inputs that safety training never covered.
  • The authors report that attacks built from these principles, especially combinations, succeeded on a large majority of curated harmful prompts against GPT-4 and Claude v1.3.
  • They argue for "safety-capability parity": safety mechanisms must be as capable as the model, since more capable models open new attack surface that safety training must also cover.

Why this paper matters

This paper gives the standard vocabulary for explaining why safety training is brittle, and the two failure modes appear in almost every discussion of jailbreak defenses. A research engineer should be able to classify a new attack into one of them and say what kind of defense each calls for.

Breakdown

1.Why a taxonomy of failures matters

By mid 2023, chat models like GPT-4 and Claude had been trained with RLHF and other safety methods to refuse harmful requests. Yet users kept finding prompts that bypassed those refusals, and these jailbreaks were patched one at a time.

Wei, Haghtalab and Steinhardt ask a more useful question: why does safety training fail at all? If the failures have a common structure, you can predict new attacks, evaluate defenses more systematically, and reason about whether the problem gets better or worse as models scale.

They propose that most jailbreaks exploit one of two failure modes, then use those failure modes to design new attacks and evaluate them against state-of-the-art models. The goal is not to publish a list of working jailbreaks, but to show that the vulnerabilities follow from how models are trained.

This framing has held up well. Later attacks, from optimized adversarial suffixes to many-shot prompting and low-resource-language attacks, are usually discussed in terms of these two categories.

Discussion angle: A good discussion starter: "Is a taxonomy with two categories useful, or is it too coarse?" Strong answers argue it is useful because each category implies a different defense, and then name attacks that sit in both categories at once, which is common in practice.

2.Failure mode 1: competing objectives

A chat model is trained with several objectives that usually agree. Pretraining makes it good at continuing text. Instruction tuning makes it follow user instructions. Safety training makes it refuse certain requests. Competing objectives jailbreaks construct a prompt where these objectives conflict, and the non-safety objectives win.

The authors describe several attack patterns in this family, at a conceptual level. Prefix injection asks the model to begin its answer in a particular compliant-sounding way. Once the start of the response is fixed, continuing it naturally is strongly favored by pretraining, and a refusal would be an unlikely continuation. Refusal suppression gives the model instructions that rule out the typical phrases and structure of a refusal, so following instructions and refusing become incompatible. Role-play style attacks frame the request as a character or game whose rules call for compliance.

In each case the model is not confused about the content. It understands the request. It is choosing between learned tendencies that have been put in tension, and safety training was not strong enough to dominate in that region of input space.

Discussion angle: Interviewers ask: "Why does fixing the first few tokens of the output matter so much?" Because autoregressive models condition on their own previous output, and refusals in training data almost always start at the very beginning of a response. Once the response starts another way, the learned refusal behavior has little to attach to. This also motivates defenses that train refusals deeper into responses.

3.Failure mode 2: mismatched generalization

Pretraining covers a vast range of inputs: many languages, encodings, formats and styles. Safety training uses a far smaller, narrower dataset, mostly in plain English with ordinary phrasing. Mismatched generalization jailbreaks find inputs where the model's capabilities generalize but its safety training does not.

The clearest example in the paper is encoding the request in a format like Base64. A capable model can decode and respond to such inputs because it learned that during pretraining. But the safety training data contained few or no examples of harmful requests in that format, so the refusal behavior does not trigger. The authors describe other obfuscations in the same family, such as character-level transformations, unusual languages and replacing sensitive words with synonyms or placeholders.

A striking observation follows: some of these attacks only work on more capable models. The authors report that GPT-3.5 Turbo could not reliably follow Base64 encoded instructions, so the attack did not work, while GPT-4 could, so it did. Greater capability opened a new attack surface that safety training had not covered.

Discussion angle: The natural follow-up is "can you fix this by adding the encodings to the safety data?" You can patch each known one, but the space of transformations a capable model understands is huge and grows with capability. That is the argument for defenses that operate on meaning, such as classifiers on decoded content or representation-level methods, rather than on surface form.

4.Evaluation and results

The authors evaluate mainly against GPT-4 and Claude v1.3, the strongest safety-trained models at the time, with the smaller GPT-3.5 Turbo as a comparison. They use two prompt sets: a small curated set of harmful requests drawn from the labs' own red-teaming examples, and a larger synthetic set, held out from the authors until after data collection, to check that the attacks were not tuned to the curated prompts. The authors label responses by hand into three classes: the model refused, the model gave an on-topic response to the harmful request, or the outcome was unclear. They note this scheme does not score the quality or accuracy of a compliant answer.

They test many individual attacks built from the two failure modes, plus combinations that stack several techniques. The authors report that the strongest combination attacks succeeded on a large majority of the curated prompts for both models, with similar rates on the held-out synthetic set, and that an adaptive attacker (counted as successful if any of the tested attacks works on a prompt) succeeded on nearly all of them.

Individual attacks vary widely, and targeted patching shows its limits. Claude v1.3, which appears to have been trained against role-play jailbreaks, refused every role-play attack, including popular ones that worked on GPT-4, yet it was still vulnerable to other strategies. The combinations were consistently strongest, which matches the theory: stacking a competing-objectives attack and a mismatched-generalization attack attacks both weaknesses at once.

The results are a snapshot of specific model versions in 2023. Both labs have since changed their safety training, so individual success rates are not current. The mechanisms are what has lasted.

Discussion angle: Ask about evaluation: manual labels are high quality but hard to scale, and "jailbroken" can mean anything from a vague answer to genuinely harmful content. Later benchmarks such as HarmBench standardized this with fixed behavior sets and trained classifiers. When you see a jailbreak success rate, ask how success was judged.

5.Safety-capability parity and implications

The paper's main conceptual conclusion is that scaling will not fix these failures by itself. Competing objectives are built into the training process: as long as a model is trained to be helpful and instruction-following, there will be prompts that set those goals against refusal. Mismatched generalization gets worse with scale: more capable models understand more formats and languages, and each is a place safety training must also reach.

The authors propose safety-capability parity: safety mechanisms should be as sophisticated as the model they protect. A simple filter in front of a highly capable model will miss attacks that the model itself can understand. In practice this has pushed the field toward approaches such as using capable models as input and output classifiers, training refusals that hold deeper into a response, and representation-level defenses.

The broader lesson for safety research is that behavioral training shapes a model's outputs on the distribution it was trained on. It does not guarantee anything about inputs outside that distribution. Jailbreaks are the most visible demonstration of this, and the same concern applies to more serious failures.

Discussion angle: A good question: "What would safety-capability parity look like for an agent with tool use?" Expect discussion of monitors that are as capable as the agent, the cost of running them, and the risk that the monitor shares the agent's blind spots if it is the same model. This connects jailbreak research to AI control.

Reading the evidence

What it shows

  • Many jailbreaks can be explained by two failure modes: competing objectives and mismatched generalization.
  • Attacks designed from these principles, especially combinations, bypassed safety training in GPT-4 and Claude v1.3 on most of the authors' curated harmful prompts.
  • Some attacks succeed only on more capable models, because they rely on capabilities like decoding unusual formats.
  • Patching individual attacks does not address the underlying failure modes.

What it does not show

  • That these specific attacks still work on current models; the results are a snapshot of 2023 versions.
  • That every jailbreak fits neatly into one of the two categories; many use both.
  • How much real-world harm jailbroken outputs enable; the evaluation measures whether the model complied, not the uplift of the content.
  • That safety-capability parity is achievable in practice or what it would cost.

The most boring explanation

A deflationary reading is that safety training is simply a thin layer applied to a narrow dataset, so of course it fails on unusual inputs, and the taxonomy just names that. The authors largely agree with this as a description, but argue the framing is still useful because it predicts which new attacks will work (for example, that new capabilities create new gaps) and implies scaling will not close them. They do not claim the failures reveal anything about model intentions.

Key Concepts

Jailbreak

An input that causes a safety-trained model to produce content its training was meant to make it refuse.

Competing objectives

A failure mode where a prompt puts the model's helpfulness, instruction-following or text-continuation tendencies in conflict with its safety training, and the safety objective loses.

Analogy: An employee trained both to "always satisfy the customer" and "never give out the safe code". A customer who frames the request cleverly can make the first rule feel more pressing than the second.

Mismatched generalization

A failure mode where the model's capabilities extend to inputs (encodings, languages, formats) that safety training did not cover, so refusals do not trigger.

Analogy: A security guard trained to stop people carrying a visible bag, who waves through the same item packed in an unfamiliar box. The guard can see the box fine; they were just never taught it matters.

Prefix injection

Conceptually, an attack that constrains how the model's answer begins so that a refusal becomes an unlikely continuation.

Safety-capability parity

The principle that safety mechanisms must be as capable as the model they protect, since a weaker safeguard cannot recognize attacks the model itself understands.

Analogy: A spam filter that only reads English cannot protect an inbox owner who reads ten languages.

Combination attack

An attack that stacks techniques from both failure modes, which the authors found to be the most effective category.

Knowledge Check

10 questions — your answers are saved locally so you can come back anytime.