mlsanityData to 14 Oct 2026

Defending against Jailbreak through Early Exit Generation of Large Language Models

arXiv 2408.11308 ↗First posted 21 Aug 2024cs.AI cs.CL cs.CRcited by 1

On the map: Efficient LLM inference and serving → Diffusion LLM and MoE inference

also in 1 more
Abstract (arXiv)

Large Language Models (LLMs) are increasingly attracting attention in various applications. Nonetheless, there is a growing concern as some users attempt to exploit these models for malicious purposes, including the synthesis of controlled substances and the propagation of disinformation. In an effort to mitigate such risks, the concept of "Alignment" technology has been developed. However, recent studies indicate that this alignment can be undermined using sophisticated prompt engineering or adversarial suffixes, a technique known as "Jailbreak." Our research takes cues from the human-like generate process of LLMs. We identify that while jailbreaking prompts may yield output logits similar to benign prompts, their initial embeddings within the model's latent space tend to be more analogous to those of malicious prompts. Leveraging this finding, we propose utilizing the early transformer outputs of LLMs as a means to detect malicious inputs, and terminate the generation immediately. We introduce a simple yet significant defense approach called EEG-Defender for LLMs. We conduct comprehensive experiments on ten jailbreak methods across three models. Our results demonstrate that EEG-Defender is capable of reducing the Attack Success Rate (ASR) by a significant margin, roughly 85% in comparison with 50% for the present SOTAs, with minimal impact on the utility of LLMs.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Diffusion LLM and MoE inference, one of 12 directions in Efficient LLM inference and serving. Builds on 35 of its 46 references that are in the map. First posted on arXiv 21 Aug 2024.

Builds on

35 of 46 references.

References · 35

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2022Training language models to follow instructions with human feedbackcited by 15,971
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  5. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  6. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  7. 2017Prototypical Networks for Few-shot Learningcited by 3,015
  8. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  9. 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
  10. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,420
  11. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
  12. 2021Ethical and social risks of harm from Language Modelscited by 966
23 more
  1. 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 785
  2. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 672
  3. 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 651
  4. 2023GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Promptscited by 560
  5. 2023SmoothLLM: Defending Large Language Models Against Jailbreaking Attackscited by 469
  6. 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 431
  7. 2024ShortGPT: Layers in Large Language Models are More Redundant Than You Expectcited by 383
  8. 2023DeepInception: Hypnotize Large Language Model to Be Jailbreakercited by 367
  9. 2023Explainability for Large Language Models: A Surveycited by 333
  10. 2023Function Vectors in Large Language Modelscited by 308
  11. 2024LayerSkip: Enabling Early Exit Inference and Self-Speculative Decodingcited by 307
  12. 2023Preference Ranking Optimization for Human Alignmentcited by 285
  13. 2024SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decodingcited by 247
  14. 2023ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI Conversationcited by 231
  15. 2023Defending Against Alignment-Breaking Attacks via Robustly Aligned LLMcited by 192
  16. 2023Defending Large Language Models Against Jailbreaking Attacks Through Goal Prioritizationcited by 170
  17. 2024A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Modelscited by 106
  18. 2024How Alignment and Jailbreak Work: Explain LLM Safety through Intermediate Hidden Statescited by 98
  19. 2024GradSafe: Detecting Jailbreak Prompts for LLMs via Safety-Critical Gradient Analysiscited by 96
  20. 2024Not All Layers of LLMs Are Necessary During Inferencecited by 96
  21. 2024Defending Large Language Models Against Jailbreak Attacks via Layer-specific Editingcited by 79
  22. 2024Towards Understanding Jailbreak Attacks in LLMs: A Representation Space Analysiscited by 64
  23. 2023Hijacking Large Language Models via Adversarial In-Context Learningcited by 45

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2024Jailbreaking and Mitigation of Vulnerabilities in Large Language Models
  2. 2024Jailbreak Attacks and Defenses Against Large Language Models: A Survey
  3. 2026Jailbreaking Leaves a Trace: Understanding and Detecting Jailbreak Attacks from Internal Representations of Large Language Models
  4. 2025A Domain-Based Taxonomy of Jailbreak Vulnerabilities in Large Language Models
  5. 2024Jailbreaking Large Language Models Through Alignment Vulnerabilities in Out-of-Distribution Settings
  6. 2023A Wolf in Sheep's Clothing: Generalized Nested Jailbreak Prompts can Fool Large Language Models Easily
  7. 2025Do Internal Layers of LLMs Reveal Patterns for Jailbreak Detection?
  8. 2025The Tower of Babel Revisited: Multilingual Jailbreak Prompts on Closed-Source Large Language Models