mlsanityData to 14 Oct 2026

HSF: Defending against Jailbreak Attacks with Hidden State Filtering

arXiv 2409.03788 ↗First posted 31 Aug 2024cs.CR cs.AI cs.CLcited by 23

On the map: LLM safety and security → Jailbreaking

Abstract (arXiv)

With the growing deployment of LLMs in daily applications like chatbots and content generation, efforts to ensure outputs align with human values and avoid harmful content have intensified. However, increasingly sophisticated jailbreak attacks threaten this alignment, aiming to induce unsafe outputs. Current defense efforts either focus on prompt rewriting or detection, which are limited in effectiveness due to the various design of jailbreak prompts, or on output control and detection, which are computationally expensive as they require LLM inference. Therefore, designing a pre-inference defense method that resists diverse jailbreak prompts is crucial for preventing LLM jailbreak attacks. We observe that jailbreak attacks, safe queries, and harmful queries exhibit different clustering patterns within the LLM's hidden state representation space. This suggests that by leveraging the LLM's hidden state representational capabilities, we can analyze the LLM's forthcoming behavior and proactively intervene for defense. In this paper, we propose a jailbreak attack defense strategy based on a Hidden State Filter (HSF), a lossless architectural defense mechanism that enables the model to preemptively identify and reject adversarial inputs before the inference process begins. We activate its defensive potential through an additional plugin module, effectively framing the defense task as a classification problem. Experimental results on two benchmark datasets, utilizing three different LLMs, show that HSF significantly enhances resilience against six cutting-edge jailbreak attacks. It significantly reduces the success rate of jailbreak attacks while minimally impacting responses to benign user queries, with negligible inference overhead, and outperforming defense baselines.Our code and data are available at https://anonymous.4open.science/r/Hidden-State-Filtering-8652/

Key facts. Cited by 23 papers in the map (data through 14 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 3 of its 4 references that are in the map. First posted on arXiv 31 Aug 2024.

Builds on

3 of 4 references.

Closest ancestors · 1

Same direction, newest first

  1. 2023A Wolf in Sheep's Clothing: Generalized Nested Jailbreak Prompts can Fool Large Language Models Easily14 Nov

Other references · 2

  1. 2022Survey of Hallucination in Natural Language Generationcited by 2,075
  2. 2019BPE-Dropout: Simple and Effective Subword Regularizationcited by 195

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 11; 2026: 11.

23 papers.

Sort:

By area:

  1. 2025AdaSteer: Your Aligned LLM is Inherently an Adaptive Jailbreak Defendercited by 38
  2. 2025SoK: Evaluating Jailbreak Guardrails for Large Language Modelscited by 21
  3. 2025Emergent Response Planning in LLMscited by 19
  4. 2025False Sense of Security: Why Probing-based Malicious Input Detection Fails to Generalizecited by 19
  5. 2025Rethinking Jailbreak Detection of Large Vision Language Models with Representational Contrastive Scoringcited by 11
  6. 2026LLM Safety From Within: Detecting Harmful Content with Internal Representationscited by 11
  7. 2025SARSteer: Safeguarding Large Audio-Language Models via Safe-Ablated Refusal Steeringcited by 8
  8. 2026HoneyTrap: Deceiving Large Language Model Attackers to Honeypot Traps with Resilient Multi-Agent Defensecited by 8
  9. 2024Feint and Attack: Attention-Based Strategies for Jailbreaking and Protecting LLMscited by 5
  10. 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defensescited by 5
  11. 2025ALMGuard: Safety Shortcuts and Where to Find Them as Guardrails for Audio-Language Modelscited by 4
  12. 2025STShield: Single-Token Sentinel for Real-Time Jailbreak Detection in Large Language Modelscited by 3
11 more
  1. 2026ALERT: Zero-shot LLM Jailbreak Detection via Internal Discrepancy Amplificationcited by 3
  2. 2026LASA: Language-Agnostic Semantic Alignment at the Semantic Bottleneck for LLM Safetycited by 3
  3. 2026AgentLens: Interpretable Safety Steering via Mechanistic Subspaces for Multi-Turn Coding Agentcited by 3
  4. 2025Efficient but Vulnerable: Benchmarking and Defending LLM Batch Prompting Attackcited by 2
  5. 2026RouteScan: A Non-Intrusive Approach to Auditing MoE LLMs Safety via Expert Routing Telemetrycited by 2
  6. 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMscited by 1
  7. 2026When Think-with-Image Meets Safety: What Determines Multimodal Jailbreak Robustness?cited by 1
  8. 2026Evolving Jailbreaks: Automated Multi-Objective Long-Tail Attacks on Large Language Modelscited by 0
  9. 2026Ellipsoid Control: A White-list Jailbreak Defense via Benign Latent Modelingcited by 0
  10. 2026Active Adaptation, Not Static Defense: Temporal Dynamics of Preventative Steering in Adversarial Fine-Tuningcited by 0
  11. 2026ForeSight: Enhancing Risk Monitoring via Early Safety Signal Distillationcited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2025DETAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification
  2. 2025Scalable Defense against In-the-wild Jailbreaking Attacks with Safety Context Retrieval
  3. 2025SafeInt: Shielding Large Language Models from Jailbreak Attacks via Safety-Aware Representation Intervention
  4. 2024Immune: Improving Safety Against Jailbreaks in Multi-modal LLMs via Inference-Time Alignment
  5. 2024SelfDefend: LLMs Can Defend Themselves against Jailbreaking in a Practical Manner
  6. 2025PandaGuard: Systematic Evaluation of LLM Safety against Jailbreaking Attacks
  7. 2026Re-Triggering Safeguards within LLMs for Jailbreak Detection
  8. 2025Layer-Level Self-Exposure and Patch: Affirmative Token Mitigation for Jailbreak Attack Defense