paper-with-me

홈 › Papers

Shaping the Safety Boundaries: Understanding and Defending Against Jailbreaks in Large Language Models

2024-12-22 · Lang Gao, Jiahui Geng, Xiangliang Zhang, Preslav Nakov, Xiuying Chen

Jailbreaking in Large Language Models (LLMs) is a major security concern as it can deceive LLMs to generate harmful text. Yet, there is still insufficient understanding of how jailbreaking works, which makes it hard to develop effective defense strategies. We aim to shed more light into this issue: we conduct a detailed large-scale analysis of seven different jailbreak methods and find that these disagreements stem from insufficient observation samples. In particular, we introduce \textit{safety boundary}, and we find that jailbreaks shift harmful activations outside that safety boundary, where LLMs are less sensitive to harmful information. We also find that the low and the middle layers are critical in such shifts, while deeper layers have less impact. Leveraging on these insights, we propose a novel defense called \textbf{Activation Boundary Defense} (ABD), which adaptively constrains the activations within the safety boundary. We further use Bayesian optimization to selectively apply the defense method to the low and the middle layers. Our experiments on several benchmarks show that ABD achieves an average DSR of over 98\% against various forms of jailbreak attacks, with less than 2\% impact on the model's general capabilities.

📄 PDF Abstract BibTeX arXiv:2412.17034

Code (0)

등록된 구현이 없습니다.

Tasks

Bayesian Optimization

Similar Papers 제목 키워드 기반

Defending Large Language Models Against Jailbreaking Attacks Through Goal Prioritization

2023-11-15 · Zhexin Zhang, Junxiao Yang, Pei Ke, Fei Mi 외

While significant attention has been dedicated to exploiting weaknesses in LLMs through jailbreaking attacks, there remains a paucity of effort in defending against these attacks. We point out a pivotal factor contributi…

Instruction Following

Unraveling LLM Jailbreaks Through Safety Knowledge Neurons

2025-09-01 · Chongwen Zhao, Yutong Ke, Kaizhu Huang 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 synt…

Defending Large Language Models Against Jailbreak Attacks via In-Decoding Safety-Awareness Probing

2026-01-15 · Yinzhi Zhao, Ming Wang, Shi Feng, Xiaocui Yang 외 arxiv

Large language models (LLMs) have achieved impressive performance across natural language tasks and are increasingly deployed in real-world applications. Despite extensive safety alignment efforts, recent studies show th…

No Free Lunch for Defending Against Prefilling Attack by In-Context Learning

2024-12-13 · Zhiyu Xue, Guangliang Liu, Bocheng Chen, Kristen Marie Johnson 외

The security of Large Language Models (LLMs) has become an important research topic since the emergence of ChatGPT. Though there have been various effective methods to defend against jailbreak attacks, prefilling attacks…

In-Context LearningSafety AlignmentSentence

Defending Large Language Models Against Jailbreak Attacks via Layer-specific Editing

2024-05-28 · Wei Zhao, Zhe Li, Yige Li, Ye Zhang 외

Large language models (LLMs) are increasingly being adopted in a wide range of real-world applications. Despite their impressive performance, recent studies have shown that LLMs are vulnerable to deliberately crafted adv…