Large language models (LLMs) rely on safety alignment to avoid responding to malicious user inputs. Unfortunately, jailbreak can circumvent safety guardrails, resulting in LLMs generating harmful content and raising concerns about LLM safety. Due to language models with intensive parameters often regarded as black boxes, the mechanisms of alignment and jailbreak are challenging to elucidate. In this paper, we employ weak classifiers to explain LLM safety through the intermediate hidden states. We first confirm that LLMs learn ethical concepts during pre-training rather than alignment and can identify malicious and normal inputs in the early layers. Alignment actually associates the early concepts with emotion guesses in the middle layers and then refines them to the specific reject tokens for safe generations. Jailbreak disturbs the transformation of early unethical classification into negative emotions. We conduct experiments on models from 7B to 70B across various model families to prove our conclusion. Overall, our paper indicates the intrinsical mechanism of LLM safety and how jailbreaks circumvent safety guardrails, offering a new perspective on LLM safety and reducing concerns. Our code is available at https://github.com/ydyjya/LLM-IHS-Explanation.
Jailbreaking Attacks vs. Content Safety Filters: How Far Are We in the LLM Safety Arms Race?
CISPA Helmholtz Center for Information Security(CISPA 欧洲信息安全中心);Max Planck Institute for Intelligent Systems(马克斯·普朗克智能系统研究所);Southern University of Science and Technology(南方科技大学)
Immune: Improving Safety Against Jailbreaks in Multi-modal LLMs via Inference-Time Alignment
University of Maryland(马里兰大学);Indian Institute of Technology Bombay(印度班加罗尔理工学院);Princeton University(普林斯顿大学);University of Colorado Boulder(科罗拉多大学博尔德分校);Capital One(Capital One公司);University of Central Florida(佛罗里达中央大学)
City University of Hong Kong(香港城市大学);Rutgers University(罗格斯大学);University of Science and Technology of China(中国科学技术大学);Universiteit van Amsterdam(阿姆斯特丹大学);Baidu Inc(百度公司)
SafeDialBench: A Fine-Grained Safety Evaluation Benchmark for Large Language Models in Multi-Turn Dialogues with Diverse Jailbreak Attacks
National Key Laboratory for Novel Software Technology, Nanjing University(南京大学新型软件技术国家重点实验室);University of Liverpool(利物浦大学);City University of Hong Kong(香港城市大学);School of Intelligence Science and Technology, Nanjing University(南京大学智能科学与技术学院);China Mobile Research Institute(中国移动研究院);China Mobile (Suzhou) Software Technology Co., Ltd(中国移动苏州软件技术有限公司)
FigStep: Jailbreaking Large Vision-Language Models via Typographic Visual Prompts
Tsinghua University(清华大学);Carnegie Mellon University(卡内基梅隆大学);Zhongguancun Laboratory(中关村实验室);National Financial Cryptography Research Center(国家金融密码学研究中心);Shandong Institute of Blockchain(山东区块链研究院);Shandong University(山东大学)
EVA: Editing for Versatile Alignment against Jailbreaks
ShanghaiTech University(上海科技大学);Sun Yat-sen University(中山大学);State Key Laboratory of Blockchain and Data Security(区块链与数据安全国家重点实验室);Tsinghua University(清华大学)
Beyond Visual Safety: Jailbreaking Multimodal Large Language Models for Harmful Image Generation via Semantic-Agnostic Inputs
State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications(网络与交换技术国家重点实验室,北京邮电大学);School of Cyberspace Security, Beijing University of Posts and Telecommunications(网络安全学院,北京邮电大学)
PandaGuard: Systematic Evaluation of LLM Safety against Jailbreaking Attacks
Beijing Institute of AI Safety and Governance (Beijing-AISI)(北京人工智能安全与治理研究院);Beijing Key Laboratory of Safe AI and Superalignment(北京安全人工智能与超对齐重点实验室);BrainCog Lab, CASIA(CASIA脑认知实验室)
Test-Time Immunization: A Universal Defense Framework Against Jailbreaks for (Multimodal) Large Language Models
NLPR & MAIS, Institute of Automation, Chinese Academy of Sciences(国家工程实验室与人工智能研究所,中国科学院);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)
WildTeaming at Scale: From In-the-Wild Jailbreaks to (Adversarially) Safer Language Models
Allen Institute for Artificial Intelligence(艾伦人工智能研究所);Seoul National University(首尔大学);Carnegie Mellon University(卡内基梅隆大学);University of Washington(华盛顿大学)
X-Boundary: Establishing Exact Safety Boundary to Shield LLMs from Multi-Turn Jailbreaks without Compromising Usability
School of Electronic Information and Electric Engineering, Shanghai Jiao Tong University(上海交通大学电子信息与电气工程学院);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)
DELMAN: Dynamic Defense Against Large Language Model Jailbreaking with Model Editing
ShanghaiTech University(上海科技大学);The State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全全国重点实验室);The CoAI group, Tsinghua University(清华大学CoAI课题组)
Bleeding Pathways: Vanishing Discriminability in LLM Hidden States Fuels Jailbreak Attacks
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);Ant Group(蚂蚁集团)
Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignment
University of Wisconsin-Madison(威斯康星大学麦迪逊分校);University of Michigan-Ann Arbor(密歇根大学安娜堡分校);Princeton University(普林斯顿大学);University of California, Davis(加州大学戴维斯分校);University of Chicago(芝加哥大学)