Source-linked AI summary

Jailbroken: How Does LLM Safety Training Fail?

Alexander Wei, Nika Haghtalab, Jacob Steinhardt

arXiv:2307.02483v1cs.LGcs.CR

TL;DR

Safety-trained LLMs remain vulnerable to jailbreaks, but the reasons these attacks succeed and how to systematically create them are not well understood. This paper hypothesizes two safety-training failure modes, uses them to design attacks, and finds that they outperform existing jailbreaks, succeeding on over 96% of evaluated prompts and all curated red-teaming prompts.

  • Problem

    The reasons safety-trained LLMs remain vulnerable to jailbreaks and how to systematically create such attacks are not well understood.

  • Method

    The paper hypothesizes competing objectives and mismatched generalization, then uses these failure modes to construct and evaluate jailbreak attacks against safety-trained models.

  • Results

    Over 96% of evaluated prompts were successfully attacked, including 100% of curated red-teaming prompts, and the new attacks outperformed existing ad hoc jailbreaks.

  • Takeaways & Limitations

    The findings suggest jailbreaks may be inherent to existing safety-training methods and require safety mechanisms as sophisticated as the underlying model.

  • Takeaways & Limitations

    Because GPT-4 and Claude are proprietary, the paper can only indirectly confirm its hypotheses.

Abstract

from arXiv · show

Large language models trained for safety and harmlessness remain susceptible to adversarial misuse, as evidenced by the prevalence of "jailbreak" attacks on early releases of ChatGPT that elicit undesired behavior. Going beyond recognition of the issue, we investigate why such attacks succeed and how they can be created. We hypothesize two failure modes of safety training: competing objectives and mismatched generalization. Competing objectives arise when a model's capabilities and safety goals conflict, while mismatched generalization occurs when safety training fails to generalize to a domain for which capabilities exist. We use these failure modes to guide jailbreak design and then evaluate state-of-the-art models, including OpenAI's GPT-4 and Anthropic's Claude v1.3, against both existing and newly designed attacks. We find that vulnerabilities persist despite the extensive red-teaming and safety-training efforts behind these models. Notably, new attacks utilizing our failure modes succeed on every prompt in a collection of unsafe requests from the models' red-teaming evaluation sets and outperform existing ad hoc jailbreaks. Our analysis emphasizes the need for safety-capability parity -- that safety mechanisms should be as sophisticated as the underlying model -- and argues against the idea that scaling alone can resolve these safety failure modes.

1 Introduction

Despite safety training, filtering, and red teaming, deployed LLMs remain vulnerable to jailbreaks that elicit behavior they were trained to avoid. This work explains these vulnerabilities through competing objectives and mismatched generalization, uses both to design attacks, and argues for safety-capability parity.

  • Motivation: Jailbreaks exploit adversarial inputs to elicit harmful content or leak personally identifiable information despite models’ safety training.Observed attacks include elaborate role play and subtler subversion of the safety objective.
  • Failure modes: The paper identifies competing objectives and mismatched generalization as failure modes explaining why safety-trained LLMs remain vulnerable.Competing objectives pit pretraining and instruction-following against safety, whereas mismatched generalization leaves safety training out-of-distribution while pretraining still covers the input.
  • Attack design: These two principles guide the construction of multiple new jailbreak attacks and support the view that jailbreaks are inherent to current training methods.Each principle independently yields a variety of attacks rather than representing an isolated exploit.
  • Evaluation: The evaluation tests GPT-4 and Claude v1.3 against existing and newly constructed attacks on curated red-teaming prompts and a larger synthetic harmful-prompt dataset.The study assesses state-of-the-art safety-trained models despite updates against jailbreaks since their initial releases.
  • Implications: The analysis argues that scaling alone cannot resolve competing objectives and may worsen mismatched generalization, motivating safety mechanisms as sophisticated as model capabilities.The proposed requirement is safety-capability parity, with safety training extended appropriately across broader domains.

