Understanding and Enhancing Safety Mechanisms of LLMs via Safety-Specific Neuron
Yiran Zhao, Wenxuan Zhang, Yuxi Xie, Anirudh Goyal, Kenji Kawaguchi, Michael Shieh
Abstract
Safety alignment for large language models (LLMs) has become a critical issue due to their rapid progress. However, our understanding of effective safety mechanisms in LLMs remains limited, leading to safety alignment training that mainly focuses on improving optimization, data-level enhancement, or adding extra structures to intentionally block harmful outputs. To address this gap, we develop a neuron detection method to identify safety neurons-those consistently crucial for handling and defending against harmful queries. Our findings reveal that these safety neurons constitute less than 1% of all parameters, are language-specific and are predominantly located in self-attention layers. Moreover, safety is collectively managed by these neurons in the first several layers. Based on these observations, we introduce a Safety Neuron Tuning method, named SN-Tune, that exclusively tune safety neurons without compromising models' general capabilities. SN-Tune significantly enhances the safety of instruction-tuned models, notably reducing the harmful scores of Llama3-8B-Instruction from 65.5 to 2.0, Mistral-7B-Instruct-v0.2 from 70.8 to 4.5, and Vicuna-13B-1.5 from 93.5 to 3.0. Moreover, SN-Tune can be applied to base models on efficiently establishing LLMs' safety mechanism. In addition, we propose Robust Safety Neuron Tuning method (RSN-Tune), which preserves the integrity of LLMs' safety mechanisms during downstream task finetuning by separating the safety neurons from models' foundation neurons.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
25 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- TraceRouter: Robust Safety for Large Foundation Models via Path-Level Intervention cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- TraceRouter: Robust Safety for Large Foundation Models via Path-Level Intervention cites Training language models to follow instructions with human feedback
- AsFT: Anchoring Safety During LLM Fine-Tuning Within Narrow Safety Basin cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Why LLM Safety Guardrails Collapse After Fine-tuning: A Similarity Analysis Between Alignment and Fine-tuning Datasets cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Why LLM Safety Guardrails Collapse After Fine-tuning: A Similarity Analysis Between Alignment and Fine-tuning Datasets cites Training language models to follow instructions with human feedback
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Training language models to follow instructions with human feedback
- Inference-Time Intervention: Eliciting Truthful Answers from a Language Model cites Locating and Editing Factual Associations in GPT
- Inference-Time Intervention: Eliciting Truthful Answers from a Language Model cites Measuring Massive Multitask Language Understanding
- Inference-Time Intervention: Eliciting Truthful Answers from a Language Model cites Training language models to follow instructions with human feedback
- Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety Neurons cites Locating and Editing Factual Associations in GPT
- Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety Neurons cites Measuring Massive Multitask Language Understanding
- Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety Neurons cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety Neurons cites Training language models to follow instructions with human feedback
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation cites AsFT: Anchoring Safety During LLM Fine-Tuning Within Narrow Safety Basin
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation cites Training language models to follow instructions with human feedback
Cited by top-tier papers25
- Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety NeuronsJianhui Chen, Xiaozhi Wang, Zijun Yao, Yushi Bai et al.NeurIPS 2025 · 53 citations
- Why LLM Safety Guardrails Collapse After Fine-tuning: A Similarity Analysis Between Alignment and Fine-tuning DatasetsLei Hsiung, Tianyu Pang, Yung-Chen Tang, Linyue Song et al.ACL 2026 · 22 citations
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning PerturbationYibo Wang, Tiansheng Huang, Li Shen, Huanjin Yao et al.NeurIPS 2025 · 22 citations
- AsFT: Anchoring Safety During LLM Fine-Tuning Within Narrow Safety BasinShuo Yang, Qihui Zhang, Yuyang Liu, Yue Huang et al.AAAI 2026 · 19 citations
- TraceRouter: Robust Safety for Large Foundation Models via Path-Level InterventionChuancheng Shi, shangze li, Wenjun Lu, Wenhua Wu et al.ICML 2026 · 12 citations
Builds on32
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- Inference-Time Intervention: Eliciting Truthful Answers from a Language ModelKenneth Li, Oam Patel, Fernanda B. Viégas, Hanspeter Pfister et al.NeurIPS 2023 · 1,549 citations
Related papers
- Neuronal Insights into LLM Attacks: Targeted Neuron Tuning for Precise and Robust Vulnerability PatchingDan Shi, Renren Jin, Zhuowen Han, Yuqi Ren et al.ACL Findings 2026
- Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow InstructionsFederico Bianchi, Mirac Suzgun, Giuseppe Attanasio, Paul Röttger et al.ICLR 2024 · 373 citations
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank ModificationsBoyi Wei, Kaixuan Huang, Yangsibo Huang, Tinghao Xie et al.ICML 2024 · 215 citations
- From "Sure" to "Sorry": Detecting Jailbreak in Large Vision Language Model via JailNeuronsYuyou Gan, Qingming Li, Junhao Li, Zhi Chen et al.ICLR 2026
- On the Role of Attention Heads in Large Language Model SafetyZhenhong Zhou, Haiyang Yu, Xinghua Zhang, Rongwu Xu et al.ICLR 2025
