SafeInt: Shielding Large Language Models from Jailbreak Attacks via Safety-Aware Representation Intervention

Jiaqi Wu, Chen Chen, Chunyan Hou, Xiaojie Yuan


Abstract
With the widespread real-world deployment of large language models (LLMs), ensuring their behavior complies with safety standards has become crucial. Jailbreak attacks exploit vulnerabilities in LLMs to induce undesirable behavior, posing a significant threat to LLM safety. Previous defenses often fail to achieve both effectiveness and efficiency simultaneously. Defenses from a representation perspective offer new insights, but existing interventions cannot dynamically adjust representations based on the harmfulness of the queries. To address this limitation, we propose SafeIntervention (SafeInt), a novel defense method that shields LLMs from jailbreak attacks through safety-aware representation intervention. Built on our analysis of the representations of jailbreak samples, the core idea of SafeInt is to relocate jailbreak-related representations into the rejection region. This is achieved by intervening in the representation distributions of jailbreak samples to align them with those of unsafe samples. We conduct comprehensive experiments covering six jailbreak attacks, two jailbreak datasets, and two utility benchmarks. Experimental results demonstrate that SafeInt outperforms all baselines in defending LLMs against jailbreak attacks while largely maintaining utility. Additionally, we evaluate SafeInt against adaptive attacks and verify its effectiveness in mitigating real-time attacks.
Anthology ID:
2025.findings-emnlp.450
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2025
Month:
November
Year:
2025
Address:
Suzhou, China
Editors:
Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, Violet Peng
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
8473–8488
Language:
URL:
https://preview.aclanthology.org/author-page-yu-wang-polytechnic/2025.findings-emnlp.450/
DOI:
10.18653/v1/2025.findings-emnlp.450
Bibkey:
Cite (ACL):
Jiaqi Wu, Chen Chen, Chunyan Hou, and Xiaojie Yuan. 2025. SafeInt: Shielding Large Language Models from Jailbreak Attacks via Safety-Aware Representation Intervention. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 8473–8488, Suzhou, China. Association for Computational Linguistics.
Cite (Informal):
SafeInt: Shielding Large Language Models from Jailbreak Attacks via Safety-Aware Representation Intervention (Wu et al., Findings 2025)
Copy Citation:
PDF:
https://preview.aclanthology.org/author-page-yu-wang-polytechnic/2025.findings-emnlp.450.pdf
Checklist:
 2025.findings-emnlp.450.checklist.pdf