Improved few-shot jailbreak can bypass aligned large language models and their defensesImproved Few-Shot Jailbreaking Can Circumvent Aligned Language Models and Their Defenses
The researchers propose an improved few-shot jailbreak method that can achieve a high attack success rate on aligned large language models with strong defenses enabled. The method injects special system tokens such as [/INST] and performs demonstration-level random search from a collected demonstration pool, achieving an attack success rate of over 80% (mostly over 95%) on Llama-2-7B and Llama-3-8B without multiple restarts, even when the models have perplexity detection and/or SmoothLLM. This work responds to the many-shot jailbreak of Anil et al. (2024), which uses long contexts and up to hundreds of demonstrations, and explores efficient jailbreaking with a small number of demonstrations within a limited context length; the paper states that in evaluations against other aligned large language models and advanced defenses (ensuring the correct system prompt is used), the attack success rate consistently approaches 100%. Code is open-sourced at https://github.com/sail-sg/I-FSJ。