paper-with-me

Papers

How Alignment and Jailbreak Work: Explain LLM Safety through Intermediate Hidden States

2024-06-09 · Zhenhong Zhou, Haiyang Yu, Xinghua Zhang, Rongwu Xu, Fei Huang, Yongbin Li

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.

📄 PDF Abstract BibTeX arXiv:2406.05644

Code (1)

ydyjya/llm-ihs-explanation 공식 구현 pytorch

Tasks

Safety Alignment

Similar Papers 제목 키워드 기반

Babel: Jailbreaking Safety Attention via Obfuscation Distribution Optimized Sampling

2026-05-18 · Ziwei Wang, Jing Chen, Ruichao Liang, Zhi Wang 외 arxiv

Despite rigorous safety alignment, Large Language Models (LLMs) remain vulnerable to jailbreak attacks. Existing black-box methods often rely on heuristic templates or exhaustive trials, lacking mechanistic interpretabil…

Immune: Improving Safety Against Jailbreaks in Multi-modal LLMs via Inference-Time Alignment

2024-11-27 · CVPR 2025 1 · Soumya Suvra Ghosal, Souradip Chakraborty, Vaibhav Singh, Tianrui Guan 외

With the widespread deployment of Multimodal Large Language Models (MLLMs) for visual-reasoning tasks, improving their safety has become crucial. Recent research indicates that despite training-time safety alignment, the…

Safety AlignmentVisual Reasoning

Why LLM Safety Guardrails Collapse After Fine-tuning: A Similarity Analysis Between Alignment and Fine-tuning Datasets

2025-06-05 · Lei Hsiung, Tianyu Pang, Yung-Chen Tang, Linyue Song 외

Recent advancements in large language models (LLMs) have underscored their vulnerability to safety alignment jailbreaks, particularly when subjected to downstream fine-tuning. However, existing mitigation strategies prim…

Safety Alignment

LLMs Can Defend Themselves Against Jailbreaking in a Practical Manner: A Vision Paper

2024-02-24 · Daoyuan Wu, Shuai Wang, Yang Liu, Ning Liu

Jailbreaking is an emerging adversarial attack that bypasses the safety alignment deployed in off-the-shelf large language models (LLMs). A considerable amount of research exists proposing more effective jailbreak attack…

Adversarial AttackSafety Alignment

Forewarned is Forearmed: Pre-Synthesizing Jailbreak-like Instructions to Enhance LLM Safety Guardrail to Potential Attacks

2025-08-27 · Sheng Liu, Qiang Sheng, Danding Wang, Yang Li 외 arxiv

Despite advances in improving large language model (LLM) to refuse to answer malicious instructions, widely used LLMs remain vulnerable to jailbreak attacks where attackers generate instructions with distributions differ…

Text Generation