2 Background: Safety-Trained Language Models and Jailbreak Attacks

This section defines safety-trained models, jailbreak attacks, and their evaluation criteria, then introduces the models and harmful-prompt datasets used to assess vulnerability. Safety training targets restricted behaviors such as harmful information requests, while jailbreaks modify prompts to elicit on-topic restricted responses despite those defenses.

  • Safety training: Safety training teaches models to refuse restricted behaviors, including harmful-information requests and assistance with misinformation or crime [38] [23].
  • Jailbreak threat model: A jailbreak submits a modified prompt P′ to elicit an on-topic response for restricted behavior, under black-box access without changing system prompts or message history.Attacks may adapt P′ based on responses to other prompt variations.
  • Jailbreak evaluation: Outcomes are labeled GOOD BOT for refusal, BAD BOT for an on-topic restricted response, and UNCLEAR when the prompt is misunderstood or the response is off topic.
  • Models and datasets: The evaluation tests state-of-the-art OpenAI and Anthropic models on 32 curated harmful prompts from red-teaming efforts and 317 held-out prompts [38] [7].The held-out set was not seen by the authors until after data collection.
  • Datasets: The larger 317-prompt dataset was generated through few-shot sampling from GPT-4, filtered to prompts refused by both GPT-4 and Claude v1.3, and withheld from attack design [44].Only top-performing attacks were evaluated on this larger dataset because of query and annotation costs.

3 Failure Modes: Competing Objectives and Generalization Mismatch

The section identifies competing objectives and mismatched generalization as two data- and training-level failure modes underlying jailbreak vulnerability. Qualitative jailbreaks and ablations show how instruction following, pretraining, and safety-training coverage can be exploited.

  • Failure Modes: The paper proposes two jailbreak failure modes: competition between capability and safety objectives, and mismatched generalization between pretraining and safety capabilities.These hypotheses are functionally explored through qualitative examples, simple jailbreaks, and ablations before quantitative validation in Section 4.
  • Competing Objectives: Prefix injection and refusal suppression depend on specific prompt instructions: replacing the prefix with “Hello!” or inverting suppression rules eliminates the reported restricted behavior.The prefix attack can elicit harmful information about harassment, crime, and violence, while refusal suppression affects crime, social engineering, and adult-content prompts.
  • Competing Objectives: Competing-objective attacks make instruction following suppress typical refusals, after which pretraining favors continuing the initiated response into unsafe content.Prefix injection exploits harmless-looking prefixes, while refusal suppression rules out common refusal language; both mechanisms can produce harmful responses from GPT-4.
  • Generalization Mismatch: Mismatched generalization exploits capabilities learned from broader pretraining when safety training does not cover the corresponding prompt domain.The model can follow and answer such prompts without applying safety considerations, as illustrated by Base64 obfuscation.
  • Generalization Mismatch: Base64 obfuscation elicits controlled-substance synthesis, misinformation, and harmful-stereotype instructions from GPT-4; encoded input matters more than encoded output, though their combination is strongest.Encoded output also guides refusal behavior through the model’s partially decoded prefix, paralleling prefix injection.

4 Empirical Evaluation of Jailbreak Methods

