atlas

Research map / Large language models / Language, safety and interpretability

Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety Neurons

NeurIPS 2025 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Identifies sparse "safety neurons" in LLMs via inference-time activation contrasting (DPO vs SFT) and dynamic activation patching, showing ~5% of neurons can restore over 90% of safety and that safety and helpfulness neurons overlap, explaining alignment tax, and proposes a neuron-based pre-generation safeguard.

Problem

Understanding the internal mechanisms of safety alignment in LLMs at the neuron level, and explaining the alignment tax, given that existing mechanistic interpretability methods target few-token tasks and attention heads rather than open-ended safety behavior.

Approach

Locate candidate neurons by comparing RMS activation differences between SFT and DPO models on the same generated text (inference-time activation contrasting), then verify causal effect on open-ended generation by dynamically patching the aligned model's neuron activations into the unaligned model at every decoding step (dynamic activation patching); enhancement rather than ablation is used to fin

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Patch SFT with DPO activations on top safety neuronsLlama2-7B SFT · Beavertailscausal effect (%): +101Helped
Patch SFT with DPO activations on top safety neuronsMistral-7B SFT · RedTeamcausal effect (%): +80Helped
Patch SFT with DPO activations on top safety neuronsGemma-7B SFT · HarmBenchcausal effect (%): +79Helped
Patch SFT with DPO activations on top safety neuronsQwen2.5-3B SFT · JailBreakLLMscausal effect (%): +83Helped
Use top safety neurons rather than random neurons for DPO-activation patchingBase and SFT models · Beavertailscost scoreHelped
Use top 5% safety neurons rather than random neurons for DPO-activation patchingBase and SFT models · Beavertailscost score: 1.15×10⁻⁶ to 1.67×10⁻¹⁸Helped
Patch with safety-neuron activationsBase and SFT models · general benchmarksperformance change: -0.04 to +0.05No clear effect
Use helpfulness-DPO activations instead of safety-DPO activations on shared neuronsLlama2 safety DPO · Beavertailssafety score change: 7.3Hurt
Use safety-DPO activations instead of helpfulness-DPO activations on shared neuronsLlama2 helpfulness DPO · Beavertailssafety score change: 10.1Helped
Use helpfulness-DPO activations instead of safety-DPO activations on shared neuronsMistral safety DPO · Beavertailssafety score change: 6.6Hurt
Use safety-DPO activations instead of helpfulness-DPO activations on shared neuronsMistral helpfulness DPO · Beavertailssafety score change: 10.7Helped
Identify neurons by comparing SFT and DPO rather than other model pairs (ablation)Safety-neuron identification · Beavertailscost scoreHelped

Surprising findings

Limitations

Experimental setup

Datasets: ShareGPT HH-RLHF RewardBench Stanford Human Preferences (SHP) H4 Stack Exchange Preferences IEFeedback Beavertails RedTeam HarmBench JailBreakLLMs Wikitext-2 MMLU

Benchmarks: Beavertails RedTeam HarmBench JailBreakLLMs Wikitext-2 MMLU GSM8K BBH TruthfulQA

Metrics: cost score (beaver-7b-v1.0-cost) causal effect accuracy perplexity Spearman correlation GPT-4 score

Baselines: Pruning (Wanda-based parameter pruning) SN-Tune Random neurons

Builds on: DPO activation patching Invertible Adapters with Activation Alignment (IA3-style PEFT) Wanda Circuit breakers

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy