Skip to main content
QUICK REVIEW

[Paper Review] A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Models

Zihao Xu, Yi Liu|arXiv (Cornell University)|Feb 21, 2024
Network Security and Intrusion DetectionComputer Science11 citations
TL;DR

The paper systematically evaluates nine jailbreak attack techniques and seven defenses across LLMs (Vicuna, LLaMA, GPT-3.5 Turbo), revealing template-based attacks often outperform white-box methods and Bergeron as the most effective defense among those tested.

ABSTRACT

Large Language Models (LLMS) have increasingly become central to generating content with potential societal impacts. Notably, these models have demonstrated capabilities for generating content that could be deemed harmful. To mitigate these risks, researchers have adopted safety training techniques to align model outputs with societal values to curb the generation of malicious content. However, the phenomenon of "jailbreaking", where carefully crafted prompts elicit harmful responses from models, persists as a significant challenge. This research conducts a comprehensive analysis of existing studies on jailbreaking LLMs and their defense techniques. We meticulously investigate nine attack techniques and seven defense techniques applied across three distinct language models: Vicuna, LLama, and GPT-3.5 Turbo. We aim to evaluate the effectiveness of these attack and defense techniques. Our findings reveal that existing white-box attacks underperform compared to universal techniques and that including special tokens in the input significantly affects the likelihood of successful attacks. This research highlights the need to concentrate on the security facets of LLMs. Additionally, we contribute to the field by releasing our datasets and testing framework, aiming to foster further research into LLM security. We believe these contributions will facilitate the exploration of security measures within this domain.

Motivation & Objective

  • Assess the effectiveness of diverse jailbreak attack techniques across multiple LLMs.
  • Evaluate the robustness of various jailbreak defense strategies against these attacks.
  • Identify factors that influence attack success, including model type and input tokens.

Proposed method

  • Baseline selection of nine attack methods and seven defenses from open sources and libraries.
  • Benchmark construction expanding to 60 malicious queries aligned with OpenAI guidelines.
  • Classification of malicious responses using a RoBERTa-based fine-tuned model and manual validation.
  • Evaluation using Attack Success Rate (ASR) and Efficiency for attacks, and DPR, BPR, GRQ for defenses.
  • Two-phase evaluation across three models (Vicuna, Llama-2, GPT-3.5 Turbo) on two GPUs.
  • Open-source artifacts including a benchmark platform and datasets.
Figure 1: The workflow of our study
Figure 1: The workflow of our study

Experimental results

Research questions

  • RQ1RQ1: How effective are jailbreak attack techniques across different unprotected LLMs?
  • RQ2RQ2: How effective are defense strategies against jailbreak attacks on various LLMs?

Key findings

  • Template-based jailbreak approaches are highly effective, often outperforming generative methods in certain models.
  • Generative attacks like GPTFuzz, Pair, and TAP perform best among generation-based methods, while white-box approaches underperform compared to universal templates.
  • LLaMA shows stronger inherent safety defenses than Vicuna, making it harder to jailbreak in white-box settings.
  • Special tokens (such as a particular INST marker) significantly affect attack success rates across templates and models.
  • Bergeron emerges as the most effective defense among those tested, while most defenses struggle to prevent malicious prompts or overly restrict benign prompts.
  • There is a need for standardized, scalable defense evaluation to reduce benign prompt misclassification and improve robustness.
Figure 2: Loss of a random question
Figure 2: Loss of a random question

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.