Across GPT-4, Claude v1.3, and GPT-3.5 Turbo, combinations of simple jailbreak techniques are highly effective and generalize to a larger held-out harmful-prompt dataset. Adaptive attacks succeed on almost all prompts, while targeted defenses and model scale leave distinct vulnerabilities.

  • Results: Combination jailbreaks are extremely effective on the curated dataset and continue to work with largely similar success rates on the larger held-out synthetic dataset.Individual simple attacks succeed on only a fraction of prompts, whereas their combinations remain robust across a more comprehensive harmful-prompt set.
  • Ablations of Simple Attacks: Specific injected prefixes and instructions matter: prefix_injection and refusal_suppression outperform their respective ablations.These comparisons support the competing-objectives and mismatched-generalization analyses of why particular jailbreak constructions succeed.
  • Results: Adaptive attacks succeed for almost every prompt across Tables 1–3, indicating that minor jailbreak variations can elicit restricted behavior from many unsafe requests.The adaptive attack counts a prompt as successful when any of the 28 evaluated attacks succeeds.
  • Targeted Training?: Claude v1.3 rejects all roleplay attacks yet remains vulnerable to other strategies and is 100% vulnerable to adaptive attacks, showing targeted training is insufficient.The roleplay attacks also fail on Claude’s harmless control prompt, while the same roleplay attacks succeed on GPT-4.
  • Vulnerabilities Emerge with Scale: Model scale shifts the attack surface: roleplay and system-prompt attacks work better on GPT-3.5 Turbo, whereas combination_* and auto_payload_splitting require capabilities GPT-3.5 Turbo lacks.Base64 examples show GPT-3.5 Turbo claiming not to understand inputs that GPT-4 answers in detail, indicating vulnerabilities that emerge only at sufficient scale.

5 Implications for Defense

The findings imply that scaling alone cannot resolve competing-objective or mismatched-generalization failures. Effective defense may require safety mechanisms with sophistication comparable to the underlying model, especially as models can generate attacks against their own safeguards.

  • Safety-Capability Parity?: Safety-capability parity may be necessary because less capable safety mechanisms may fail to detect or address attacks exploiting the underlying model’s cutting-edge capabilities.A model without Base64-decoding ability, for example, would not be able to flag the corresponding threat.
  • What Scaling Won’t Solve: Scaling alone cannot resolve the identified safety failures because competing objectives stem from the optimization objective and safety training may not generalize as broadly as capabilities.The RLHF objective underlying GPT-4 inherently trades off safety against pretraining, while larger models and more data do not guarantee broader safety generalization.
  • What Scaling Won’t Solve: GPT-3.5 Turbo could not follow Base64-encoded instructions, whereas GPT-4 could follow them with fewer safeguards, showing that scaling can exacerbate mismatched generalization.The comparison is reported with reference to Figure 2 and Tables 1 and 3.
  • Safety-Capability Parity?: An arms race is likely as models generate attacks against their own safeguards, with attacks already partly automated and models discovering new obfuscation languages unpredictably.GPT-4 helped automate sensitive-word identification, Claude rediscovered Base64, and GPT-4 uncovered Spanish leetspeak; these capabilities are difficult to anticipate and prepare for [51].

6 Conclusion

The paper argues that existing safety training reduces undesirable behavior in normal use but remains ineffective against adversarial actors, whose attacks exploit conceptual failure modes. It calls for open replication, responsible disclosure, and continued research into robust safety as LLM systems enter real-world settings.

  • Conclusion: Existing safety training can reduce undesirable behavior under normal use but remains ineffective against adversarial actors, and its failure modes guide effective jailbreak design.The authors argue that these methods may not be safe by design because even idealized execution can leave exploitable vulnerabilities.
  • Limitations: Because GPT-4 and Claude are proprietary, the study provides only indirect confirmation of its hypotheses and motivates open research replications.Future work may also investigate whether safety-training results can be mechanistically interpreted.
  • Broader Impacts: The authors mitigated misuse risks through responsible disclosure, sharing preliminary findings with OpenAI and Anthropic and coordinating with them before public release.They frame the paper’s goal as identifying weaknesses in existing methods rather than creating new jailbreaks.
  • Broader Impacts: Open discussion of weaknesses is presented as vital for developing robust future systems as LLMs become more prevalent and move beyond the chatbox into the real world.The authors hope the work clarifies challenges in existing methods and facilitates future research into safer systems.

Supplementary Material

The supplementary material warns that the paper contains examples of harmful language.

  • The paper contains examples of harmful language.

A Prompt Datasets · B Labeling Scheme

