Jailbroken: How Does LLM Safety Training Fail?
Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023))
Subscriber deck — free during early access
14 cards
1 Introduction
- What question does Jailbroken address, beyond showing that jailbreaks exist?Why jailbreak attacks on safety-trained models succeed and how they can be constructed: it traces them to two failure modes of safety training and uses those to design new attacks.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §1
- What are the two failure modes of safety training proposed by Wei et al.?Competing objectives: the model’s capability goals (language modelling, instruction following) conflict with its safety goal. Mismatched generalization: safety training fails to cover a domain where the model still has capabilities from pretraining.
Mismatched generalization: safety training covers less than the model can do - Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §1
- What did the empirical evaluation show about GPT-4 and Claude v1.3?Despite extensive red-teaming and safety training, attacks built on the two failure modes succeeded on over 96% of evaluated harmful prompts, including all of a curated set of red-teaming prompts that safety training was meant to address, and beat ad hoc jailbreaks shared online.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §1
- How did Wei et al. handle disclosure of their attacks?They shared preliminary results with OpenAI and Anthropic, omitted the exact prompts of the strongest attacks, focused on how attacks are constructed conceptually, and made code and data available to researchers on request.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §1
2 Background: Safety-Trained Language Models and Jailbreak Attacks
- How do Wei et al. define a jailbreak attack and its threat model?An attempt to get an on-topic response to a prompt for restricted behavior by submitting a modified prompt, with only black-box chat access: no weights, no system-prompt changes, no edited history. Outcomes are labelled GOOD BOT (refusal), BAD BOT (on-topic response) or UNCLEAR.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §2
3.1 Competing Objectives
- How does prefix injection exploit competing objectives?The model is asked to begin its answer with an innocuous, eager prefix. It follows the harmless-looking instruction (refusing harmless instructions is penalized), and once the prefix is written, a refusal is unlikely under the pretraining distribution, so it continues with the restricted content. Changing the prefix to “Hello!” removed the effect.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §3.1
- How does refusal suppression exploit competing objectives?The model is told to answer under rules that rule out typical refusal phrasing (e.g. never apologize, avoid words that start refusals). Instruction following downweights refusal openings; once a compliant answer starts, pretraining favours continuing it. Inverting the rules elicited no restricted behavior.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §3.1
3.2 Mismatched Generalization
- Why does a Base64-encoded request bypass safety training?Large models learned to read and follow Base64 during pretraining, but safety training never contained such unnatural inputs, so refusals don’t generalize there: the model complies without safety considerations. Encoded input mattered more than encoded output, though both together were strongest.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §3.2
- Besides encodings, what other inputs exploit mismatched generalization?Obfuscations such as ciphers, leetspeak, Pig Latin, synonyms, payload splitting or translation; many unrelated “distractor” instructions; unusual output formats like JSON; and requests to write content as it would appear on a particular website.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §3.2
4 Empirical Evaluation of Jailbreak Methods
- Which jailbreaks were most effective, and what does that imply for defense?Combinations of simple attacks (e.g. prefix injection plus refusal suppression plus Base64) were by far the strongest. Since simple ideas can be combined in combinatorially many ways, such attacks are hard to defend against one by one.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §4
- What did the adaptive attack and Claude’s role-play resistance reveal?Claude v1.3 had apparently been trained against role-play jailbreaks (all of them failed), yet an attacker choosing among 28 attacks per prompt still succeeded on essentially every prompt: training against specific attacks isn’t enough.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §4
- How can scale create new vulnerabilities, according to Wei et al.?GPT-3.5 Turbo couldn’t understand Base64 or complex combination attacks, so those failed on it; GPT-4 could follow Base64 instructions but without safeguards. New capabilities open new attack surfaces.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §4
5 Implications for Defense
- Why won’t scaling alone fix competing objectives?The conflict lies in the training objective, not data or model size: RLHF as in InstructGPT keeps terms that pull toward the pretrained model, so safety always trades off against pretraining behaviour. A fix may require moving beyond pretrain-then-fine-tune, e.g. incorporating values during pretraining.
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §5
- What is safety–capability parity, and why is it needed?Safety mechanisms must be as sophisticated as the model they protect; otherwise attacks exploit capabilities the safeguards lack, e.g. a weaker filter model that can’t decode Base64 can’t flag a Base64 attack. Models can even help generate attacks on themselves (GPT-4 flagged words to obfuscate; Claude rediscovered Base64).
- Wei et al., 2023, Jailbroken (Advances in Neural Information Processing Systems 36 (NeurIPS 2023)), §5
Source
- Alexander Wei, Nika Haghtalab and Jacob Steinhardt. 2023. Jailbroken: How Does LLM Safety Training Fail?. In Advances in Neural Information Processing Systems 36 (NeurIPS 2023). https://papers.nips.cc/paper_files/paper/2023/hash/fd6613131889a4b656206c50a8bd7790-Abstract-Conference.html