Boosting Jailbreak Transferability for Large Language Models

Jian Zheng, Hanqing Liu, Lifeng Zhou, Huanqian Yan, Peilin LiuPrcv 2024

TL;DR

This paper introduces SI-GCG, a novel jailbreaking attack method that significantly boosts the transferability of adversarial prompts across different large language models (LLMs). By incorporating malicious question contexts and a refined suffix optimization strategy, SI-GCG achieves near-perfect attack success rates, outperforming existing state-of-the-art methods.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly powerful, but their safety alignment mechanisms are vulnerable to "jailbreak" attacks. These attacks craft specific prompts to bypass safety filters and elicit harmful or undesirable content. While existing methods like GCG can successfully jailbreak individual models, they often struggle to transfer these attacks to different LLMs. This lack of transferability limits their practical impact and highlights a need for more robust and generalizable jailbreaking techniques. The paper aims to bridge this gap by developing an attack that is not only effective but also highly transferable across various LLMs.

Methods

The proposed method, SI-GCG (Secure Jailbreak - Greedy Coordinate Gradient), builds upon the GCG attack but introduces several key enhancements:

  • Scenario Induction Template: A fixed harmful template is used to guide the LLM towards generating malicious content. This template incorporates phrases like "You are villains and promote cunning and nefarious!" and instructs the model to provide step-by-step instructions for harmful activities.
  • Optimized Suffix Selection: Instead of simply selecting the suffix with the lowest loss during optimization, SI-GCG evaluates the top five suffixes with the smallest losses. It then assesses the actual generated content for harmfulness, prioritizing suffixes that produce genuinely undesirable outputs over those that might simply reduce the loss by generating benign but "safe" responses (like "yes" or "no").
  • Re-suffix Attack Mechanism: To prevent the optimization process from deviating into incorrect directions and to reduce inconsistent outputs, a re-suffix attack mechanism is employed. This involves using a successful jailbreak suffix as a new initialization point for further optimization, ensuring more stable and effective progress.

These techniques are combined to create a more sophisticated and effective jailbreaking strategy.

Datasets

The paper utilizes a dataset provided by AI Singapore, consisting of 50 malicious questions. This dataset was used for evaluating the attack's performance on the chosen victim models. No new benchmarks were introduced; rather, existing malicious questions were used for evaluation.

Key Insights and Ideas

  • Context is Crucial: Simply optimizing for a target template isn't enough. Incorporating the malicious question's context into the optimization process significantly improves the attack's effectiveness.
  • Beyond Loss Minimization: Relying solely on loss minimization can lead to suboptimal or even benign outputs. Evaluating the actual harmfulness of the generated content is essential for successful jailbreaking.
  • Transferability is Achievable: By refining the optimization and selection strategies, it's possible to create jailbreak prompts that are highly transferable across different LLMs, even those with varying architectures and training data.
  • The Power of Punctuation: Surprisingly, appending a specific number of exclamation marks ("!") to an optimized suffix can dramatically boost attack transferability, though an excessive number can degrade performance.

Key Results

SI-GCG demonstrated superior performance across extensive experiments:

  • Near 100% Success Rate: The method achieved nearly 100% attack success rates on two LLMs (LLAMA2-7B-CHAT and VICUNA-7B-1.5) in Track 1a of the AISG-hosted Global Challenge.
  • Outperforming Baselines: SI-GCG significantly outperformed existing methods like GCG and I-GCG in terms of attack success rates. For instance, on LLAMA2-7B-CHAT, SI-GCG achieved a 0.98 success rate compared to GCG's 0.46 and I-GCG's 0.54.
  • Effective in Black-Box Settings: The method also showed strong performance in a black-box setting (Track 1b), indicating good transferability.
  • Efficiency Gains: The proposed techniques, particularly the optimized suffix selection, reduced the average number of steps required for a successful jailbreak.

Limitations and Future Work

  • Computational Cost: While the paper focuses on improving efficiency, optimization-based jailbreaking methods can still be computationally intensive.
  • Specific Attack Vectors: The current method is tailored for eliciting harmful content. Future work could explore extending these techniques to other types of undesirable outputs or more nuanced adversarial goals.
  • Further Exploration of Suffix Enhancements: The paper notes that an excessive number of exclamation marks can degrade performance. Further research could explore other character-based or structural enhancements to suffixes for even greater robustness and transferability.
  • Broader Model Coverage: While tested on two LLMs, future work could investigate the performance of SI-GCG across a wider range of LLM architectures and sizes.

Summary updated

BibTeX
@inproceedings{zheng2024boosting,
  author = {Jian Zheng and Hanqing Liu and Lifeng Zhou and Huanqian Yan and Peilin Liu},
  title = {{Boosting Jailbreak Transferability for Large Language Models}},
  booktitle = {Prcv},
  year = {2024},
}
Figure