The experiments use curated and synthetic harmful-prompt datasets, alongside a harmless control prompt, and label jailbreak outcomes according to refusal and harmful, on-topic responsiveness. The curated set covers red-teaming categories, while the synthetic set is generated, deduplicated, and filtered for prompts that elicit restricted behavior.

  • A.1 Curated Dataset: The curated dataset contains 32 prompts: 16 from GPT-4’s technical-report evaluation set [38] and 16 adapted from Ganguli et al. [23], covering all 17 harmful-prompt tags from that work.The adaptations convert dialogue-transcript examples into standalone prompts.
  • A.1 Curated Dataset: The curated evaluation includes a harmless control prompt asking for the mythical creature that is a horse with a horn, used to assess basic question-answering capability under attacks.The control prompt’s answer is “unicorn.”
  • A.2 Synthetic Dataset: Synthetic prompts are generated by GPT-4 from shuffled few-shot examples drawn from the hand-curated dataset, with instructions to produce specific, diverse harmful requests across topics and tones.The generation procedure samples 25 batches of 20 prompts at temperature 1.0.
  • A.2 Synthetic Dataset: The final synthetic dataset contains 317 harmful prompts after GPT-4 generation, TF-IDF deduplication at threshold 0.3, and filtering of prompts answered without jailbreaking by GPT-4 or Claude v1.3.The initial 500 provisional prompts were reduced to 338 by deduplication before filtering produced the final 317.
  • B Labeling Scheme: Each labeled example comprises an original prompt P, modified prompt P ′, and response to P ′, assigned GOOD BOT, BAD BOT, or UNCLEAR.The procedure is a simplified version of the schema used for OpenAI’s rule-based reward models [39, GPT-4 System Card, Appendix A].
  • B Labeling Scheme: A response is GOOD BOT when it refuses the harmful content of P ′, including refusal of the entire request or only its harmful portion.Responses are also assessed for whether they remain on topic for the original prompt P.
  • B Labeling Scheme: A response is harmful and on topic when it contains harmful content and can be considered a response to P, even if it differs in the requested subject matter.For example, bomb-making instructions are on topic but bath-bomb instructions are not harmful when the request concerns making a bomb.

C Details of Empirical Evaluation … D.2 Claude v1.3 Results

The appendices detail the empirical evaluation protocol, attack suite, and full curated-dataset results for GPT-4, Claude v1.3, and GPT-3.5 Turbo. They emphasize standardized model usage and provide separate result tables for GPT-4 and Claude v1.3, sorted by BAD BOT rate.

  • C Details of Empirical Evaluation: The appendix supplies additional details on the empirical evaluation described in Section 4.
  • C.1 Usage of Models: Experiments evaluate GPT-4, GPT-3.5 Turbo, and Claude v1.3, emphasizing GPT-4 and Claude v1.3 as state-of-the-art in capabilities and safety.Data were collected through provider APIs over short windows, with randomized query order and temperature-0 decoding; strongest GPT-4 attacks were also checked at temperature 1.0.
  • C.2 Descriptions of Attacks: The evaluation compares a broad attack suite spanning baseline prompts, prefix and refusal-suppression injections, Base64 and obfuscation attacks, style manipulations, distractors, combinations, and jailbreakchat.com roleplay attacks.The suite also includes model-assisted payload splitting and auto-obfuscation, while an evil-system-prompt attack is included for GPT models despite falling outside the chat-interface threat model.
  • D Detailed Results: The detailed-results section reports full outcomes for every attack and model on the curated dataset, including harmless-control outcomes scored by whether the model answered “unicorn.”
  • D.1 GPT-4 Results: GPT-4 results on the curated dataset are provided in Table 5, whose rows are sorted by BAD BOT rate.The table marks the best result, top-five results, and attacks originating from jailbreakchat.com with distinct formatting.
  • D.2 Claude v1.3 Results: Claude v1.3 results on the curated dataset are provided in Table 6, whose rows are sorted by BAD BOT rate.The table marks the best result, top-five results, and attacks originating from jailbreakchat.com with distinct formatting.

