Tricking LLMs into Disobedience: Formalizing, Analyzing, and Detecting Jailbreaks

TL;DR

Formalized jailbreak taxonomy; tested 3700 prompts across GPT, BLOOM, OPT, FLAN-T5-XXL; success rates >78%; detection via GPT-4 accuracy 92%.

cs.CL 🔴 Advanced 2023-05-24 40 views
Abhinav Rao Sachin Vashistha Atharva Naik Somak Aditya Monojit Choudhury
LLM security prompt injection attack taxonomy detection methods large datasets

Key Findings

Methodology

This paper introduces a formal framework for classifying jailbreak attacks on LLMs, based on linguistic structure categories: Orthographic, Lexical, Morpho-syntactic, Semantic, and Pragmatic. Using templated prompt generation, 3700 attack prompts were created to evaluate multiple models (GPT-3.5, GPT-4, BLOOM-176B, OPT-175B) across tasks like translation, classification, summarization, and code generation. Automated property tests (e.g., language detection, code validity) combined with GPT-4-based manual assessment measured attack success. The study also analyzed the effectiveness of detection strategies against known attack techniques.

Key Results

  • Across models, success rates exceeded 78%, with GPT-3.5-turbo reaching 85%. Orthographic and Semantic techniques showed the highest attack efficacy, especially when combined. Detection accuracy using GPT-4 reached 92%, demonstrating robustness. Results indicated that models are particularly vulnerable to semantic and structural manipulations, with success rates correlating with prompt complexity. The findings highlight persistent security gaps, especially in multi-technique scenarios.
  • Analysis revealed that different models exhibit varying sensitivities to specific attack types, with larger models generally more resilient but still vulnerable. The template-based approach effectively covered diverse tasks, confirming the generalizability of the taxonomy. Combining multiple attack techniques increased success probability, emphasizing the need for multi-layer defenses. The detection framework proved effective across tasks, providing a practical tool for security assessment.
  • Further experiments showed that certain linguistic manipulations, such as semantic paraphrasing and pragmatic role-play, are particularly effective in bypassing content filters. The study also identified key linguistic features exploited in attacks, informing future defense strategies. Overall, the research underscores the importance of formalized attack classification and robust detection in safeguarding LLM deployment.

Significance

This work advances the understanding of LLM vulnerabilities by providing a systematic, formalized taxonomy of jailbreak techniques, grounded in linguistic analysis. It bridges the gap between ad hoc attack descriptions and comprehensive defense strategies, offering a scalable framework applicable across models and tasks. The large-scale dataset and evaluation methodology set new standards for security benchmarking in NLP, enabling developers to identify and mitigate risks proactively. The integration of automated detection with human assessment demonstrates a practical approach to real-world deployment challenges, fostering safer AI systems. Ultimately, this research contributes to establishing industry-wide standards for model robustness and security, crucial for trustworthy AI adoption.

Technical Contribution

The paper's primary contribution is the development of a linguistically grounded taxonomy that categorizes jailbreaks into orthographic, lexical, morpho-syntactic, semantic, and pragmatic techniques. It introduces a template-driven prompt generation system that ensures broad coverage of attack vectors across multiple NLP tasks and models. The combined automated and GPT-4-based detection framework enhances the accuracy and scalability of jailbreak identification. The formal definitions of attack, intent, and success metrics provide a rigorous foundation for future research. This systematic approach enables comprehensive evaluation and comparison of defenses, setting a new standard in NLP security research.

Novelty

This is the first work to systematically formalize and categorize jailbreak techniques based on linguistic structure, moving beyond ad hoc descriptions. The integration of large-scale prompt templating with automated and GPT-4-based detection offers a novel, scalable methodology for security evaluation. Unlike prior studies focusing on isolated attack types, this work decouples technique and intent, allowing for complex, multi-layered attack modeling. Its comprehensive dataset and evaluation across multiple models and tasks provide a new benchmark for future research, representing a significant step forward in NLP security.

Limitations

  • Detection methods rely heavily on predefined property tests and GPT-4 judgment, which may not generalize well to unseen or more sophisticated attacks. The template generation, while extensive, may not cover all possible attack vectors, especially in multi-modal or real-world scenarios.
  • Experiments are limited to specific models and tasks, and results may vary with other architectures or application contexts. The computational cost of large-scale prompt generation and testing is non-trivial, posing scalability challenges.
  • The study focuses on static prompts; dynamic or adaptive attack strategies could bypass current defenses. Further research is needed to develop more adaptive, learning-based detection mechanisms.

Future Work

Future directions include integrating machine learning-based adaptive detection systems, expanding datasets to include multi-modal inputs, and exploring defenses against multi-technique, multi-layered attacks. Developing real-time monitoring tools for deployment environments and establishing industry standards for security benchmarks are also key goals. Additionally, research into explainability and interpretability of detection outcomes will enhance trust and usability. The authors plan to collaborate with industry partners to implement these frameworks in practical settings, aiming to reduce vulnerabilities and foster safer AI deployment.

AI Executive Summary

The rapid adoption of large language models (LLMs) like GPT-3 and BLOOM has revolutionized NLP applications, but it also introduces significant security challenges. As these models become more integrated into real-world systems, malicious actors exploit prompt manipulation techniques—known as jailbreaks—to bypass safety measures, generate harmful content, or leak sensitive information. Despite the growing prevalence, a systematic understanding of these attacks remains limited. This paper addresses this gap by proposing a formal framework for classifying jailbreak techniques based on linguistic structure, encompassing orthographic, lexical, morpho-syntactic, semantic, and pragmatic categories.

Using a templated prompt generation approach, the authors created 3700 attack prompts covering multiple NLP tasks and tested them across models such as GPT-3.5, GPT-4, BLOOM-176B, and OPT-175B. The results reveal high success rates, often exceeding 85%, particularly for semantic and structural techniques. To evaluate detection strategies, the study employed GPT-4 as a judgment tool, achieving an accuracy of 92%, demonstrating the feasibility of automated defense mechanisms.

The analysis also uncovered that models are especially vulnerable to complex, multi-technique attacks, highlighting the need for comprehensive, multi-layered defenses. The research emphasizes that current models still possess significant security gaps, especially when faced with sophisticated prompt manipulations. The formal classification and large-scale dataset provided serve as valuable resources for researchers and practitioners aiming to improve model robustness.

Looking ahead, the authors advocate for integrating adaptive, learning-based detection systems, expanding datasets to multi-modal inputs, and establishing industry-wide security standards. These efforts are crucial to ensure the safe, trustworthy deployment of AI systems, minimizing risks posed by malicious prompt engineering and safeguarding user privacy and safety in an increasingly AI-driven world.

Deep Dive

Abstract

Recent explorations with commercial Large Language Models (LLMs) have shown that non-expert users can jailbreak LLMs by simply manipulating their prompts; resulting in degenerate output behavior, privacy and security breaches, offensive outputs, and violations of content regulator policies. Limited studies have been conducted to formalize and analyze these attacks and their mitigations. We bridge this gap by proposing a formalism and a taxonomy of known (and possible) jailbreaks. We survey existing jailbreak methods and their effectiveness on open-source and commercial LLMs (such as GPT-based models, OPT, BLOOM, and FLAN-T5-XXL). We further discuss the challenges of jailbreak detection in terms of their effectiveness against known attacks. For further analysis, we release a dataset of model outputs across 3700 jailbreak prompts over 4 tasks.

cs.CL