SafeEvo: Explaining Large Model Safety Alignment Mechanisms and Evolution from the Perspective of Refusal CircuitsSafeEvo: Deciphering the Safety Alignment Mechanism and Evolution in Language Models
SafeEvo finds that base models contain weak refusal circuits that drift during alignment; SCA, which fine-tunes only these circuits, reduces ASR while preserving capabilities.
- Harmful behaviors of large models pose safety risks; existing alignment methods lack research into internal mechanisms, and full-parameter alignment easily induces over-refusal and an alignment tax that harms general capabilities; existing safety interpretability research has overlooked mechanisms in pretrained base models and cross-stage evolution.
- SafeEvo extracts sparse refusal circuits from pretrained models via differentiable masks and dual-branch optimization and tracks their evolution; it then proposes SCA, which strictly constrains LoRA parameter updates to the pretrained refusal circuits during alignment fine-tuning.
- Experiments found that base models have weak refusal circuits and that after ablation the ASR rises above 88%; during alignment the circuits drift; SCA reduces ASR across 3 models and two alignment algorithms while preserving general capabilities such as GSM8K reasonably well and reducing over-refusal.
- The paper does not specifically discuss limitations and future work; the experiments cover 3 dense models of 7B–8B, the circuit units are limited to MLP neurons, and the paper does not report agreement between automated review and human evaluation.
- Evaluated models
- Llama-3-8BQwen-2.5-7BMistral-7B-Instruct-v0.1
- Benchmarks
- LLM-LATBeaverTailsHarmBenchAdvBenchGSM8KMMLUHellaSwagXSTestPKU-SafeRLHF
- Metrics
- ASRRefusal RateOver-refusal RateAccuracyJaccard similarity
The researchers propose the interpretability framework SafeEvo, attributing large models' safety refusal to sparse refusal circuits and tracking their evolution during alignment. The method uses differentiable mask optimization to extract refusal circuits from pretrained base models. On Llama-3-8B, Qwen-2.5-7B, and Mistral-7B, these circuits occupy less than 1% of parameters yet achieve 100% out-of-distribution refusal rate on BeaverTails; after ablation, the refusal rate drops to 0%, and HarmBench attack success rates rise to 91.19%, 88.68%, and 88.05%, respectively. Tracking alignment checkpoints reveals that circuit overlap between adjacent checkpoints drops from 98% to 78%, and independently extracted circuits overlap only 26%, indicating that refusal circuits are neither unique nor stable. The authors accordingly propose that the alignment tax may stem from updates to refusal circuits spilling over into utility-related parameters.
Why it was selectedThe paper traces the refusal circuits in pretrained models and their drift during alignment from a circuit perspective, providing a mechanistic explanation for the alignment tax.
Related events and news
1 events · 0 news mentions
- This event's paper
SafeEvo:语言模型安全对齐机制与演化
Paper analysis
What problem does this paper attempt to solve?
The paper aims to analyze the safety mechanisms and alignment evolution of base models from a circuit perspective, and to explore how to mitigate the alignment tax where full-parameter alignment harms general capabilities.
The existence of safety mechanisms in pretrained base models, their evolution patterns across alignment stages, and how to avoid the alignment tax weakening general capabilities during alignment fine-tuning.
- Scenario and importance: As large language model applications expand to complex agent systems, the risk of harmful behaviors spreads accordingly, making reliable safety alignment a core component of ensuring system trustworthiness.
- Shortcomings of existing methods: Existing alignment techniques mostly rely on surface behavioral constraints from data and preference optimization, while safety interpretability research often focuses on representations or neurons at a fixed endpoint after alignment, without exploring internal mechanisms of base models and alignment evolution.
- Core observation and hypothesis: Based on the phenomenon that pretrained base models occasionally refuse harmful queries, the authors hypothesize that sparse, functionally complete refusal circuits already exist in base models; they further believe that unconstrained alignment causes unstable circuit drift and interferes with capability parameters, serving as a potential mechanism for the alignment tax.
- Proposed solution: The paper proposes the interpretability framework SafeEvo, which extracts refusal circuits via differentiable mask optimization and tracks their evolution; it further proposes Safety Circuit Alignment (SCA), which restricts fine-tuning updates to pretrained refusal circuits.
What related research exists?
The paper builds on existing work in alignment algorithms, safety interpretability, and circuit extraction, pointing out that prior research lacks analysis of pretrained base models and cross-stage evolution.
Safety alignment and safety interpretability research proceed from behavioral constraints and internal representations, respectively, but prior work lacks cross-stage tracking of base model mechanisms and alignment evolution from a circuit perspective.
- Large language model alignment and alignment tax mitigation
- Behavioral-level alignment algorithms: Mainstream work guides models to refuse harmful queries through supervised fine-tuning (SFT) on synthetic refusal data (e.g., Yang et al. 2026, Fan et al. 2026) or direct preference optimization (DPO) on preference pairs (e.g., Ji et al. 2026a, Deng et al. 2026).
- Alignment tax mitigation strategies: Optimizing only for refusal easily induces over-refusal and weakens general capabilities; subsequent research mitigates the tension through synthetic data balancing helpfulness and harmlessness (Wang et al. 2024, Huang et al. 2026) and reward shaping with explicit utility constraints (Ji et al. 2026b).
- Causal neuron localization: Some work uses interpretability methods to localize causal neurons for safety boundaries (Wang et al. 2026, Zhao et al. 2025b, Behrouzi et al. 2026b). The authors state that SafeEvo differs in localizing subgraph circuits that independently implement sufficiency for refusal behavior, rather than individual causal neurons.
- Safety mechanisms and interpretability research
- Representation- and component-level analysis: Representation-level work decodes intermediate activations and finds that hidden states encode polarity (He et al. 2025, Jiao et al. 2026); component-level work uses activation patching to find that sparse attention heads carry refusal behavior (Zheng et al. 2026, Zhou et al. 2025b).
- Neuron- and circuit-level analysis: Neuron-level research identifies safety neurons for analyzing jailbreaks and enhancing alignment (Zhao et al. 2026, Zhao et al. 2025b). The authors note that previous work mainly studies aligned models, while SafeEvo tracks the evolution of base models across checkpoints.
- Comparison of circuit extraction methods: Previous scoring methods based on activation, attribution, or weights (Zhao et al. 2025b, Chen et al. 2024, Yi et al. 2024) only capture single-token generation circuits; SafeEvo transforms this into a differentiable mask optimization problem.
- Baseline methods and experimental benchmarks
- Baseline methods: Include full-parameter LoRA fine-tuning (Full LoRA), random parameter updates matching the same sparsity (Random baseline), and the safety-neuron-based tuning method SN-Tune (Zhao et al. 2025b).
- Experimental benchmarks: Circuit extraction uses LLM-LAT (Sheshadri et al. 2025); safety testing uses HarmBench (Mazeika et al. 2024) and AdvBench (Zou et al. 2023); general capability testing includes GSM8K, MMLU, HellaSwag; over-refusal testing includes XSTest and BeaverTails.
- Positioning: The authors position SafeEvo as a unified framework connecting base model mechanism analysis, cross-checkpoint dynamic tracking, and circuit-targeted alignment, using mechanistic findings to support more precise alignment algorithm design.
- Large language model alignment and alignment tax mitigation
How does the paper address this problem?
The paper extracts refusal circuits from base models via dual-branch differentiable mask optimization and tracks their evolution, then proposes the SCA alignment algorithm that updates only these circuits.
SafeEvo extracts sparse refusal circuits from base models via differentiable mask optimization and tracks their evolution, then proposes Safety Circuit Alignment (SCA) to confine alignment updates to pretrained circuits.
Refusal Circuit Candidate Units and Network Partitioning
- Candidate unit definition: The output of projection rows in gated MLPs is used as neuron units. A gated MLP contains gate, up, and down projections; each projection's output row vector corresponds to a neuron. Collecting neurons from all layers forms the candidate set U.
- Complementary network partitioning: A binary mask variable is assigned to each candidate neuron. Through diagonal mask matrices, the projection linear mapping is precisely partitioned into two complementary subgraphs: the refusal circuit and the compliant complement: zCℓ,p = Mℓ,p Wℓ,p hℓ,p, zC̄ℓ,p = (I − Mℓ,p) Wℓ,p hℓ,p (Formula explanation: Mℓ,p selects refusal circuit outputs, while the complement mask I − Mℓ,p retains harmful compliant outputs).
- Computational subgraph properties: By zeroing gate and up projections to remove their intermediate inputs, and zeroing down projections to remove contributions to the residual stream, the extracted object forms a sparse computational subgraph rather than an isolated set of neurons.
Dual-Branch Differentiable Mask Extraction Optimization
- Continuous relaxation and straight-through estimator: Discrete masks are parameterized as latent variables q, mapped to soft masks via Sigmoid, and in forward propagation a binarization threshold of 0.5 with a straight-through estimator (STE) maintains discrete forward propagation and gradient backpropagation; latent variables are initialized to 0.2, starting from the full model and gradually pruning.
- Dual-branch supervised loss: With model weights frozen, the loss optimizes masks, including the negative log-likelihood of the refusal circuit on refusal completions, the negative log-likelihood of the complement model on compliant completions, and an L1 sparsity penalty: Lext(M) = α LSFT(M; Dref) + β LSFT(M; Dcmp) + λmlp ∑ℓ,p (|m̃ℓ,p|1)/(dout,p) (Formula explanation: the first term constrains the circuit's sufficiency for refusal, the second avoids trivial all-selected solutions, and the third drives mask sparsity).
- Optimization parameter configuration: Loss coefficients are set to α = 1, β = 1, λmlp = 0.05; the Fused AdamW optimizer is used with learning rate 0.01 and batch size 4; validation loss reaches early stopping at the 2nd epoch (50 update steps).
Cross-Checkpoint Circuit Evolution Tracking Protocol
- Warm-start continuous tracking: During SFT alignment of Llama-3-8B, the circuit mask extracted from the previous checkpoint is used as the initial state for extraction at the next checkpoint, capturing smooth incremental changes.
- Overlap quantification metric: Jaccard similarity is computed between adjacent checkpoints and between multiple independent runs at the same checkpoint, quantifying structural drift and extraction stability.
Safety Circuit Alignment (SCA) Algorithm Implementation
- Parameter update space constraint: SCA reuses binary masks extracted from the pretrained model, gating the gradients of the LoRA update matrix B for MLP projections through mask rows, so complement neurons and attention modules are completely unupdated.
- General alignment objective adaptation: SCA does not change the loss function itself, directly supporting supervised fine-tuning (SFT) and direct preference optimization (DPO); DPO sets temperature hyperparameter β = 0.1, 3 training epochs, and effective batch size 8.
What experiments did the paper conduct?
Experiments on three open-source models confirm that base models have weak refusal circuits and that drift occurs during alignment, and SCA reduces ASR while preserving general capabilities.
Experimental Setup
- Models tested: Pretrained base models Llama-3-8B, Qwen-2.5-7B, Mistral-7B-v0.1 (circuit extraction and ablation experiments); in safety alignment experiments, Mistral uses the instruction-tuned version Mistral-7B-Instruct-v0.1 (because its base model cannot stably follow instruction formats), while the other two remain base models.
- Datasets and benchmarks: Circuit extraction uses LLM-LAT (100 training, 50 validation, 4,948 total available records); sufficiency testing uses BeaverTails (50 harmful prompts); safety evaluation uses HarmBench (159 prompts) and AdvBench; general capability uses GSM8K, MMLU, HellaSwag; over-refusal evaluation uses XSTest (200 unsafe control prompts, 250 benign prompts) and BeaverTails; alignment training sets are LLM-LAT (SFT) and PKU-SafeRLHF (DPO).
- Baseline methods: Full-parameter fine-tuning LoRA (Full LoRA, updating all projections and attention layers), random updates at equal sparsity (Random baseline), safety neuron tuning SN-Tune (selecting top neurons based on PLND semantics).
- Evaluation metrics: Attack success rate (ASR, measuring compliance rate under harmful inputs, lower is better), explicit refusal rate (Refusal Rate, measuring refusal proportion under harmful inputs), general capability accuracy (GSM8K, MMLU, HellaSwag, higher is better), over-refusal rate (Over-refusal Rate, measuring refusal proportion under benign inputs, lower is better).
- Evaluation methods: ASR is scored by Llama-Guard-3-8B using greedy decoding; explicit refusal rate uses the classifier from Röttger et al. (2024), truncating the first 150 characters and removing prompt echoes; general capability evaluation uses a 5-shot harness with a maximum of 2000 samples per task.
- Training and statistical settings: LoRA rank is 16, alpha is 16, dropout is 0; SFT trains for 16 epochs with learning rate 0.0001; DPO trains for 3 epochs; multi-random-seed experiments use 4 training seeds; confidence intervals are pairwise 95% bootstrap CIs over resampled HarmBench prompts.
Main Results
Swipe horizontally to read the table
Model and Setting HarmBench(↓) AdvBench(↓) GSM8K(↑) MMLU(↑) XSTest(↓) Llama-3-8B (Base Model) 50.31 52.88 50.34 65.36 0.8 Llama-3-8B (LoRA DPO) 16.98 12.69 49.51 65.46 2.8 Llama-3-8B (SCA DPO) 0.63 0.38 48.98 65.60 3.2 Qwen-2.5-7B (Base Model) 33.96 7.50 83.09 74.21 5.2 Qwen-2.5-7B (LoRA DPO) 0.00 0.19 86.81 73.97 34.8 Qwen-2.5-7B (SCA DPO) 0.00 0.19 81.73 74.21 17.6 Mistral-7B-v0.1 (LoRA DPO) 16.35 5.58 34.80 53.60 4.8 Mistral-7B-v0.1 (SCA DPO) 7.55 4.23 33.51 53.82 5.6 (Note: Data from Table 2; the table shows comparisons of Base models and LoRA vs. SCA under DPO objective; due to space, SFT objective, Random baseline, SN-Tune baseline, and Mistral Base model rows are omitted)
- Safety improvement: The authors report SCA reduces attack success rates to low levels across multiple models, achieving defense performance comparable to or better than full-parameter updates on both HarmBench and AdvBench.
- General capability preservation: The authors state that constraining updates to refusal circuits effectively mitigates the alignment tax, with models maintaining accuracy close to the initial model on general benchmarks such as mathematical reasoning and multi-task language understanding.
- Over-refusal suppression: The authors note that full-parameter fine-tuning easily causes over-defense on benign prompts, while SCA reduces the over-refusal rate on benign queries while maintaining safety.
Refusal Circuit Discovery and Causal Ablation in Pretrained Base Models
- What was tested: Candidate circuit C1 was extracted from unaligned Llama-3-8B, Qwen-2.5-7B, and Mistral-7B-v0.1, and its standalone refusal rate was tested on the BeaverTails dataset (50 harmful queries); then C1 was zeroed out on HarmBench and compared with random neuron zeroing at the same density.
- Results: On BeaverTails, the initial refusal rates of the three base models are 15.63%–48.04%; the standalone refusal circuit C1, with less than 1% of parameters, achieves a refusal rate of 100.00%, while the complement branch drops to 0.00% (Table 1); after ablating C1 on HarmBench, model refusal rates drop to 0.00%–0.63%, and ASR rises from 48.43%, 32.70%, 42.14% to 91.19%, 88.68%, 88.05% respectively (Table 9 / Figure 3), while same-density random ablation yields ASRs of 49.06%, 64.15%, 35.22%.
- Authors' interpretation: The authors believe base models already contain weak refusal circuits that can independently perform refusal; ablation results indicate that refusal circuits play a causally central role in model safety behavior.
Tracking Refusal Circuit Evolution Dynamics During Alignment
- What was tested: During SFT alignment of Llama-3-8B, refusal circuits of adjacent checkpoints were extracted with warm-start from previous checkpoints, and Jaccard similarity was computed; multiple independent extractions at a single checkpoint were also performed to assess random variability.
- Results: The average overlap of circuit neurons from independent extractions at the same checkpoint is only 0.26; similarity between consecutive checkpoints along the alignment path gradually decreases from an initial 1.00 to 0.78 after 20 checkpoints; similarity between the base model circuit and the circuit after multiple alignment steps is about 0.60 (Figure 4).
- Authors' interpretation: The authors believe refusal circuits exhibit functional redundancy (non-uniqueness) in models and undergo gradual structural drift during alignment training; this drift affecting general capability parameters is a possible cause of the alignment tax.
Multi-Random-Seed Robustness and Parameter Random Baseline Comparison
- What was tested: SCA was compared with a random parameter update baseline at the same sparsity across 4 training seeds on HarmBench ASR, with pairwise prompt-level 95% bootstrap confidence intervals.
- Results: SCA's ASR is lower than the random baseline across all 4 seeds: Llama-3-8B 5.48 ± 3.27% vs. 20.28 ± 6.00% (reduction of 14.80 percentage points, 95% CI [11.48, 18.55]); Qwen-2.5-7B 11.32 ± 5.51% vs. 19.81 ± 3.43% (reduction of 8.49 percentage points, 95% CI [4.72, 12.42]); Mistral-7B-v0.1 5.35 ± 2.44% vs. 12.58 ± 7.00% (reduction of 7.23 percentage points, 95% CI [3.77, 10.85]) (Table 4).
- Authors' interpretation: The authors note that all confidence intervals exclude zero, indicating SCA's defense gains stem from targeted refusal circuit updates, not merely from parameter sparsity constraints.
Other Ablations and Analyses
- XSTest unsafe control and benign over-refusal trade-off: Under SFT, SCA's unsafe control ASR on Llama, Qwen, Mistral is 62.0%, 47.5%, 51.0%, with benign over-refusal rates of 1.6%, 6.8%, 5.6%; under DPO, ASR is 48.5%, 36.0%, 21.5%, with over-refusal rates of 3.2%, 17.6%, 5.6% (Table 3).
- Safety neuron baseline SN-Tune comparison: Under SFT, SN-Tune's HarmBench ASR on Llama, Qwen, Mistral is 0.00%, 4.40%, 5.03%, but XSTest over-refusal rates are as high as 86.4%, 42.0%, 25.6%, and GSM8K drops by 18.80, 12.73, 4.62 percentage points respectively (Table 2).
- Circuit parameter scale and sparsity: Trainable parameter proportions for Llama-3-8B, Qwen-2.5-7B, Mistral-7B-Instruct-v0.1 are 0.3513% (28.31M), 0.3960% (30.28M), 0.3894% (28.31M) (Table 5).
- Llama random baseline ensemble comparison: Across 18 random seeds, the worst-performing circuit seed has an ASR of 8.81%, better than the best-performing random seed at 11.32% (Appendix C).
- Counterexamples and trade-offs: In the Qwen-2.5-7B SFT setting, LoRA's HarmBench ASR is 0.63%, lower than SCA's 6.92% (Table 2); on the XSTest unsafe control set, SCA's ASR is higher than Full-SFT (Table 3), which the authors explain in Appendix D as Full-SFT achieving broader unsafe control coverage but with more over-refusal.
What are some points that can be further explored?
The paper does not set aside a dedicated section for limitations and future work; experiments cover three models of 7B–8B scale and gated MLP neuron-level circuits.
Limitations and Future Directions Noted by the Authors
- The paper does not specifically discuss limitations: The paper does not include a separate Limitations, Discussion, or Future Work section, and does not specifically discuss research limitations or future work directions in the main text or conclusion.
Experimental Coverage
- Model coverage: Experiments tested Llama-3-8B, Qwen-2.5-7B, and Mistral-7B-v0.1 (including the Instruct version), a total of 3 dense language models in the 7B–8B range (Section 3.2, 4.2).
- Circuit level limitation: Both circuit extraction and fine-tuning updates are limited to neurons in gated MLP modules; self-attention modules are not included in the circuit search space (Section 3.1, 4.1).
- Alignment algorithms and data: Alignment experiments cover only supervised fine-tuning (SFT, using LLM-LAT) and direct preference optimization (DPO, using PKU-SafeRLHF) (Section 4.2).
- Evaluation sample sizes and repetitions: Extraction uses 100 training samples and 50 validation samples (Table 8); main evaluations are based on single runs; multi-random-seed testing is only performed for HarmBench ASR with 4 seeds (Table 4, Appendix C); BeaverTails independence testing uses 50 samples (Appendix B).
- Unreported information: The paper does not report statistics on agreement between the automatic evaluation model Llama-Guard-3-8B and human annotations.
Summarize the main content of the paper
SafeEvo identifies weak safety circuits in base models and their evolutionary dynamics; the resulting SCA algorithm achieves a balance among safety alignment, capability preservation, and low over-refusal.
- Paper positioning: The paper proposes SafeEvo, an analytical framework that parses the internal safety mechanisms and cross-stage evolution of large language models from a computational circuit perspective, and accordingly designs SCA, a safety alignment method that fine-tunes refusal circuits in a targeted manner.
- Problem to solve: Traditional safety alignment imposes constraints mostly on surface behavioral patterns, lacking understanding of internal mechanisms; meanwhile, full-parameter fine-tuning easily causes an alignment tax that harms general capabilities and over-refusal, while previous interpretability research has not explored safety mechanisms in pretrained base models and their evolution.
- Core mechanism of the method: Extract sparse gated MLP refusal circuits from base models via differentiable masks and dual-branch optimization; use Jaccard similarity to track circuit drift during alignment; in SCA, strictly constrain LoRA parameter updates to the extracted pretrained refusal circuits.
- Key experimental results:
- Weak refusal circuits already exist in pretrained base models, achieving a 100.00% refusal rate on 50 BeaverTails queries (Table 1), while ablating these circuits raises HarmBench ASR from 32.70%–48.43% to 88.05%–91.19% (Table 9).
- Refusal circuits are non-unique within a model and undergo structural drift during alignment; overlap between independently extracted circuits at the same checkpoint is only 0.26, and overlap between consecutive checkpoints drops to 0.78 (Figure 4).
- Under DPO alignment, SCA reduces Llama-3-8B's ASR on HarmBench from 16.98% with full parameters to 0.63%, with GSM8K accuracy at 48.98% (full parameters: 49.51%) and XSTest over-refusal rate at 3.2% (Table 2).
- In multi-seed tests, SCA reduces HarmBench ASR on the three models by 14.80, 8.49, and 7.23 percentage points, respectively, compared to the random update baseline with the same sparsity; bootstrap 95% confidence intervals all exclude zero (Table 4).
- Authors' conclusions and implications: The authors believe safety alignment works by reshaping underlying refusal circuits; circuit drift caused by unconstrained updates and interference with general parameters are potential sources of the alignment tax; constraining updates to pretrained refusal circuits can improve safety while preserving general capabilities and maintaining low over-refusal.
Related papers
Show 3 more papers
- On Evaluating the Durability of Safeguards for Open-Weight LLMsAnalysis / interpretabilityICLR 2025