NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bag of Tricks: Benchmarking of Jailbreak Attacks on LLMs

Zhao Xu, Fan Liu, Hao Liu

TL;DR

Researchers from HKUST have introduced JailTrickBench, a comprehensive benchmark designed to standardize how we evaluate jailbreak attacks on Large Language Models (LLMs). By identifying a "Bag of Tricks"—eight key factors ranging from model size to system prompts—the study reveals that attack success depends less on the specific exploit and more on the implementation details, ultimately providing a rigorous baseline for testing defense-enhanced models.

What Problem Does This Paper Address?

As LLMs become integrated into daily life, "jailbreaking"—the art of crafting prompts to bypass safety filters and generate harmful content—has become a high-stakes game of cat-and-mouse. While many attack methods (like GCG or PAIR) have been proposed, the field suffers from a lack of standardization.

The authors argue that previous research often overlooks the "implementation details" that significantly sway results. For instance, does a 70B model resist attacks better than a 7B one? Does the specific chat template (e.g., Llama-2 vs. a generic zero-shot format) matter? Without answering these questions, it is impossible to tell if a new defense is actually effective or if the attacker just used the "wrong" settings.

Methods

To bring rigor to this space, the authors conducted a massive empirical study involving 354 experiments and approximately 55,000 GPU hours on A800-80G clusters.

Overview of the JailTrickBench framework and the eight key factors evaluated.

They evaluated eight key factors categorized into two levels:

  1. Target Model Level: Model size, safety fine-tuning alignment, the presence of a "Safe System Prompt" (SSP), and the specific chat template used.
  2. Attacker Level: The "intelligence" of the attacker model (e.g., using GPT-4 to craft prompts), the length of adversarial suffixes, the query budget, and the specific harmful intention (e.g., malware vs. political campaigning).

To measure success, they used Attack Success Rate (ASR) calculated via two methods: ASR-Prefix (checking for standard "I'm sorry" style refusals) and ASR-Agent (using GPT-4 as a judge to determine if the model actually broke its rules).

Datasets

The study utilizes three primary datasets to test the breadth of LLM vulnerabilities:

  • AdvBench: A standard set of 520 harmful goals (the authors used a representative subset of 50).
  • MaliciousInstruct: 100 harmful instructions across ten distinct categories.
  • HEx-PHI: Used specifically to test how different "intentions" (11 prohibited categories) affect attack success.

Key Insights and Ideas

  • Size Doesn’t Equal Safety: Surprisingly, model robustness does not strictly correlate with size. A Llama-2-7B model can sometimes be more resilient than a 70B counterpart depending on the attack type.
  • The "Alignment Tax" of Fine-Tuning: Fine-tuning an LLM on benign conversational data (like ShareGPT) can inadvertently "break" the safety alignment baked in by the original developers, making the model significantly easier to jailbreak.
Impact of fine-tuning on Attack Success Rate (ASR) for AutoDAN and PAIR attacks.
  • System Prompts are Powerhouses: Simply including a "Safe System Prompt" (reminding the model to be helpful and harmless) is one of the most effective ways to boost robustness against both token-level and prompt-level attacks.
  • Templates are Stealthy Variables: Using a generic zero-shot template instead of the model's native chat template (like the [INST] tags for Llama) can make a model much more vulnerable.
  • The Plateau of Suffixes: For token-level attacks, increasing the length of the adversarial "gibberish" suffix improves success, but only up to a point (around 60–80 tokens), after which gains diminish.

Key Results

The benchmark evaluated seven representative attacks against six defense methods (including SmoothLLM, Adversarial Training, and Unlearning).

  • Top Performers: AmpleGCG and AdvPrompter emerged as the most robust defense-aware attacks, maintaining high ASRs even against sophisticated defenses.
  • Defense Efficacy: Most defenses (like RPO or Self-Reminder) significantly reduced ASR, but the authors found that many also "broke" the model's utility, causing it to output meaningless punctuation or repetitive strings.
  • Vulnerability Variance: Llama-2-7B was generally found to be more vulnerable than Vicuna-13B across multiple benchmarks.

Limitations and Future Work

The authors acknowledge several hurdles in their comprehensive study:

  • Computational Cost: The study required a staggering $10,000 in API expenses and massive GPU resources, which may limit the ability of smaller labs to replicate or expand the benchmark.
  • Closed-Source Gap: Most experiments focused on open-source models to allow for white-box attacks; the dynamics of "black-box" jailbreaks on models like GPT-4 or Claude remain an area for deeper exploration.
  • Real-World Realism: The experimental setup may not fully capture the complexity of real-world multi-turn conversations where a user might "nudge" a model into a jailbreak over time.

Future work aims to explore more cost-effective attack methods and expand the benchmark to include multimodal models, such as vision-language systems.

Summary updated

BibTeX
@inproceedings{xu2024bag,
  author = {Zhao Xu and Fan Liu and Hao Liu},
  title = {{Bag of Tricks: Benchmarking of Jailbreak Attacks on LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=yg4Tt2QeU7},
}
Figure