# A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Models

Source: [A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Models](<https://www.sota2.com/research/paper/68fa73311e209131cea5b07a>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-01-02T05:58:30.246Z

Authors: Zihao Xu, Yi Liu, Gelei Deng, Yuekang Li, Stjepan Picek

Published: 2024-02-21T01:26:39.000Z

## 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.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Jailbreak and Phishing Prompt Classification on 60 Malicious Queries](<https://www.sota2.com/research/sota/jailbreak-and-phishing-prompt-classification-on-60-malicious-queries.md>): Jailbreak and Phishing Prompt Classification; 60 Malicious Queries; Accuracy (Jailbreak/Phishing): 92.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2402.13457>)

[PDF](<https://arxiv.org/pdf/2402.13457.pdf>)

[Implementation](<https://sites.google.com/view/llmcomprehensive/home>)
