HSF: Defending against Jailbreak Attacks with Hidden State Filtering
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
Other references · 2
- 2022Survey of Hallucination in Natural Language Generationcited by 2,075
- 2019BPE-Dropout: Simple and Effective Subword Regularizationcited by 195
Built on by
Citing papers per year: 2024: 1; 2025: 11; 2026: 11.
23 papers.
Sort:
By area:
- 2025AdaSteer: Your Aligned LLM is Inherently an Adaptive Jailbreak Defendercited by 38
- 2025SoK: Evaluating Jailbreak Guardrails for Large Language Modelscited by 21
- 2025Emergent Response Planning in LLMscited by 19
- 2025False Sense of Security: Why Probing-based Malicious Input Detection Fails to Generalizecited by 19
- 2025Rethinking Jailbreak Detection of Large Vision Language Models with Representational Contrastive Scoringcited by 11
- 2026LLM Safety From Within: Detecting Harmful Content with Internal Representationscited by 11
- 2025SARSteer: Safeguarding Large Audio-Language Models via Safe-Ablated Refusal Steeringcited by 8
- 2026HoneyTrap: Deceiving Large Language Model Attackers to Honeypot Traps with Resilient Multi-Agent Defensecited by 8
- 2024Feint and Attack: Attention-Based Strategies for Jailbreaking and Protecting LLMscited by 5
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defensescited by 5
- 2025ALMGuard: Safety Shortcuts and Where to Find Them as Guardrails for Audio-Language Modelscited by 4
- 2025STShield: Single-Token Sentinel for Real-Time Jailbreak Detection in Large Language Modelscited by 3
11 more
- 2026ALERT: Zero-shot LLM Jailbreak Detection via Internal Discrepancy Amplificationcited by 3
- 2026LASA: Language-Agnostic Semantic Alignment at the Semantic Bottleneck for LLM Safetycited by 3
- 2026AgentLens: Interpretable Safety Steering via Mechanistic Subspaces for Multi-Turn Coding Agentcited by 3
- 2025Efficient but Vulnerable: Benchmarking and Defending LLM Batch Prompting Attackcited by 2
- 2026RouteScan: A Non-Intrusive Approach to Auditing MoE LLMs Safety via Expert Routing Telemetrycited by 2
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMscited by 1
- 2026When Think-with-Image Meets Safety: What Determines Multimodal Jailbreak Robustness?cited by 1
- 2026Evolving Jailbreaks: Automated Multi-Objective Long-Tail Attacks on Large Language Modelscited by 0
- 2026Ellipsoid Control: A White-list Jailbreak Defense via Benign Latent Modelingcited by 0
- 2026Active Adaptation, Not Static Defense: Temporal Dynamics of Preventative Steering in Adversarial Fine-Tuningcited by 0
- 2026ForeSight: Enhancing Risk Monitoring via Early Safety Signal Distillationcited by 0
- 2026ForeSight: Enhancing Risk Monitoring via Early Safety Signal Distillation12 Sep 2026
- 2026Active Adaptation, Not Static Defense: Temporal Dynamics of Preventative Steering in Adversarial Fine-Tuning9 Sep 2026
- 2026AgentLens: Interpretable Safety Steering via Mechanistic Subspaces for Multi-Turn Coding Agent21 Jun 2026
- 2026When Think-with-Image Meets Safety: What Determines Multimodal Jailbreak Robustness?27 May 2026
- 2026RouteScan: A Non-Intrusive Approach to Auditing MoE LLMs Safety via Expert Routing Telemetry24 May 2026
- 2026Ellipsoid Control: A White-list Jailbreak Defense via Benign Latent Modeling23 May 2026
- 2026LLM Safety From Within: Detecting Harmful Content with Internal Representations20 Apr 2026
- 2026LASA: Language-Agnostic Semantic Alignment at the Semantic Bottleneck for LLM Safety13 Apr 2026
- 2026Evolving Jailbreaks: Automated Multi-Objective Long-Tail Attacks on Large Language Models20 Mar 2026
- 2026HoneyTrap: Deceiving Large Language Model Attackers to Honeypot Traps with Resilient Multi-Agent Defense7 Jan 2026
- 2026ALERT: Zero-shot LLM Jailbreak Detection via Internal Discrepancy Amplification7 Jan 2026
- 2025Rethinking Jailbreak Detection of Large Vision Language Models with Representational Contrastive Scoring12 Dec 2025
11 more
- 2025ALMGuard: Safety Shortcuts and Where to Find Them as Guardrails for Audio-Language Models30 Oct 2025
- 2025SARSteer: Safeguarding Large Audio-Language Models via Safe-Ablated Refusal Steering20 Oct 2025
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defenses17 Oct 2025
- 2025False Sense of Security: Why Probing-based Malicious Input Detection Fails to Generalize4 Sep 2025
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMs28 Aug 2025
- 2025SoK: Evaluating Jailbreak Guardrails for Large Language Models12 Jun 2025
- 2025AdaSteer: Your Aligned LLM is Inherently an Adaptive Jailbreak Defender13 Apr 2025
- 2025STShield: Single-Token Sentinel for Real-Time Jailbreak Detection in Large Language Models23 Mar 2025
- 2025Efficient but Vulnerable: Benchmarking and Defending LLM Batch Prompting Attack18 Mar 2025
- 2025Emergent Response Planning in LLMs10 Feb 2025
- 2024Feint and Attack: Attention-Based Strategies for Jailbreaking and Protecting LLMs18 Oct 2024
- 2026LLM Safety From Within: Detecting Harmful Content with Internal Representationscited by 11
- 2025SARSteer: Safeguarding Large Audio-Language Models via Safe-Ablated Refusal Steeringcited by 8
- 2024Feint and Attack: Attention-Based Strategies for Jailbreaking and Protecting LLMscited by 5
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defensescited by 5
- 2025ALMGuard: Safety Shortcuts and Where to Find Them as Guardrails for Audio-Language Modelscited by 4
- 2025STShield: Single-Token Sentinel for Real-Time Jailbreak Detection in Large Language Modelscited by 3
- 2026ALERT: Zero-shot LLM Jailbreak Detection via Internal Discrepancy Amplificationcited by 3
- 2026Evolving Jailbreaks: Automated Multi-Objective Long-Tail Attacks on Large Language Modelscited by 0
- 2026Ellipsoid Control: A White-list Jailbreak Defense via Benign Latent Modelingcited by 0
- 2026ForeSight: Enhancing Risk Monitoring via Early Safety Signal Distillationcited by 0
- 2026ForeSight: Enhancing Risk Monitoring via Early Safety Signal Distillation12 Sep 2026
- 2026Ellipsoid Control: A White-list Jailbreak Defense via Benign Latent Modeling23 May 2026
- 2026LLM Safety From Within: Detecting Harmful Content with Internal Representations20 Apr 2026
- 2026Evolving Jailbreaks: Automated Multi-Objective Long-Tail Attacks on Large Language Models20 Mar 2026
- 2026ALERT: Zero-shot LLM Jailbreak Detection via Internal Discrepancy Amplification7 Jan 2026
- 2025ALMGuard: Safety Shortcuts and Where to Find Them as Guardrails for Audio-Language Models30 Oct 2025
- 2025SARSteer: Safeguarding Large Audio-Language Models via Safe-Ablated Refusal Steering20 Oct 2025
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defenses17 Oct 2025
- 2025STShield: Single-Token Sentinel for Real-Time Jailbreak Detection in Large Language Models23 Mar 2025
- 2024Feint and Attack: Attention-Based Strategies for Jailbreaking and Protecting LLMs18 Oct 2024
- 2025False Sense of Security: Why Probing-based Malicious Input Detection Fails to Generalizecited by 19
- 2025Efficient but Vulnerable: Benchmarking and Defending LLM Batch Prompting Attackcited by 2
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMscited by 1
- 2026Active Adaptation, Not Static Defense: Temporal Dynamics of Preventative Steering in Adversarial Fine-Tuningcited by 0
- 2026Active Adaptation, Not Static Defense: Temporal Dynamics of Preventative Steering in Adversarial Fine-Tuning9 Sep 2026
- 2025False Sense of Security: Why Probing-based Malicious Input Detection Fails to Generalize4 Sep 2025
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMs28 Aug 2025
- 2025Efficient but Vulnerable: Benchmarking and Defending LLM Batch Prompting Attack18 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2025DETAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification
- 2025Scalable Defense against In-the-wild Jailbreaking Attacks with Safety Context Retrieval
- 2025SafeInt: Shielding Large Language Models from Jailbreak Attacks via Safety-Aware Representation Intervention
- 2024Immune: Improving Safety Against Jailbreaks in Multi-modal LLMs via Inference-Time Alignment
- 2024SelfDefend: LLMs Can Defend Themselves against Jailbreaking in a Practical Manner
- 2025PandaGuard: Systematic Evaluation of LLM Safety against Jailbreaking Attacks
- 2026Re-Triggering Safeguards within LLMs for Jailbreak Detection
- 2025Layer-Level Self-Exposure and Patch: Affirmative Token Mitigation for Jailbreak Attack Defense