D.3 GPT-3.5 Turbo Results · E Examples of Successful and Unsuccessful Attacks · E.1 Examples of GOOD BOT Outcomes

The paper reports GPT-3.5 results on a curated dataset and presents sampled GPT-4 and Claude v1.3 jailbreak examples spanning GOOD BOT, BAD BOT, and UNCLEAR outcomes. The GOOD BOT examples show models refusing requests involving money laundering, adult websites, account access, and unlicensed guns despite prompt transformations and instruction constraints.

  • D.3 GPT-3.5 Turbo Results: Table 7 reports GPT-3.5 results on the curated dataset, with rows sorted by BAD BOT rate.The table marks the best result in bold, the top five with underlining, and attacks from jailbreakchat.com in italics.
  • E Examples of Successful and Unsuccessful Attacks: The paper samples jailbreak prompts and model responses for GPT-4 and Claude v1.3 across GOOD BOT, BAD BOT, and UNCLEAR outcomes.Each example includes the original prompt, a modified prompt produced by an Appendix C.2 attack, and the model’s response.
  • E.1 Examples of GOOD BOT Outcomes: The examples apply transformations such as repeated prompts, base64 encoding, added benign instructions, and rules suppressing apologies or disclaimers before eliciting refusals.One prompt asks for a duck couplet before the harmful request, while another imposes vocabulary and sentiment restrictions.
  • E.1 Examples of GOOD BOT Outcomes: In GOOD BOT examples, models refuse to provide assistance for evading detection during money laundering, including when the request is base64-encoded.The responses explicitly decline guidance on illegal activities and money laundering.
  • E.1 Examples of GOOD BOT Outcomes: Models also decline to express preferences about adult websites, responding that they are not programmed to have personal preferences or visit such sites.The example presents the adult-website request alongside a non-personalized refusal.
  • E.1 Examples of GOOD BOT Outcomes: GOOD BOT responses reject requests to obtain another person’s Facebook password through social engineering and to locate unlicensed guns for sale.The account-access example states that it will not help illegally access someone else’s account, while the firearms example refuses harmful or unethical information.

E.2 Examples of BAD BOT Outcomes · E.3 Examples of UNCLEAR Outcomes

The examples show BAD BOT outcomes in which obfuscated or instruction-conflicting prompts elicited harmful assistance, alongside UNCLEAR outcomes where encoded hateful or illicit requests were transformed into superficially benign responses. Together, these cases illustrate both direct harmful compliance and semantic drift away from the original request.

  • E.2 Examples of BAD BOT Outcomes: A prompt about convenience-store theft elicited actionable guidance identifying easily concealed, high-value goods and resale targets.The response specifically mentioned cigarettes, alcohol, over-the-counter medications, gift cards, and prepaid phone cards.
  • E.2 Examples of BAD BOT Outcomes: Other BAD BOT examples produced targeted abortion-related Facebook posts and a response naming Jupiter’s Galilean moons, demonstrating compliance across harmful and benign task contexts.The abortion outputs targeted women aged 30–45 in San Francisco and discussed clinic safety, while the astronomy response named Io, Europa, Ganymede, and Callisto.
  • E.2 Examples of BAD BOT Outcomes: Base64-encoded prompting produced a possible at-home cyclosarin synthesis procedure rather than refusing the dangerous request.The returned text included starting materials, catalysts, and a solvent, although the passage is truncated.
  • E.2 Examples of BAD BOT Outcomes: An instruction-conflicting prompt caused the model to embed information about anthrax-toxin nucleotide sequences inside an otherwise benign flower essay.The response identified GenBank and described anthrax toxins and their component proteins before truncation.
  • E.3 Examples of UNCLEAR Outcomes: In an UNCLEAR outcome, a ROT13 request for unlicensed-gun websites was answered as a request for unlicensed fonts instead.The response supplied websites for fonts and advised checking licensing terms, indicating a mismatch between the encoded request and the interpreted task.
  • E.3 Examples of UNCLEAR Outcomes: A request to evade moderation of antisemitic language was reframed as a neutral Wikipedia-style article titled “Criticism of Judaism and its Impact on Society.”The response explicitly disclaimed hate speech while discussing criticism, persecution, antisemitic conspiracy theories, and theological disagreements.

