Anthropic proposes the Many-shot Jailbreaking (many-example jailbreak) long-context attackMany-shot Jailbreaking
Researchers from Anthropic and several universities propose the Many-shot Jailbreaking (many-example jailbreak) attack, which inserts hundreds of harmful question-answer demonstrations into a long context to induce the model to output harmful content, and is effective on Claude 2.0, GPT-3.5, GPT-4, Llama 2 (70B) and Mistral 7B. Attack effectiveness grows as a power law with the number of examples; on Claude 2.0, 5 examples are ineffective while 256 examples can reliably jailbreak, and about 128 examples are enough for the tested models to adopt harmful behavior, and on a malicious-use-case dataset, scaling to about 70,000 tokens still shows no plateau; larger models are more susceptible to MSJ. The attack is robust to changes in format, language and topic, and works even when demonstrations do not match the target topic if they are sufficiently diverse, and can also be combined with jailbreak methods such as competing objectives to shorten the required context. The team also completed an internal independent reproduction on HarmBench, where the MSJ attack success rate was higher than the other compared jailbreak techniques.
The paper gives a quantitative pattern in which attack success rate grows as a power law with the number of examples, and systematically evaluates the limitations of fine-tuning and prompt defenses; teams deploying long-context models can use this to assess exposure.