Mitigating Many-Shot Jailbreaking

Christopher M. Ackerman, Nina Panickssery
4/13/2025
cs.LGcs.AIcs.CR

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ackerman2025mitigating,
  title  = {Mitigating Many-Shot Jailbreaking},
  author = {Christopher M. Ackerman and Nina Panickssery},
  year   = {2025},
  eprint = {2504.09604},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.09604v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.09604.svg)](https://codeofpaper.com/paper/2504.09604)

Discussion