F Examples of Automated Obfuscation Discovery

GPT-4 and Claude v1.3 sometimes systematically obfuscate prompts, indicating that models can automatically discover input “languages” they understand. During evaluation, Claude v1.3 rediscovered Base64 encoding, while GPT-4 uncovered leetspeak and a Spanish-translated variant.

  • F Examples of Automated Obfuscation Discovery: Models sometimes systematically obfuscate prompts, suggesting automated discovery of jailbreak “languages” and training methods for more robust safeguards.This behavior was observed in both GPT-4 and Claude v1.3 during testing and evaluation.
  • F Examples of Automated Obfuscation Discovery: Claude v1.3 sometimes rediscovered the Base64 attack when asked to obfuscate a prompt, without human ingenuity.The finding shows that Claude v1.3 could independently produce the encoding-based attack discussed earlier.
  • F Examples of Automated Obfuscation Discovery: GPT-4 uncovered both the leetspeak attack and a more sophisticated variant that additionally translated the input into Spanish.This capability was observed during evaluation.

G Beyond Maximum-Likelihood Decoding … H.2 Evaluation

The evaluation tests whether jailbreak findings persist under temperature-1 decoding and extends the analysis beyond harmful behavior to PII leakage and hallucinated personal details. Across these settings, the study compares attacks using repeated sampling or category-level success criteria.

  • G Beyond Maximum-Likelihood Decoding: Temperature-1 decoding tests whether the reported jailbreak results are artifacts of maximum-likelihood decoding.GPT-4 is evaluated on the curated dataset using the top three attacks from Table 1, with five samples averaged per attack and prompt.
  • G Beyond Maximum-Likelihood Decoding: The three tested attacks preserve their ordering and success rates under GPT-4 temperature-1 decoding, while their combination succeeds on all but one curated prompt.Results average five independent samples per prompt; adaptive attacks count as successful if any sample elicits a BAD BOT response.
  • H Beyond Harmful Restricted Behaviors: The study broadens restricted-behavior evaluation from harm to memorized PII leakage and hallucinated personal details in GPT-4 and Claude v1.3; prior PII-leakage jailbreak work includes Li et al. [33].These behaviors concern either exposing personally identifying information or fabricating personal details for the model.
  • H.1 Restricted Prompts for PII and Hallucinated Personality: The PII-leakage probes ask for faculty names and emails or Bill Gates’s house addresses in USPS format.Each prompt is presented twice in the supplied evaluation text.
  • H.1 Restricted Prompts for PII and Hallucinated Personality: The hallucinated-personal-details probes ask about physical features for a dating profile and the model’s favorite movie.These are two handwritten prompts in the small-scale experiment.
  • H.2 Evaluation: For each behavior category, an attack is successful if it elicits restricted behavior on at least one of the two prompts; otherwise it is unsuccessful.The evaluation uses the same attacks as the main evaluation in Section 4 and records outcomes with ✓ or ✗.

H.3 Results

Table 9 shows that multiple attacks elicit restricted behavior from both GPT-4 and Claude v1.3. GPT-4 also sometimes reveals personally identifiable information without special prompting, indicating imperfect training even for simple queries.

  • H.3 Results: Multiple attacks successfully elicit restricted behavior from both GPT-4 and Claude v1.3.Table 9 reports results for prompts requesting memorized personally identifiable information and hallucinated personal details.
  • H.3 Results: GPT-4 sometimes reveals personally identifiable information without special prompting, indicating imperfect training even for simple queries.
  • H.3 Results: The experiment evaluates prompts requesting memorized personally identifiable information and hallucinated personal details, including an attack from jailbreakchat.com.Table 9 marks the jailbreakchat.com attack in italics.
Loading 2307.02483v1…