TL;DR This paper introduces "bijection learning," a novel black-box jailbreak technique that leverages in-context learning to teach Large Language Models (LLMs) custom, randomly generated ciphers. By communicating through these ciphers, attackers can bypass built-in safety filters. By tuning the complexity of these encodings, the authors achieve state-of-the-art attack success rates on frontier models like Claude 3.5 Sonnet and GPT-4o. Crucially, the research reveals a scaling vulnerability: more capable models are better at learning complex encodings, making them more susceptible to this attack than weaker models.
The Problem: Bypassing Safety Filters
As LLMs become more integrated into society, developers heavily rely on safety training (like RLHF) to prevent them from generating harmful content. Attackers bypass these defenses using "jailbreaks." However, most existing jailbreaks have significant drawbacks: white-box attacks require access to model weights, persuasion-based attacks require complex multi-turn AI interactions, and encoding-based attacks (like Base64 or Morse code) rely on static ciphers that models can easily be patched to recognize and block.
The authors tackle the challenge of creating a jailbreak that is black-box (requires only API access), universal (works for any harmful intent via a simple template), and scale-adaptive (remains effective—or becomes more effective—as models get smarter).
Methodology: Bijection Learning
Bijection Learning forces the LLM to communicate in a newly invented, randomly generated language. The attack pipeline consists of four main steps:
- Generate a Bijection: The attacker creates a random string-to-string mapping (e.g., mapping English letters to other letters, or to 2-digit numbers).
- In-Context Teaching: The attacker prompts the target LLM with a system message explaining the mapping, followed by several few-shot examples of English text translated into this new "bijection language."
- The Attack: The harmful query is encoded in the bijection language and passed to the model. Because the text looks like gibberish to standard safety filters, the model processes the request and outputs a helpful, harmful response in the encoded language.
- Decoding & Denoising: The attacker decodes the response back to English. A smaller model (like GPT-4o-mini) is used as a denoiser to clean up minor spelling errors introduced by the target model during translation.
Instead of relying on known ciphers, this method generates an endless supply of them. Attackers can control the cipher's difficulty using parameters like dispersion (how many letters are altered) and encoding length (e.g., 1-digit vs. 2-digit numbers). Because the ciphers are randomly generated, attackers can use "best-of-$n$" fuzzing—repeatedly throwing different random ciphers at the model until one slips past the safety guardrails.
Key Insights: The Dual-Use Nature of Reasoning
- Advanced Reasoning is Dual-Use: The very capability that makes frontier models so powerful—their ability to learn complex rules in-context—is exactly what makes them vulnerable to this attack.
- The "Computational Overload" Hypothesis: Why does this work? The authors suggest that translating text to and from a complex cipher takes up so much of the model's limited computational capacity that its safety classification abilities degrade. They proved this by running the MMLU benchmark through the cipher: as cipher complexity went up, MMLU scores dropped.
- Vulnerability Scales with Capability: There is a "Pareto frontier" of vulnerability. Weaker models (like Claude 3 Haiku) fail to learn complex bijections and just output incoherent gibberish. Stronger models (like Claude 3.5 Sonnet) can learn highly complex bijections perfectly, allowing attackers to use harder ciphers that thoroughly scramble the model's safety guardrails.
- Guardrails Fail: Wrapping a model in input/output safety classifiers doesn't solve the problem. If the guard model is weaker than the target model, it either misses the attack or over-refuses benign prompts. Even if the guard model is the same frontier model, it barely mitigates the attack while tripling inference costs.
Experimental Results
The researchers evaluated the attack using standard datasets like AdvBench-50 and HarmBench, alongside MMLU for capability degradation and a custom benign dataset to test over-refusal.
- State-of-the-Art Success: Bijection learning achieved an 86.3% Attack Success Rate (ASR) on Claude 3.5 Sonnet and 59.1% on GPT-4o on the HarmBench dataset.
- Crushing Baselines: The method outperformed an ensemble of 11 existing encoding attacks (like Base64, ROT13, ASCII art) by over 30 percentage points across the board.
- Fuzzing Multiplier: Using best-of-$n$ sampling (trying between 6 and 47 random bijections) more than doubled the single-attempt ASR on all tested models.
- Guardrail Inefficiency: A Claude 3.5 Sonnet-based guardrail defending a Claude 3.5 Sonnet target only reduced the attack's ASR by 10%, despite requiring 3x the API calls.
Limitations and Future Work
The primary limitation of this attack is its high token cost. Because the attack requires long in-context translation examples to teach the model the cipher, a single prompt can consume 25,000 to 50,000 input tokens. This makes the attack somewhat expensive and limits it to models with massive context windows. Consequently, the study was primarily limited to closed-source frontier models.
Future work will investigate whether open-source models fine-tuned on bijection languages could be jailbroken zero-shot, removing the massive token overhead. Ultimately, this research urges the AI safety community to look closer at how scaling up reasoning capabilities inherently scales up new types of vulnerabilities.
Summary updated