SafeSteer: Localized On-Policy Distillation for Efficient Safety Alignment
Abstract
Aligning Large Language Models (LLMs) with human values often degrades their general capabilities, termed the alignment tax. Existing methods mitigate this by balancing dual objectives, which heavily rely on massive general-purpose data or auxiliary reward models.
In this paper, we argue that, because safety features are inherently sparse within the output distribution, alignment requires localized modifications rather than global trade-offs. To this end, we propose SafeSteer, which performs on-policy distillation confined to safety tokens. First, we construct a safety teacher via activation steering. Based on this teacher, we develop a safety token selection algorithm. Consequently, SafeSteer restricts the reverse KL penalty to these tokens during training to preserve general capabilities.
Experimental results across diverse models show that our SafeSteer achieves a superior trade-off between safety and general capability compared with existing methods, attaining strong safety performance on seven safety benchmarks with only minimal degradation on five general capability benchmarks. Notably, SafeSteer requires only 100 harmful samples without using any general-purpose data, less than 1% of what previous baselines used, considerably reducing alignment cost. More details are on our project page at https://anjingkun.github.io/SafeSteer/.
1 Introduction
Large language models (LLMs) are now widely deployed in conversational and agentic settings 20; 38, but they remain prone to producing harmful content such as biased remarks, criminal advice, and other unsafe outputs (24; 29). Aligning LLM behavior with human values (27) is therefore essential. However, mainstream safety alignment methods often degrade the models’ general capabilities, a phenomenon known as the alignment tax (13).
Existing safety alignment methods often frame the problem as dual-objective optimization, forcing a trade-off between safety and general capabilities (8). Prior works have explored strategies such as mixing massive amounts of general-purpose data into the training set (39; 45), orthogonally projecting safety gradients into the null space of general capability representations (26), or training auxiliary reward models (8; 14). However, since safety features are inherently sparse within an LLM’s output distribution, alignment demands not global trade-offs but rather localized modifications. This entails adjusting safety features while mitigating forgetting.
On-policy distillation (OPD) (11; 1) mitigates global distribution shifts by training on self-sampled data via reverse-KL minimization. However, to provide supervisory signals, standard LLM OPD typically necessitates an external, stronger teacher model 22. Therefore, recent studies 41; 32 further construct a self-teacher through expert demonstrations, but these approaches heavily rely on the model’s in-context learning capabilities. Inspired by prior research (2), we construct a safety teacher via activation steering. Specifically, we extract a refusal direction and inject it into the model’s residual stream activation at inference. This yields a steered teacher that provides stable safety signals, without the need for external stronger models or prompt engineering.
Even with an effective teacher, standard OPD still applies a penalty to the entire vocabulary, which inevitably affects general capability tokens. Crucially, safety tokens are highly sparse in the output distribution and largely disjoint from those required for general tasks; a global penalty therefore damages general capabilities. To achieve a truly sparse update, we mine safety tokens by contrasting the output distributions of the safety teacher and the base model. Specifically, rather than selecting tokens with the highest logit difference, we introduce a voting-based aggregation algorithm utilizing contrastive log probabilities to identify a safety token subset most sensitive to the refusal direction.
Based on these designs, we propose SafeSteer, a lightweight safety alignment framework that updates only the sparse safety subset of the output distribution. It requires merely 100 harmful samples during OPD training, introducing no external general-purpose data, no auxiliary reward model, and no orthogonal projection. Figure 1 shows the performance of SafeSteer compared to other baselines. Figure 2 illustrates the entire pipeline. Our contributions are as follows:
- •
We propose SafeSteer, a lightweight safety alignment framework. It couples an activation steering-based safety teacher with safety token selection to perform on-policy distillation, greatly reducing the alignment tax.
- •
Experimental results across four models show that SafeSteer significantly outperforms existing methods across seven safety benchmarks, with minimal performance degradation on five general capability benchmarks.
- •
SafeSteer requires only 100 harmful data samples for training, less than 1% of the data volume demanded by previous baselines, which drastically reduces the alignment cost and makes it practical for rapid deployment.
2 Related work
2.1 Safety Alignment Training
A fundamental challenge in safety alignment is mitigating the trade-off between safety and general capabilities (13). SFT-based methods (29; 8) typically suffer from severe capability degradation. As a remedy, preference-based methods like BFPO (39) highly depend on mixing large amounts of general-purpose data to prevent catastrophic forgetting. Alternatively, constrained optimization approaches, such as SafeRLHF (8), MoCAN (14), and NSPO (26), maximize the expected reward subject to safety or general capability constraints. However, these methods introduce significant costs, requiring either auxiliary reward models or carefully curated general-purpose data to maintain performance.
2.2 On-Policy Distillation
OPD has become a popular approach for LLM training (37; 9; 33; 17), because it achieves higher training efficiency than outcome-based reward methods (e.g., GRPO) via token-level rewards (22), mitigates forgetting by training on on-policy rollouts (1), and avoids mode-covering behavior by minimizing reverse KL (11). Recent works (41; 32) use additional expert demonstrations to allow students to act as teachers, but this approach heavily relies on the model’s in-context learning capabilities.
2.3 Representation Engineering
Many studies (44; 4; 15; 40) have shown that representations contain rich information, enabling us to steer the model’s behavior via activation. As demonstrated by previous research (2), the model’s refusal behavior can be mediated by a single vector. Furthermore, prior works (4; 43; 19) reveal that safety neurons are very sparse in LLMs. By rerouting representations responsible for harmful outputs, Circuit Breaker (45; 23) trains models to resist various jailbreak attacks (46; 31). However, these methods still require a large amount of general-purpose data.
3 Method
As Figure 2 illustrates, we propose SafeSteer, a lightweight safety alignment framework. It leverages activation steering to construct a safety teacher and restricts the distillation penalty to safety tokens. Through SafeSteer, we can update sparse safety features while preserving general capabilities.
| Safety (ASR % ) | General Capability () | |||||||||||||
| Harmful | Red Team | STEM | IF | Math | Code | |||||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg | MMLU | AlpacaEval | GSM8K | MATH | HumanEval | Avg |
| Qwen3-4B-Instruct | 0.30 | 1.71 | 5.00 | 2.00 | 6.82 | 0.97 | 3.28 | 2.87 | 70.61 | 96.02 | 73.08 | 26.60 | 92.07 | 71.68 |
| DPO-Mix | 0.19 | 1.00 | 0.00 | 0.00 | 9.09 | 0.41 | 1.20 | 1.70 | 70.61 | 68.76 | 75.89 | 29.40 | 90.85 | 67.10 |
| MoCAN | 0.00 | 0.10 | 0.00 | 0.00 | 6.82 | 0.00 | 0.96 | 1.13 | 62.98 | 95.14 | 72.18 | 26.20 | 90.24 | 69.35 |
| W-DOOR | 0.19 | 1.10 | 1.00 | 0.00 | 14.55 | 0.41 | 2.20 | 2.78 | 65.26 | 90.99 | 42.29 | 14.00 | 27.44 | 48.00 |
| BFPO | 0.00 | 0.20 | 0.00 | 0.00 | 6.59 | 0.05 | 1.12 | 1.14 | 70.60 | 95.28 | 73.31 | 28.00 | 90.24 | 71.49 |
| NSPO | 0.00 | 0.30 | 0.00 | 0.00 | 6.82 | 0.05 | 1.08 | 1.18 | 70.65 | 95.78 | 73.24 | 26.60 | 90.85 | 71.42 |
| SafeSteer (ours) | 0.00 | 0.07 | 0.00 | 0.00 | 5.91 | 0.00 | 0.40 | 0.91 | 70.67 | 94.78 | 73.47 | 27.20 | 90.85 | 71.39 |
| Qwen2.5-7B-Instruct | 0.30 | 1.80 | 5.00 | 1.00 | 19.32 | 0.97 | 3.76 | 4.59 | 71.70 | 95.96 | 70.35 | 24.80 | 81.70 | 68.90 |
| DPO-Mix | 0.58 | 3.91 | 13.50 | 4.00 | 32.73 | 1.53 | 5.96 | 8.89 | 71.61 | 59.13 | 77.10 | 25.60 | 73.78 | 61.44 |
| MoCAN | 0.00 | 1.24 | 3.50 | 2.00 | 23.18 | 0.87 | 3.68 | 4.92 | 70.18 | 94.16 | 68.91 | 24.20 | 84.76 | 68.44 |
| W-DOOR | 1.35 | 2.38 | 14.50 | 3.00 | 31.70 | 1.68 | 7.88 | 8.93 | 68.00 | 84.76 | 63.84 | 27.60 | 26.83 | 54.21 |
| BFPO | 0.00 | 0.80 | 4.50 | 1.00 | 16.36 | 0.36 | 3.20 | 3.75 | 71.86 | 94.91 | 71.49 | 25.60 | 83.54 | 69.48 |
| NSPO | 0.19 | 1.51 | 5.00 | 2.00 | 19.55 | 1.33 | 3.16 | 4.68 | 71.76 | 95.28 | 70.51 | 23.80 | 82.93 | 68.86 |
| SafeSteer (ours) | 0.19 | 0.20 | 0.50 | 1.00 | 7.27 | 0.05 | 2.00 | 1.48 | 71.63 | 93.98 | 72.71 | 25.20 | 82.32 | 69.17 |
3.1 Preliminary: Activation-Steered Safety Teacher Model
Building upon the base model , we construct the safety teacher model through activation steering. Specifically, following the previous study (2), we extract a refusal direction by comparing the model’s hidden representations when run on harmful and harmless instructions and determine an injection layer . Let indicate the original input residual stream entering the -th transformer block of . We register a forward pre-hook at this layer to replace with:
| (1) |
The modified representation is then fed into the subsequent layers. By continuously injecting this refusal direction at all token positions throughout the sequence, the resulting model is capable of providing highly stable refusal signals, consistently rejecting both harmful and harmless prompts. Further analysis is provided in Appendix D.
3.2 Task Overview
We initialize a student model and a safety teacher model from a base model with vocabulary . SafeSteer consists of two main stages:
- 1.
Before training, we roll out on harmless instructions , sampled from Alpaca (34). By contrasting the output distributions of and , we extract a sparse subset of safety tokens .
- 2.
During alignment, generates trajectories on harmful instructions , sampled from PKU-SafeRLHF (8). Then is optimized by restricting the reverse KL penalty to the safety token subset .
3.3 Safety Token Selection
Contrastive Log Probability
Given a prompt , we first use the safety teacher model to sample refusal trajectories, denoted as . The response length of each trajectory is constrained to . Compared to the rollouts of the base model on harmless instructions, the use of rollouts produces refusal trajectories, yielding a set of safety tokens with higher purity.
Subsequently, for the -th trajectory, we concatenate it with the input and feed it into both and for a forward pass. This yields the conditional probability distributions at each valid step , represented as and . For each token , we define its contrastive log probability at step of the -th trajectory as:
| (2) |
A larger positive value of signifies that the token is more strongly induced by the refusal direction along this trajectory.
Voting Aggregation
For each prompt , trajectory index , and valid step , we select the top- tokens with the largest values to form a candidate set, denoted as . Subsequently, we use an indicator function to aggregate the overall votes:
| (3) |
where is the valid sequence length of the -th trajectory for prompt before emitting an EOT token. The final safety token subset is defined as the top- tokens with the highest votes across the entire vocabulary :
| (4) |
This discretized voting mechanism, combined with multiple rollouts, effectively prevents extreme values from dominating the overall ranking.
| Safety (ASR % ) | General Capability () | |||||||||||||
| Harmful | Red Team | STEM | IF | Math | Code | |||||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg | MMLU | AlpacaEval | GSM8K | MATH | HumanEval | Avg |
| Llama-3.2-3B-Instruct | 0.19 | 3.85 | 4.00 | 0.00 | 19.55 | 1.33 | 7.92 | 5.26 | 62.19 | 92.80 | 72.78 | 37.60 | 53.67 | 63.61 |
| DPO-Mix | 0.19 | 3.35 | 1.50 | 0.00 | 18.41 | 1.28 | 6.20 | 4.42 | 62.02 | 79.75 | 74.68 | 37.40 | 54.27 | 61.62 |
| MoCAN | 0.19 | 1.04 | 1.50 | 0.00 | 13.41 | 0.71 | 2.32 | 2.74 | 59.76 | 87.44 | 54.06 | 33.40 | 54.27 | 57.79 |
| W-DOOR | 0.19 | 3.31 | 1.00 | 0.00 | 14.77 | 0.46 | 4.80 | 3.50 | 55.83 | 79.32 | 3.56 | 0.40 | 31.10 | 34.04 |
| BFPO | 0.19 | 3.65 | 4.00 | 0.00 | 20.23 | 1.12 | 8.20 | 5.34 | 62.18 | 90.99 | 72.33 | 37.40 | 52.44 | 63.07 |
| NSPO | 0.19 | 3.81 | 4.00 | 0.00 | 20.23 | 1.28 | 7.96 | 5.35 | 62.18 | 91.49 | 71.95 | 38.00 | 52.44 | 63.21 |
| SafeSteer (ours) | 0.19 | 2.24 | 0.50 | 0.00 | 18.86 | 1.28 | 5.36 | 4.06 | 61.64 | 90.80 | 72.02 | 36.80 | 53.04 | 62.86 |
| Llama-3-8B-Instruct | 0.19 | 0.74 | 2.50 | 1.00 | 17.27 | 0.51 | 4.04 | 3.75 | 64.72 | 96.15 | 66.34 | 30.00 | 60.98 | 63.64 |
| DPO-Mix | 5.77 | 5.12 | 24.50 | 13.00 | 44.55 | 4.90 | 12.48 | 15.76 | 64.40 | 79.25 | 73.16 | 28.80 | 60.37 | 61.20 |
| MoCAN | 0.00 | 0.60 | 4.50 | 0.00 | 17.05 | 0.51 | 2.84 | 3.64 | 63.66 | 94.35 | 71.11 | 26.20 | 57.93 | 62.65 |
| W-DOOR | 0.19 | 0.80 | 1.00 | 1.00 | 19.09 | 0.61 | 3.00 | 3.67 | 59.81 | 84.16 | 1.44 | 13.20 | 30.49 | 37.82 |
| BFPO | 0.00 | 0.33 | 1.50 | 0.00 | 12.50 | 0.36 | 2.72 | 2.49 | 64.66 | 95.90 | 63.76 | 29.80 | 60.98 | 63.02 |
| NSPO | 0.00 | 0.74 | 2.50 | 1.00 | 17.50 | 0.51 | 4.00 | 3.75 | 64.58 | 95.84 | 64.82 | 30.40 | 59.76 | 63.08 |
| SafeSteer (ours) | 0.00 | 0.74 | 1.50 | 1.00 | 17.09 | 0.51 | 3.96 | 3.54 | 64.63 | 95.27 | 65.04 | 30.00 | 60.98 | 63.18 |
3.4 Safe-Token-Based Reverse KL Divergence
Reverse KL Divergence
Reverse KL divergence exhibits a mode-seeking property, making it more suitable for driving the model to converge toward a single, explicit refusal mode. Given a prompt , student model first samples complete response trajectories . To simplify notation, we define the short-hand conditional probabilities for token at time step as and . In standard OPD, the student model is updated by minimizing the reverse KL divergence over the vocabulary :
| (5) |
However, the standard reverse KL divergence still penalizes the entire vocabulary . It inevitably affects the tokens responsible for general capabilities, leading to performance degradation.
Token-Level Localized KL
To eliminate the negative impact brought by the global KL penalty, after extracting the safety token subset , we restrict the calculation of the reverse KL loss to this sparse subset. Consequently, the reverse KL loss restricted to the safety tokens is modified as:
| (6) |
The final training loss is computed by averaging the localized penalty over all valid time steps across the rollouts for each sample in the batch:
| (7) |
where the expectation is taken over the batch of size and rollouts, and denotes the valid generated length of the -th trajectory for the -th sample in the batch. Through this design, the alignment updates are strictly localized to the safety token subset . This fundamentally eliminates the alignment tax while maintaining stable gradients via multiple rollouts.
4 Experiment
4.1 Experiment Setup
Models.
Baselines.
We compare our SafeSteer against several baseline approaches: MoCAN (14), W-DOOR (42), BFPO (39), NSPO (26), and DPO-Mix. Following prior work (26), the DPO-Mix variant is configured with a 50/50 mixing ratio of helpfulness and safety preferences. For training data, our method uses only 100 instructions randomly sampled from the unsafe subset of PKU-SafeRLHF(8), whereas NSPO samples 40% of the entire dataset and the remaining baselines are trained on the full dataset.
Benchmarks.
We comprehensively evaluate our SafeSteer across both safety and general capabilities. For safety benchmarks, we report the Attack Success Rate (ASR) on two categories: (i) Harmful queries, using AdvBench (46), PKU-SafeRLHF (8), HarmBench (24), JailbreakBench (5), and SORRY-Bench (36); and (ii) Red-team queries, utilizing HarmfulQA (3) and ALERT (35). To validate that SafeSteer can preserve the model’s general capabilities, we evaluate its performance across four dimensions: (i) General Knowledge on MMLU (12); (ii) Instruction Following on AlpacaEval (16); (iii) Mathematical Reasoning on GSM8K (7) and MATH500 (18); and (iv) Coding on HumanEval (6).
Implementation Details.
To extract the refusal direction, we utilize 160 harmful and 160 harmless instructions provided by previous work (2). During safety token selection, we use the same 160 harmless samples. Additionally, we set the safety token subset size to . In the SafeSteer training stage, we apply a learning rate of 1e-6 to Llama models and 1e-5 to Qwen models, with rollouts. For safety evaluation, we employ Llama-Guard-4-12B as the default judge across all benchmarks, except SORRY-Bench (36), which relies on its natively fine-tuned scoring model. To measure general capabilities, we use DeepSeek-V4-Flash (9) to report the Win Rate compared to Alpaca-7B on AlpacaEval, while using lm-eval (10) for the remaining benchmarks. During model inference, we set do_sample=False at temperature 0. When temperature is 1.0, we run the evaluation three times and report the average. More details on training and evaluation are in Appendix A.
4.2 Experiment Results
Tables 1 and 2 report the evaluation results of our SafeSteer at temperature 0, and results for temperature 1.0 are shown in Appendix B. Overall, SafeSteer substantially improves safety with only a marginal impact on general capabilities.
Safety.
Under both temperature settings of 0 and 1.0, SafeSteer attains the lowest ASR among all methods on the Qwen family, by a clear margin over the strongest baselines. At temperature 0, SafeSteer pushes the average ASR down to 0.91% on Qwen3-4B-Instruct, compared to 1.13% for the next-best MoCAN and 2.87% for the base model. Likewise, it lowers the ASR to 1.48% on Qwen2.5-7B-Instruct, which represents a 2.5 reduction against 3.75% for the strongest baseline BFPO. Similarly, for the Llama family, SafeSteer remains highly competitive: it not only reduces the ASR on Llama-3.2-3B-Instruct from 5.26% to 4.06%, but also achieves the second-lowest ASR on Llama-3-8B-Instruct. Notably, while some baselines slightly surpass SafeSteer in safety, most exhibit a significant degradation in general capabilities. For example, W-DOOR collapses both Llama models to near half of their base capability, dropping the average score from 63.61 to 34.04 on Llama-3.2-3B-Instruct and from 63.64 to 37.82 on Llama-3-8B-Instruct. Consistent with the observation in NSPO (26), we find that DPO-Mix can even increase ASR on both Llama-3-8B-Instruct and Qwen2.5-7B-Instruct, indicating that the alignment tax cannot be solved by naive data mixing.
General Capability.
Without relying on any general-purpose data necessitated by other methods, SafeSteer can still maintain the model’s general capabilities. For the Qwen family, at both temperatures 0 and 1.0, SafeSteer preserves general capabilities with negligible loss: at temperature 0, the average score shifts slightly from 71.68 to 71.39 on Qwen3-4B-Instruct and from 68.90 to 69.17 on Qwen2.5-7B-Instruct, effectively retaining both models’ original ability. For the Llama family at temperature 0, SafeSteer limits the performance degradation to 0.75 points on Llama-3.2-3B-Instruct and outperforms all baselines on Llama-3-8B-Instruct. SafeSteer also ranks second among all methods on Llama-3-8B-Instruct at temperature 1.0. This demonstrates that our SafeSteer successfully decouples the safety feature from the general capability space.
4.3 Ablation Experiments
We conduct ablation studies to validate the core designs of SafeSteer from both safety and general capability perspectives.
Effectiveness of the Activation-Steered Teacher.
| Temp 0 | Temp 1.0 | |||
| Model | Sys. Prompt | Steer | Sys. Prompt | Steer |
| Qwen3-4B | 0.74 | 0.07 | 0.68 | 0.04 |
| Qwen2.5-7B | 4.46 | 0.00 | 4.14 | 0.01 |
| Llama-3.2-3B | 2.44 | 0.00 | 3.54 | 0.00 |
| Llama-3-8B | 0.69 | 0.00 | 0.65 | 0.00 |
Self-distillation (41) often relies on system prompts to construct a safety teacher. However, such prompt-driven approaches often struggle to maintain stable refusal behaviors, failing to provide consistent supervisory signals during distillation. As shown in Table 3, replacing our activation-steered teacher with a prompt-based version (see Appendix C) results in a higher ASR. In contrast, by inducing refusal behaviors directly within the model’s representation space, our steered teacher can provide robust refusal signals, consistently reducing the ASR to near 0.00%.
Safe-Token-Restricted Reverse KL.
We compare SafeSteer against two variants to verify our localized penalty design:
- 1.
w/ forward KL, which uses forward KL instead of reverse KL to compute the loss.
- 2.
w/o safety token, which penalizes the entire vocabulary .
| Method | Q3-4B | Q2.5-7B | L3.2-3B | L3-8B |
| Temperature 0 | ||||
| SafeSteer (full) | 59.03 | 53.76 | 44.92 | 45.49 |
| w/ forward KL | 58.22 | 49.45 | 41.25 | 43.59 |
| w/o safety token | 58.63 | 52.86 | 41.05 | 43.18 |
| Temperature 1 | ||||
| SafeSteer (full) | 58.72 | 51.12 | 32.02 | 38.33 |
| w/ forward KL | 57.22 | 46.60 | 29.22 | 35.60 |
| w/o safety token | 58.22 | 48.61 | 26.70 | 33.99 |
As shown in Table 4, the w/o safety token variant noticeably degrades models’ performance on MATH and HumanEval. It proves that applying the penalty across the entire vocabulary negatively impacts general capabilities. Additionally, w/ forward KL underperforms reverse KL, confirming that the mode-seeking property of reverse KL better suits learning explicit refusal behaviors.
5 Analysis
5.1 Representation Shift Analysis
To further verify whether our SafeSteer successfully preserves general capabilities during safety alignment, we examine the representation space of the base model , the student model , and the safety teacher model using 300 general-purpose prompts sampled from AlpacaEval. The last-layer hidden state at the final token of each prompt is then extracted and projected into a 2D space via Principal Component Analysis (PCA).
Figure 3 visualizes the representation shifts on the Llama models. Although the refusal direction introduces a severe representation shift in , trained through SafeSteer exhibits no such shift on general capabilities. The representations of overlap almost entirely with those of . The marginal density plots along both axes confirm that their representations remain virtually identical. This visualization shows that despite learning safety behaviors from , our SafeSteer effectively segregates these safety adaptations from the general capability space, thereby achieving safety alignment without incurring the alignment tax.
5.2 Design Choices in Safety Token Selection
The safety token selection in Section 3.3 relies on two key design choices: the rollout model and the response length. We empirically analyze both.
Rollout model is necessary.
Using the base model to generate rollout trajectories for safety token selection causes a catastrophic degradation in safety capabilities. Specifically, training a Llama-3-8B-Instruct variant under this setting increases its JailbreakBench ASR from 1.0% to 75.0%. We observe that the resulting safety token subset is dominated by formatting tokens (e.g., “\n\n” and “\r\n\r\n”) rather than genuine safety tokens. Consequently, the model merely learns to insert meaningless paragraph breaks instead of refusing. This failure stems from the shallow safety alignment of Llama-3-8B-Instruct. Because its safety guardrails are concentrated on the very first few output tokens, the unsteered lacks the capability to maintain refusal behaviors at deeper positions, causing the contrastive log probability computed along this trajectory to fail in capturing safety tokens. Conversely, using for rollouts avoids this vulnerability: the steered trajectory forces the model to maintain a coherent refusal signal throughout the sequence, ensuring that the contrastive log probability correctly localizes genuine safety tokens. While this complete collapse was most pronounced on Llama-3-8B-Instruct, it highlights the necessity of using to guarantee stable token extraction across different base models.
Response length transforms superficial alignment into semantic safety.
The response length controls the scope of the safety token selection (see Section 3.3). Figure 4 compares the top-voted tokens in at with those at . When the response length is constrained to , the safety token selection method only captures initial refusal words (e.g., “I”, “Sorry”, “Unfortunately”). This essentially encodes how to begin refusing at a superficial level. As grows, the response extends into the model’s explanation for refusing. Consequently, the top-voted tokens in shift dramatically toward core semantic safety concepts (e.g., “illegal”, “unethical”, “harmful”) that encode why to refuse. This dynamic transition demonstrates that an appropriate is essential for “deep safety alignment” (28), enabling the model to grasp safety at a semantic level rather than relying on superficial initial tokens.
Unnormalized Probability Slices Balance Safety and Capability.
| Method | Qwen3-4B | Qwen2.5-7B | L3.2-3B | L3-8B |
| Safety (ASR% ) | ||||
| SafeSteer | 0.91 | 1.48 | 4.06 | 3.54 |
| w/ renorm | 0.72 | 0.21 | 4.23 | 3.25 |
| Capability () | ||||
| SafeSteer | 71.39 | 69.17 | 62.86 | 63.18 |
| w/ renorm | 70.79 | 66.13 | 58.10 | 62.86 |
When calculating the token-level localized KL divergence, we use the raw probability slices and for without re-normalizing them into a proper distribution via softmax (see Section 3.4). Empirically, we find this design to be critical. As shown in Table 5, forcing re-normalization strictly over causes drastic degradation in general capabilities, by up to 4.76 points on Llama-3.2-3B-Instruct and 3.04 on Qwen2.5-7B-Instruct. This collapse is fundamentally driven by the loss of the absolute magnitude anchor. Without re-normalization, the standard Reverse KL naturally constrains the absolute probability mass of the student . After re-normalization, the optimizer aggressively inflates the logits of tokens in , crowding out probability mass from the remaining tokens and distorting the student model’s general-capability distribution.
6 Conclusion
In this paper, we challenge the conventional dual-objective trade-off in safety alignment, arguing that safety features are inherently sparse and only require localized modification. We introduce SafeSteer, an efficient on-policy distillation framework that mitigates the alignment tax. By combining an activation-steered safety teacher with automatically mined safety-critical tokens, SafeSteer restricts the OPD penalty precisely to safety features. Extensive experiments demonstrate that SafeSteer achieves state-of-the-art safety performance with little degradation in general capabilities across multiple LLMs. Remarkably, SafeSteer requires only 100 training samples without any auxiliary models or massive general-purpose data, reducing the alignment cost.
7 Limitations
While SafeSteer is an effective and lightweight method for safety alignment, our study has the following limitations.
Reliance on the base model’s refusal capability.
SafeSteer constructs the safety teacher by activation-steering the base model and mines safety tokens from the resulting rollouts. This pipeline therefore presumes that the base model already possesses a refusal capability, which is the case for modern instruction-tuned models but not for purely pretrained checkpoints.
Model scale.
Due to computational constraints, all of our experiments are conducted on models with no more than 10B parameters (Llama-3-8B-Instruct, Llama-3.2-3B-Instruct, Qwen2.5-7B-Instruct, and Qwen3-4B-Instruct). Although the localized distillation objective is agnostic to model size in principle, the effectiveness of SafeSteer on larger models has not been verified, and the optimal choice of hyperparameters may shift at that scale.
Modality and architecture coverage.
The current evaluation is restricted to text-only autoregressive LLMs. We have not investigated how SafeSteer transfers to vision-language models (VLMs) or diffusion-based language models (DLLMs) (25). Extending SafeSteer to these settings is a natural direction for future work.
References
- On-policy distillation of language models: learning from self-generated mistakes. In International Conference on Learning Representations, Vol. 2024, pp. 21246–21263. Cited by: §1, §2.2.
- Refusal in language models is mediated by a single direction. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, External Links: Link Cited by: §1, §2.3, §3.1, §4.1.
- Red-teaming large language models using chain of utterances for safety-alignment. arXiv preprint arXiv:2308.09662. Cited by: §4.1.
- Towards monosemanticity: decomposing language models with dictionary learning. Transformer Circuits Thread. Note: https://transformer-circuits.pub/2023/monosemantic-features/index.html Cited by: §2.3.
- Jailbreakbench: an open robustness benchmark for jailbreaking large language models. Advances in Neural Information Processing Systems 37, pp. 55005–55029. Cited by: §4.1.
- Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. Cited by: 5th item, §4.1.
- Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168. Cited by: 3rd item, §4.1.
- Safe rlhf: safe reinforcement learning from human feedback. In International Conference on Learning Representations, Vol. 2024, pp. 50750–50777. Cited by: §1, §2.1, item 2, §4.1, §4.1.
- DeepSeek-v4: towards highly efficient million-token context intelligence. Cited by: 2nd item, §2.2, §4.1.
- The language model evaluation harness. Zenodo. External Links: Document, Link Cited by: 1st item, §4.1.
- Minillm: knowledge distillation of large language models. In International Conference on Learning Representations, Vol. 2024, pp. 32694–32717. Cited by: §1, §2.2.
- Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300. Cited by: 1st item, §4.1.
- Safety tax: safety alignment makes your large reasoning models less reasonable. arXiv preprint arXiv:2503.00555. Cited by: §1, §2.1.
- One-shot safety alignment for large language models via optimal dualization. Advances in Neural Information Processing Systems 37, pp. 84350–84383. Cited by: §1, §2.1, §4.1.
- Layer-aware representation filtering: purifying finetuning data to preserve llm safety alignment. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 8041–8061. Cited by: §2.3.
- AlpacaEval: an automatic evaluator of instruction-following models. GitHub. Note: https://github.com/tatsu-lab/alpaca_eval Cited by: 2nd item, §4.1.
- Rethinking on-policy distillation of large language models: phenomenology, mechanism, and recipe. arXiv preprint arXiv:2604.13016. Cited by: §2.2.
- Let’s verify step by step. arXiv preprint arXiv:2305.20050. Cited by: 4th item, §4.1.
- On the biology of a large language model. Transformer Circuits Thread. External Links: Link Cited by: §2.3.
- Deepseek-v3. 2: pushing the frontier of open large language models. arXiv preprint arXiv:2512.02556. Cited by: §1.
- The llama 3 herd of models. External Links: 2407.21783, Link Cited by: §A.2, §4.1.
- On-policy distillation. Thinking Machines Lab: Connectionism. Note: https://thinkingmachines.ai/blog/on-policy-distillation External Links: Document Cited by: §1, §2.2.
- X-boundary: establishing exact safety boundary to shield llms from multi-turn jailbreaks without compromising usability. arXiv preprint arXiv:2502.09990. Cited by: §2.3.
- HarmBench: a standardized evaluation framework for automated red teaming and robust refusal. External Links: 2402.04249, Link Cited by: §1, §4.1.
- Large language diffusion models. Advances in Neural Information Processing Systems 38, pp. 50608–50646. Cited by: §7.
- Mitigating the safety alignment tax with null-space constrained policy optimization. arXiv preprint arXiv:2512.11391. Cited by: §1, §2.1, §4.1, §4.2.
- Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems, A. H. Oh, A. Agarwal, D. Belgrave, and K. Cho (Eds.), External Links: Link Cited by: §1.
- Safety alignment should be made more than just a few tokens deep. In The Thirteenth International Conference on Learning Representations, External Links: Link Cited by: §5.2.
- Fine-tuning aligned language models compromises safety, even when users do not intend to!. In ICLR, External Links: Link Cited by: §1, §2.1.
- Qwen2.5 technical report. External Links: 2412.15115, Link Cited by: §4.1.
- Derail yourself: multi-turn llm jailbreak attack through self-discovered clues. arXiv preprint arXiv:2410.10700. Cited by: §2.3.
- Self-distillation enables continual learning. arXiv preprint arXiv:2601.19897. Cited by: §1, §2.2.
- A survey of on-policy distillation for large language models. arXiv preprint arXiv:2604.00626. Cited by: §2.2.
- Alpaca: a strong, replicable instruction-following model. Stanford Center for Research on Foundation Models. https://crfm. stanford. edu/2023/03/13/alpaca. html 3 (6), pp. 7. Cited by: item 1.
- ALERT: a comprehensive benchmark for assessing large language models’ safety through red teaming. arXiv preprint arXiv:2404.08676. Cited by: §4.1.
- SORRY-bench: systematically evaluating large language model safety refusal behaviors. External Links: 2406.14598 Cited by: §A.2, §4.1, §4.1.
- Qwen3 technical report. arXiv preprint arXiv:2505.09388. Cited by: §2.2, §4.1.
- Glm-5: from vibe coding to agentic engineering. arXiv preprint arXiv:2602.15763. Cited by: §1.
- Bi-factorial preference optimization: balancing safety-helpfulness in language models. In International Conference on Learning Representations, Vol. 2025, pp. 69465–69490. Cited by: §1, §2.1, §4.1.
- Llms encode harmfulness and refusal separately. Advances in Neural Information Processing Systems 38, pp. 140283–140318. Cited by: §2.3.
- Self-distilled reasoner: on-policy self-distillation for large language models. arXiv preprint arXiv:2601.18734. Cited by: §1, §2.2, §4.3.
- Improving llm safety alignment with dual-objective optimization. arXiv preprint arXiv:2503.03710. Cited by: §4.1.
- On the role of attention heads in large language model safety. In International Conference on Learning Representations, Vol. 2025, pp. 84042–84071. Cited by: §2.3.
- Representation engineering: a top-down approach to ai transparency. arXiv preprint arXiv:2310.01405. Cited by: §2.3.
- Improving alignment and robustness with circuit breakers. External Links: 2406.04313 Cited by: §1, §2.3.
- Universal and transferable adversarial attacks on aligned language models. arXiv preprint arXiv:2307.15043. Cited by: §2.3, §4.1.
Appendix A Experimental Setup
A.1 Training details
Safety token selection.
For all four models, we set the rollout size to at temperature 1.0, the number of safety tokens to , and the voting size to . The response length used for safety token selection is set to for the Qwen family and for the Llama family.
SafeSteer training.
Within the SafeSteer framework, we optimize the student models using a learning rate of 1e-5 for the Qwen family and 1e-6 for the Llama family. For the on-policy generation, we set the rollout size to at temperature . All models are trained for a single epoch on NVIDIA H100 GPUs. Each batch consists of prompts. Our pipeline is implemented based on the open-source Self-Distillation codebase.
A.2 Implementation of Benchmarks
Safety benchmarks.
General-capability benchmarks.
To assess the models’ general capabilities, we utilize five benchmarks. Unless stated otherwise, generations follow the official chat template of each base model.
- •
- •
- •
GSM8K (7): we leverage the LM Evaluation Harness pipeline and report strict-match Accuracy. For Qwen2.5-7B-Instruct, strict-match yields anomalously low scores due to formatting differences; thus, we instead report flexible-match Accuracy.
- •
MATH (18): we evaluate on the MATH500 subset following the LM Evaluation Harness setup, and report Accuracy using the math_verify grader.
- •
HumanEval (6): we utilize the humaneval_instruct implementation from the LM Evaluation Harness and report Pass@1.
Appendix B Additional Experiment Results
Table 6 and Table 7 report the per-benchmark safety and general capability results at temperature 1.0, mirroring the evaluation at temperature 0 presented in the main paper. The relative performance rankings across all evaluated methods remain largely consistent with the temperature 0 setting. SafeSteer still achieves the lowest ASR on the Qwen family and exhibits highly competitive safety performance on the Llama family, all while incurring negligible degradation in general capabilities across the four base models.
| Safety (ASR % ) | General Capability () | |||||||||||||
| Harmful | Red Team | STEM | IF | Math | Code | |||||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg | MMLU | AlpacaEval | GSM8K | MATH | HumanEval | Avg |
| Qwen3-4B-Instruct | 0.00 | 1.41 | 5.50 | 1.00 | 7.05 | 0.82 | 3.32 | 2.73 | 70.61 | 96.02 | 74.07 | 26.20 | 89.63 | 71.31 |
| DPO-Mix | 0.26 | 0.78 | 0.17 | 0.00 | 8.48 | 0.39 | 1.33 | 1.63 | 70.61 | 58.49 | 74.22 | 27.20 | 89.63 | 64.03 |
| MoCAN | 0.00 | 0.17 | 0.00 | 0.00 | 6.59 | 0.05 | 1.04 | 1.12 | 62.98 | 95.14 | 72.63 | 27.20 | 89.02 | 69.39 |
| W-DOOR | 0.38 | 1.47 | 0.00 | 0.00 | 14.32 | 0.10 | 3.36 | 2.80 | 65.26 | 90.99 | 40.18 | 14.20 | 24.39 | 47.00 |
| BFPO | 0.00 | 0.33 | 0.00 | 0.00 | 6.59 | 0.00 | 0.96 | 1.13 | 70.60 | 95.28 | 73.01 | 26.00 | 90.85 | 71.15 |
| NSPO | 0.00 | 0.37 | 0.00 | 0.00 | 6.82 | 0.05 | 1.00 | 1.18 | 70.65 | 95.78 | 73.69 | 26.40 | 87.80 | 70.86 |
| SafeSteer (ours) | 0.19 | 0.03 | 0.00 | 0.00 | 5.90 | 0.00 | 0.68 | 0.97 | 70.67 | 94.78 | 72.78 | 27.80 | 89.63 | 71.13 |
| Qwen2.5-7B-Instruct | 0.19 | 1.54 | 3.50 | 3.00 | 17.95 | 0.77 | 3.88 | 4.40 | 71.70 | 95.96 | 70.12 | 25.60 | 79.26 | 68.53 |
| DPO-Mix | 1.67 | 3.89 | 15.17 | 6.67 | 32.12 | 2.16 | 7.64 | 9.90 | 71.61 | 54.04 | 75.51 | 26.40 | 75.61 | 60.63 |
| MoCAN | 0.00 | 0.97 | 5.00 | 4.00 | 19.55 | 0.92 | 4.44 | 4.98 | 70.18 | 94.16 | 68.68 | 25.40 | 82.92 | 68.27 |
| W-DOOR | 1.35 | 2.38 | 14.50 | 3.00 | 30.68 | 1.68 | 7.88 | 8.78 | 68.00 | 84.76 | 61.71 | 26.20 | 30.49 | 54.23 |
| BFPO | 0.00 | 0.80 | 4.50 | 1.00 | 15.45 | 0.36 | 3.20 | 3.62 | 71.86 | 94.91 | 70.66 | 25.60 | 82.93 | 69.19 |
| NSPO | 0.19 | 1.51 | 5.00 | 2.00 | 20.00 | 1.33 | 3.16 | 4.74 | 71.76 | 95.28 | 69.37 | 26.60 | 79.88 | 68.58 |
| SafeSteer (ours) | 0.19 | 0.97 | 0.50 | 0.00 | 12.27 | 0.66 | 0.12 | 2.10 | 71.63 | 93.98 | 70.58 | 25.40 | 76.83 | 67.68 |
| Safety (ASR % ) | General Capability () | |||||||||||||
| Harmful | Red Team | STEM | IF | Math | Code | |||||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg | MMLU | AlpacaEval | GSM8K | MATH | HumanEval | Avg |
| Llama-3.2-3B-Instruct | 0.38 | 3.51 | 6.50 | 1.00 | 20.91 | 1.58 | 7.64 | 5.93 | 62.19 | 92.80 | 63.08 | 35.40 | 46.95 | 60.08 |
| DPO-Mix | 0.51 | 3.19 | 2.17 | 0.00 | 18.41 | 1.26 | 7.25 | 4.68 | 62.02 | 63.69 | 62.55 | 32.60 | 48.78 | 53.93 |
| MoCAN | 0.19 | 1.17 | 1.00 | 0.00 | 18.86 | 0.66 | 2.52 | 3.49 | 50.92 | 87.44 | 41.69 | 22.20 | 40.85 | 48.62 |
| W-DOOR | 2.99 | 2.94 | 1.50 | 1.00 | 16.36 | 0.51 | 5.88 | 4.45 | 55.83 | 79.32 | 2.43 | 14.00 | 21.34 | 34.58 |
| BFPO | 0.19 | 4.35 | 5.00 | 0.00 | 22.05 | 1.22 | 8.12 | 5.85 | 62.18 | 90.99 | 60.73 | 34.80 | 53.05 | 60.35 |
| NSPO | 0.38 | 3.81 | 3.50 | 1.00 | 20.45 | 1.02 | 8.12 | 5.47 | 62.18 | 91.49 | 63.15 | 32.20 | 49.39 | 59.68 |
| SafeSteer (ours) | 0.32 | 3.04 | 2.50 | 0.67 | 20.45 | 1.17 | 5.99 | 4.88 | 61.16 | 90.80 | 62.16 | 23.80 | 40.24 | 55.63 |
| Llama-3-8B-Instruct | 0.00 | 1.07 | 2.00 | 3.00 | 17.05 | 0.92 | 4.24 | 4.04 | 64.72 | 96.15 | 61.52 | 24.40 | 54.27 | 60.21 |
| DPO-Mix | 8.59 | 6.29 | 26.33 | 17.33 | 43.94 | 6.33 | 14.55 | 17.62 | 64.40 | 76.52 | 71.49 | 24.60 | 59.76 | 59.35 |
| MoCAN | 0.19 | 0.47 | 8.50 | 2.00 | 15.00 | 0.56 | 3.20 | 4.27 | 54.54 | 94.35 | 62.70 | 22.60 | 56.10 | 58.06 |
| W-DOOR | 0.19 | 0.94 | 3.00 | 2.00 | 19.55 | 0.56 | 3.24 | 4.21 | 59.81 | 84.16 | 1.44 | 13.20 | 32.32 | 38.19 |
| BFPO | 0.00 | 0.50 | 2.00 | 2.00 | 13.86 | 0.36 | 2.96 | 3.10 | 64.66 | 95.90 | 60.73 | 27.40 | 56.71 | 61.08 |
| NSPO | 0.77 | 0.77 | 2.00 | 2.00 | 18.18 | 0.46 | 3.96 | 4.02 | 64.58 | 95.84 | 61.94 | 12.80 | 57.93 | 58.62 |
| SafeSteer (ours) | 0.51 | 1.10 | 2.00 | 1.33 | 17.58 | 0.49 | 4.36 | 3.91 | 64.63 | 95.27 | 63.68 | 23.00 | 53.66 | 60.05 |
Appendix C Full Ablation Results
Steered teacher vs. system-prompted teacher.
Table 8 and Table 9 detail the per-benchmark performance of the activation-steered teacher against the system-prompted teacher at temperatures 0 and 1.0 across all safety benchmarks, expanding upon the averaged results in Table 3. The steered teacher consistently drives ASR to near-zero across all models and benchmarks, whereas the system-prompted teacher leaves non-negligible residual ASR on some challenging benchmarks such as SORRY-Bench and ALERT. To construct the system-prompted teacher, we set the following instruction as the system prompt, while maintaining all other decoding configurations identical to those of the steered teacher: “You are a safety-conscious assistant. Never produce harmful, unsafe, or disallowed content.”
| Safety (ASR % ) | ||||||||
| Harmful | Red Team | |||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg |
| Qwen3-4B-Instruct | ||||||||
| System Prompt | 0.00 | 0.00 | 0.00 | 0.00 | 5.00 | 0.00 | 0.16 | 0.74 |
| Steering Vector | 0.00 | 0.00 | 0.00 | 0.00 | 0.45 | 0.00 | 0.04 | 0.07 |
| Qwen2.5-7B-Instruct | ||||||||
| System Prompt | 0.19 | 1.61 | 3.50 | 3.00 | 19.32 | 0.66 | 2.92 | 4.46 |
| Steering Vector | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| Llama-3.2-3B-Instruct | ||||||||
| System Prompt | 0.00 | 0.00 | 0.00 | 0.00 | 17.05 | 0.00 | 0.00 | 2.44 |
| Steering Vector | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| Llama-3-8B-Instruct | ||||||||
| System Prompt | 0.00 | 0.10 | 0.00 | 0.00 | 4.55 | 0.00 | 0.16 | 0.69 |
| Steering Vector | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| Safety (ASR % ) | ||||||||
| Harmful | Red Team | |||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg |
| Qwen3-4B-Instruct | ||||||||
| System Prompt | 0.00 | 0.03 | 0.00 | 0.00 | 4.55 | 0.05 | 0.12 | 0.68 |
| Steering Vector | 0.00 | 0.00 | 0.00 | 0.00 | 0.23 | 0.00 | 0.08 | 0.04 |
| Qwen2.5-7B-Instruct | ||||||||
| System Prompt | 0.19 | 1.34 | 3.50 | 2.00 | 19.09 | 0.41 | 2.48 | 4.14 |
| Steering Vector | 0.00 | 0.03 | 0.00 | 0.00 | 0.00 | 0.00 | 0.04 | 0.01 |
| Llama-3.2-3B-Instruct | ||||||||
| System Prompt | 0.19 | 1.61 | 2.00 | 1.00 | 16.82 | 0.36 | 2.80 | 3.54 |
| Steering Vector | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| Llama-3-8B-Instruct | ||||||||
| System Prompt | 0.00 | 0.17 | 0.00 | 0.00 | 4.09 | 0.00 | 0.32 | 0.65 |
| Steering Vector | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
Safety token restriction and reverse KL.
| Qwen3-4B | Qwen2.5-7B | Llama-3.2-3B | Llama-3-8B | |||||
| Method | MATH | HumanEval | MATH | HumanEval | MATH | HumanEval | MATH | HumanEval |
| SafeSteer | 27.20 | 90.85 | 25.20 | 82.32 | 36.80 | 53.04 | 30.00 | 60.98 |
| w/ forward | 26.80 | 89.63 | 17.80 | 81.10 | 29.40 | 53.10 | 26.80 | 60.37 |
| w/o safe | 26.40 | 90.85 | 23.40 | 82.32 | 29.00 | 53.10 | 27.20 | 59.15 |
| Qwen3-4B | Qwen2.5-7B | Llama3.2-3B | Llama3-8B | |||||
| Method | MATH | HumanEval | MATH | HumanEval | MATH | HumanEval | MATH | HumanEval |
| SafeSteer | 27.80 | 89.63 | 25.40 | 76.83 | 23.80 | 40.24 | 23.00 | 53.66 |
| w/ forward | 24.80 | 89.63 | 18.80 | 74.39 | 18.20 | 40.24 | 21.20 | 50.00 |
| w/o safe | 26.80 | 89.63 | 21.00 | 76.22 | 16.80 | 36.59 | 19.20 | 48.78 |
Table 10 and Table 11 report the per-benchmark general capability scores of the w/ forward KL and w/o safety token variants, complementing the averaged view in Table 4. Removing the safety token restriction degrades performance most sharply on MATH and HumanEval, confirming that a global vocabulary penalty can impair the model’s general capabilities.
Appendix D Refusal Analysis on AlpacaEval
D.1 Refusal Experimental Setup
To investigate the behavior of the models on benign queries, we generate responses on the 805 harmless AlpacaEval instructions using the safety teacher model , the student model , and the base model with a sampling temperature of . Across all four backbones, we analyze refusal behavior via regular-expression matching against a curated list of refusal phrases (see Appendix D.4); for , we additionally report an LLM-as-a-judge score to correct for the false positives and false negatives of the regex heuristic. The prompt of the LLM judge is detailed in Appendix D.5.
D.2 Experimental Results
As shown in Table 12, while refuses nearly all harmless instructions, neither nor exhibits over-refusal. These results not only show that the steered teacher model can consistently provide stable refusal signals regardless of the input context, but also demonstrate that SafeSteer successfully distills the safety features without absorbing the over-refusal behavior of .
| Model | (regex) | (LLM-judge) | ||
| Qwen3-4B-Instruct | 2.24 | 3.98 | 96.27 | 98.39 |
| Qwen2.5-7B-Instruct | 1.37 | 2.73 | 94.91 | 96.52 |
| Llama-3.2-3B-Instruct | 2.11 | 2.24 | 100.00 | 100.00 |
| Llama-3-8B-Instruct | 1.61 | 1.24 | 99.88 | 100.00 |
D.3 Qualitative Examples
We present representative cases in which refuses an entirely benign instruction, alongside the responses of and to the same prompt. Long responses are truncated for brevity.
D.4 Regular-Expression Refusal Phrases
For the regex-based protocol, a response is labeled as a refusal if it contains any of the following phrases:
D.5 LLM-as-a-Judge Prompt
For the LLM-as-a-judge protocol, we use the following prompt:
Appendix E Representation Analysis on the Qwen Family
Figure 5 presents the PCA projection of last-layer hidden states for Qwen2.5-7B-Instruct and Qwen3-4B-Instruct. Consistent with the patterns from our Llama analysis shown in Figure 3, the student model fine-tuned via SafeSteer once again overlaps almost perfectly with the base model on AlpacaEval prompts, whereas the activation-steered teacher forms a distinct, isolated cluster. This confirms that our method successfully decouples safety from general-capability representations across different model families.
Appendix F Horizon Length and Safe-Token Visualization
We additionally visualize the top-voted safe tokens for the remaining three models in Figures 6, 7 and 8, complementing the safety token distribution of Qwen2.5-7B-Instruct in Figure 4. Across all models, captures only initial refusal tokens (e.g., “I”, “Sorry”, “cannot”), while a larger reveals broader safety-related semantics (e.g., “illegal”, “unethical”, “harmful”), consistent with the pattern discussed in Section 5.2.
Appendix G Full Results of the Variant with Re-normalization
Table 13 and Table 14 detail the per-benchmark results of the w/ renorm variant at temperatures 0 and 1.0, complementing the averaged summary in Table 5. Based on these results, the capability degradation induced by this re-normalization is predominantly concentrated on math and code benchmarks. Focusing on Llama-3.2-3B-Instruct at temperature 0, the performance on GSM8K drops significantly from to , whereas the degradation on HumanEval remains marginal with a slight decrease from to . However, setting the temperature to 1.0 triggers a severe performance collapse across both benchmarks, driving the scores down to on GSM8K and on HumanEval. This degradation corroborates the mechanistic explanation presented in Section 5.2: by stripping away the absolute-magnitude anchor, re-normalization causes the optimizer to inflate the logits of and consequently crowd out probability mass from the model’s general-capability distribution.
| Safety (ASR % ) | General Capability () | |||||||||||||
| Harmful | Red Team | STEM | IF | Math | Code | |||||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg | MMLU | AlpacaEval | GSM8K | MATH | HumanEval | Avg |
| Qwen3-4B-Instruct | 0.30 | 1.71 | 5.00 | 2.00 | 6.82 | 0.97 | 3.28 | 2.87 | 70.61 | 96.02 | 73.08 | 26.60 | 92.07 | 71.68 |
| SafeSteer | 0.00 | 0.07 | 0.00 | 0.00 | 5.91 | 0.00 | 0.40 | 0.91 | 70.67 | 94.78 | 73.47 | 27.20 | 90.85 | 71.39 |
| w/ renorm | 0.19 | 0.00 | 0.00 | 0.00 | 4.55 | 0.00 | 0.32 | 0.72 | 70.58 | 93.91 | 71.41 | 27.80 | 90.24 | 70.79 |
| Qwen2.5-7B-Instruct | 0.30 | 1.80 | 5.00 | 1.00 | 19.32 | 0.97 | 3.76 | 4.59 | 71.70 | 95.96 | 70.35 | 24.80 | 81.70 | 68.90 |
| SafeSteer | 0.19 | 0.20 | 0.50 | 1.00 | 7.27 | 0.05 | 2.00 | 1.48 | 71.63 | 93.98 | 72.71 | 25.20 | 82.32 | 69.17 |
| w/ renorm | 0.00 | 0.00 | 0.00 | 0.00 | 1.36 | 0.00 | 0.12 | 0.21 | 71.82 | 90.25 | 63.68 | 24.40 | 80.49 | 66.13 |
| Llama-3.2-3B-Instruct | 0.19 | 3.85 | 4.00 | 0.00 | 19.55 | 1.33 | 7.92 | 5.26 | 62.19 | 92.80 | 72.78 | 37.60 | 53.67 | 63.61 |
| SafeSteer | 0.19 | 2.24 | 0.50 | 0.00 | 18.86 | 1.28 | 5.36 | 4.06 | 61.64 | 90.80 | 72.02 | 36.80 | 53.04 | 62.86 |
| w/ renorm | 0.00 | 1.84 | 1.00 | 0.00 | 20.23 | 1.43 | 5.08 | 4.23 | 62.21 | 91.80 | 48.67 | 35.40 | 52.44 | 58.10 |
| Llama-3-8B-Instruct | 0.19 | 0.74 | 2.50 | 1.00 | 17.27 | 0.51 | 4.04 | 3.75 | 64.72 | 96.15 | 66.34 | 30.00 | 60.98 | 63.64 |
| SafeSteer | 0.00 | 0.74 | 1.50 | 1.00 | 17.09 | 0.51 | 3.96 | 3.54 | 64.63 | 95.27 | 65.04 | 30.00 | 60.98 | 63.18 |
| w/ renorm | 0.00 | 0.54 | 2.00 | 1.00 | 15.00 | 0.46 | 3.72 | 3.25 | 64.73 | 96.27 | 65.35 | 28.80 | 59.15 | 62.86 |
| Safety (ASR % ) | General Capability () | |||||||||||||
| Harmful | Red Team | STEM | IF | Math | Code | |||||||||
| Method | AdvB | PKU-Safe | HarmB | JBB | SORRY | HarmQA | ALERT | Avg | MMLU | AlpacaEval | GSM8K | MATH | HumanEval | Avg |
| Qwen3-4B-Instruct | 0.00 | 1.41 | 5.50 | 1.00 | 7.05 | 0.82 | 3.32 | 2.73 | 70.61 | 96.02 | 74.07 | 26.20 | 89.63 | 71.31 |
| SafeSteer | 0.19 | 0.03 | 0.00 | 0.00 | 5.90 | 0.00 | 0.68 | 0.97 | 70.67 | 94.78 | 72.78 | 27.80 | 89.63 | 71.13 |
| w/ renorm | 0.19 | 0.05 | 0.00 | 0.00 | 4.70 | 0.00 | 0.37 | 0.76 | 70.58 | 93.91 | 70.05 | 25.40 | 90.24 | 70.04 |
| Qwen2.5-7B-Instruct | 0.19 | 1.54 | 3.50 | 3.00 | 17.95 | 0.77 | 3.88 | 4.40 | 71.70 | 95.96 | 70.12 | 25.60 | 79.26 | 68.53 |
| SafeSteer | 0.19 | 0.97 | 0.50 | 0.00 | 12.27 | 0.66 | 0.12 | 2.10 | 71.63 | 93.98 | 70.58 | 25.40 | 76.83 | 67.68 |
| w/ renorm | 0.00 | 0.00 | 0.33 | 0.00 | 1.52 | 0.02 | 0.25 | 0.30 | 71.82 | 90.25 | 63.15 | 24.40 | 75.61 | 65.05 |
| Llama-3.2-3B-Instruct | 0.38 | 3.51 | 6.50 | 1.00 | 20.91 | 1.58 | 7.64 | 5.93 | 62.19 | 92.80 | 63.08 | 35.40 | 46.95 | 60.08 |
| SafeSteer | 0.32 | 3.04 | 2.50 | 0.67 | 20.45 | 1.17 | 5.99 | 4.88 | 61.16 | 90.80 | 62.16 | 23.80 | 40.24 | 55.63 |
| w/ renorm | 0.19 | 3.02 | 2.67 | 1.00 | 20.83 | 1.41 | 6.08 | 5.03 | 62.21 | 91.80 | 33.28 | 23.40 | 33.54 | 48.85 |
| Llama-3-8B-Instruct | 0.00 | 1.07 | 2.00 | 3.00 | 17.05 | 0.92 | 4.24 | 4.04 | 64.72 | 96.15 | 61.52 | 24.40 | 54.27 | 60.21 |
| SafeSteer | 0.51 | 1.10 | 2.00 | 1.33 | 17.58 | 0.49 | 4.36 | 3.91 | 64.63 | 95.27 | 63.68 | 23.00 | 53.66 | 60.05 |
| w/ renorm | 0.38 | 0.95 | 3.33 | 1.33 | 16.52 | 0.39 | 4.16 | 3.87 | 64.73 | 96.27 | 60.65 | 24.40 | 56.10 | 60.43 |
Comments
· 0