跳到主要导航 跳到搜索 跳到主要内容

JBShield: Defending Large Language Models from Jailbreak Attacks through Activated Concept Analysis and Manipulation

  • Shenyi Zhang
  • , Yuchen Zhai
  • , Keyan Guo
  • , Hongxin Hu
  • , Shengnan Guo
  • , Zheng Fang
  • , Lingchen Zhao
  • , Chao Shen
  • , Cong Wang
  • , Qian Wang
  • Wuhan University
  • SUNY Buffalo
  • City University of Hong Kong

科研成果: 书/报告/会议事项章节会议稿件同行评审

4 引用 (Scopus)

摘要

Despite the implementation of safety alignment strategies, large language models (LLMs) remain vulnerable to jailbreak attacks, which undermine these safety guardrails and pose significant security threats. Some defenses have been proposed to detect or mitigate jailbreaks, but they are unable to withstand the test of time due to an insufficient understanding of jailbreak mechanisms. In this work, we investigate the mechanisms behind jailbreaks based on the Linear Representation Hypothesis (LRH), which states that neural networks encode high-level concepts as subspaces in their hidden representations. We define the toxic semantics in harmful and jailbreak prompts as toxic concepts and describe the semantics in jailbreak prompts that manipulate LLMs to comply with unsafe requests as jailbreak concepts. Through concept extraction and analysis, we reveal that LLMs can recognize the toxic concepts in both harmful and jailbreak prompts. However, unlike harmful prompts, jailbreak prompts activate the jailbreak concepts and alter the LLM output from rejection to compliance. Building on our analysis, we propose a comprehensive jailbreak defense framework, JBSHIELD, consisting of two key components: jailbreak detection JBSHIELD-D and mitigation JBSHIELD-M. JBSHIELD-D identifies jailbreak prompts by determining whether the input activates both toxic and jailbreak concepts. When a jailbreak prompt is detected, JBSHIELD-M adjusts the hidden representations of the target LLM by enhancing the toxic concept and weakening the jailbreak concept, ensuring LLMs produce safe content. Extensive experiments demonstrate the superior performance of JBSHIELD, achieving an average detection accuracy of 0.95 and reducing the average attack success rate of various jailbreak attacks to 2% from 61% across distinct LLMs.

源语言英语
主期刊名Proceedings of the 34th USENIX Security Symposium
出版商USENIX Association
8215-8234
页数20
ISBN(电子版)9781939133526
出版状态已出版 - 2025
活动34th USENIX Security Symposium, USENIX Security 2025 - Seattle, 美国
期限: 13 8月 202515 8月 2025

出版系列

姓名Proceedings of the 34th USENIX Security Symposium

会议

会议34th USENIX Security Symposium, USENIX Security 2025
国家/地区美国
Seattle
时期13/08/2515/08/25

学术指纹

探究 'JBShield: Defending Large Language Models from Jailbreak Attacks through Activated Concept Analysis and Manipulation' 的科研主题。它们共同构成独一无二的指纹。

引用此