Safety

Many-shot Jailbreaking

Paper preview
Many-shot Jailbreaking
Paper summary

Anthropic shows that long-context windows enable a new attack where hundreds of fake user/assistant dialogues are packed into a single prompt, coaxing frontier LLMs to answer the final harmful question despite safety training.

Ask this paper

Key points
01

Attack mechanics: The prompt embeds faux dialogues in which a cooperating assistant answers harmful queries, followed by the target question; in-context learning generalizes the pattern and overrides RLHF safety.

02

Power-law scaling: Attack success rises as a power law in the number of shots up to ~256, and is more effective on larger models that have stronger in-context learning.

03

Model coverage: The technique works on Claude 2.0 and comparable frontier LLMs from other labs, indicating a structural rather than model-specific vulnerability.

04

Mitigations: Context-window limits plus prompt classification / modification cut attack success from 61% to 2% in one setup, though the authors note variants may evade detection.

Abstract

We investigate a family of simple long-context at- tacks on large language models: prompting with hundreds of demonstrations of undesirable behav- ior. This is newly feasible with the larger context windows recently deployed by Anthropic, Ope- nAI and Google DeepMind. We find that in di- verse, realistic circumstances, the effectiveness of this attack follows a power law, up to hundreds of shots. We demonstrate the success of this attack on the most widely used state-of-the-art closed- weight models, and across various tasks. Our results suggest very long contexts present a rich new attack surface for LLMs.

Every Monday
Get next week’s papers.
Subscribe on Substack