Mitigating Many-Shot Jailbreaking
Christopher M. Ackerman, Nina Panickssery
TL;DR
This work interrogates many-shot jailbreaking (MSJ), a vulnerability arising from long context windows that enables jailbreaks via in-context demonstrations. It analyzes three mitigation paths—input sanitization, vector-based activation steering, and safety-focused fine-tuning—and finds that combining adversarial fine-tuning with input sanitization most effectively reduces MSJ risk while preserving in-context learning and conversational abilities. The authors provide a thorough evaluation framework combining NLL-based scaling, human judgments, and ability-preservation tests (OR-Bench, MT-Bench, and parity tasks). They show that the combined approach raises the baseline difficulty of jailbreaking and flattens the $NLL$-vs-shots slope, suggesting practical deployment guidance for safety post-training. Overall, the study argues for integrating this mitigation into model safety pipelines to improve robustness against MSJ in both closed and open-weight deployments.
Abstract
Many-shot jailbreaking (MSJ) is an adversarial technique that exploits the long context windows of modern LLMs to circumvent model safety training by including in the prompt many examples of a "fake" assistant responding inappropriately before the final request. With enough examples, the model's in-context learning abilities override its safety training, and it responds as if it were the "fake" assistant. In this work, we probe the effectiveness of different fine-tuning and input sanitization approaches on mitigating MSJ attacks, alone and in combination. We find incremental mitigation effectiveness for each, and show that the combined techniques significantly reduce the effectiveness of MSJ attacks, while retaining model performance in benign in-context learning and conversational tasks. We suggest that our approach could meaningfully ameliorate this vulnerability if incorporated into model safety post-training.
