Safety-aligned large language models often lose their safety behaviors after fine-tuning, even when safety data are included. While this fragility is well documented, its underlying cause remains unclear. In this paper, we propose that formulaic refusal strings can function as outlier modes: narrow, weakly grounded response patterns that are easy to fit but vulnerable to subsequent updates. Controlled experiments support this account: fixed refusals are acquired much like arbitrary constant strings, in contrast to prompt-grounded natural responses. Motivated by these findings, we introduce Naturalness-Enhanced Safety Targets (NEST), a safety alignment framework that improves safety retention by constructing natural, context-aware safety targets that keep safety responses within the model's existing output distribution and grounded in semantics. We instantiate NEST in both supervised and preference-based alignment settings, using perplexity under the original model as a proxy for distributional support. Across multiple models and alignment regimes, natural safety targets improve both immediate safety and its retention under continued fine-tuning without sacrificing helpfulness. These findings suggest a practical principle for more durable safety alignment: construct safety targets that draw on the model's existing language capabilities and remain grounded in the meaning of each request.
Figures & tables
Figure 1: Prefix histogram of model responses to 1,000 normal and 1,000 harmful instruction data samples in the BeaverTails dataset.
Figure 2: Learning curves for fixed and prompt-grounded safety targets.
Supervision target
Loss
Gradient norm
Cosine
Fixed refusal
6.74
58.56
1.00
Arbitrary fixed string
7.09
54.37
0.30
Fixed explanatory refusal
4.30
26.22
0.23
Natural response
1.23
7.34
−0.05
Table 1: Output-head gradient diagnostics on matched harmful prompts. Cosine similarity is measured relative to the fixed-refusal gradient.
Safety SFT
Continual SFT
Methods
Harmful Score ↓
Harmful Rate (%) ↓
Harmful Score ↓
Harmful Rate (%) ↓
Perplexity
Do Not Answer & Qwen2.5-7B
Hard
2.87 ± 0.04
49.26 ± 1.24
3.85 ± 0.05
74.83 ± 1.60
5.43 ± 0.21
Hard-delay
2.16 ± 0.10
31.04 ± 2.61
3.69 ± 0.10
71.29 ± 2.54
8.53 ± 0.72
Hard-deep
3.48 ± 0.08
64.79 ± 2.71
3.93 ± 0.02
76.35 ± 0.63
3.05 ± 0.20
Original
2.69 ± 0.02
46.51 ± 0.29
3.44 ± 0.01
63.77 ± 0.35
2.37 ± 0.02
Table 2: Full SFT ablation with different safety training targets on AdvBench ( Zou et al., 2023 ) . Harmful Score indicates the response harmful level, ranging from 1 (safe) to 5 (harmful), and Harmful Rate is the percentage of responses with Harmful Score ≥ 3.
Figure 3: Prefix histograms of responses to AdvBench instructions from the original instruction-tuned models and base models fine-tuned with NEST (w/ jailbreak).
Figure 4: Harmful score variation versus perplexity under the original pretrained model across different SFT settings.
Figure 5: Model utility results (ROUGE-L and BLEU scores) of safety SFT on the BeaverTails dataset and continual SFT on the Alpaca dataset.
Methods
Safety DPO
Continual SFT
Harmful Score ↓
Harmful Rate (%) ↓
Harmful Score ↓
Harmful Rate (%) ↓
Mistral-base
1.00 ± 0.00
0.06 ± 0.11
3.94 ± 0.06
75.40 ± 1.13
Mistral-NEST
1.00 ± 0.00
0.19 ± 0.00
3.79 ± 0.07
71.28 ± 1.61
Alpaca-base
3.52 ± 0.01
66.32 ± 0.23
4.42 ± 0.01
86.79 ± 0.29
Alpaca-NEST
3.17 ± 0.02
58.05 ± 0.58
4.33 ± 0.02
84.35 ± 0.74
Vicuna-base
1.28 ± 0.01
7.56 ± 0.29
2.85 ± 0.03
48.53 ± 0.87
Table 3: Experimental results of DPO with different safety training targets on AdvBench ( Zou et al., 2023 ) , where Harmful Score indicates the response harmful level, ranging from 1 (safe) to 5 (harmful), and Harmful Rate denotes the percentage of the harmful responses (with Harmful Score ≥ 3).
Target
Llama-Guard (%)
StrongREJECT
Actionable (%)
Uncensored base
92.5
0.261
27.5
Fixed refusal
44.6
0.290
23.5
Original labels
37.5
0.260
21.9
NEST
35.6
0.230
20.8
Table 4: Complementary safety evaluations. Lower is better. Actionable content measures engagement with harmful specificity ≥3 , over all 520 prompts.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Source
Kept (%)
Avg. words
Refusal prefixes (%)
NEST w/o. jailbreak
100.00
36.10
93.90
NEST
94.10
117.38
0.21
Delay
100.00
102.13
0.50
Appendix
Table 5: Construction statistics for Llama-3-8B safety labels. Rows report file-level retention, response length, and refusal-prefix frequency.
Target
A3 (%) ↓
A4 (%) ↓
Refusals with s≥3
Uncensored base
27.5
6.5
0 / 224
Fixed refusal
23.5
4.0
0 / 315
Original labels
21.9
3.3
0 / 331
NEST
20.8
5.2
0 / 352
Appendix
Table 6: Actionable harmful content in AdvBench outputs. Rates use all 520 prompts as the denominator. The final column examines harmful specificity within responses classified as refusals.
Target
Safe over-refusal (%) ↓
Unsafe refusal (%) ↑
Fixed refusal
9.2
76.0
Original labels
8.0
78.0
NEST
9.6
75.5
Appendix
Table 7: XSTest refusal decisions immediately after safety SFT. Safe and unsafe splits contain 250 and 200 prompts, respectively.
Before continuation
After GSM8K
Target
Refusal (%) ↑
Harm ↓
Refusal (%) ↑
Harm ↓
Fixed refusal
60.6
0.224
16.2
0.490
NEST
67.7
0.187
34.2
0.374
Appendix
Table 8: Safety before and after GSM8K continuation. Each evaluation uses 520 AdvBench prompts. Harm denotes the adapted-rubric score Hadapt .
Target
Refusals
Mean words
Mean Harmful Score
Fixed refusal
315
16.95
1.09
Original labels
331
25.68
1.05
NEST
352
70.53
1.09
Appendix
Table 9: Response length and policy-judge harmfulness within the refusal subset. Length is measured in whitespace-delimited words.
Selection rule
DPO
Continual SFT
Score ↓
Rate ↓
Score ↓
Rate ↓
NEST
1.418
13.29
3.274
60.83
Low-PPL safe
1.473
14.81
3.200
58.63
Random safe
1.360
11.92
3.286
60.95
High-PPL safe
1.394
12.88
3.469
65.82
Appendix
Table 10: DPO candidate-selection ablation on Alpaca-7B.
Backbone
Skipped prompts
Skipped (%)
Kept min. cost
Skipped min. cost
Alpaca
3,720
34.40
−0.465
0.560
Mistral
1,248
11.54
−0.627
0.940
Vicuna
1,240
11.47
−0.705
0.869
Appendix
Table 11: DPO candidate coverage. The final two columns report the average minimum candidate cost per prompt. Higher cost indicates lower safety under the cost model.
Figure 6: Harmful score of safety DPO baselines under prefilling and jailbreaking attacks.
Figure 7: Harmful score after continual SFT versus the number of continual SFT samples.
Figure 8: Safety and utility performance under different proportions of safety samples in safety SFT.
Aligned large language models (LLMs) are expected to exhibit safety behavior based on the content of the user request: they should refuse unsafe requests and comply with safe ones. However, we show that the same request can elicit substantially different safety decisions under different traits assigned in the system prompt, a failure mode we call trait-induced safety variation. To measure this failure, we introduce refusal-based metrics: Trait-Induced Deviation measures dataset-level deviation from the no-trait baseline, while Trait-Induced Flip Rate measures whether the same request receives different safety decisions across traits. We then provide a representation-level analysis of the mechanism behind trait-induced safety shifts and find that traits perturb the model's safety representations within a low-dimensional subspace. To achieve trait-invariant safety, where safety behavior remains stable across traits, we introduce Trait-Invariant Safety Tuning (TIST), a simple yet effective self-distillation framework that aligns an LLM's trait-conditioned behavior with its no-trait behavior. Guided by our analysis, we further propose Trait-Subspace Neutralization (TraSN), an instantiation of TIST, which enforces invariance only within the identified trait subspace. Experiments show that TraSN improves trait-invariant safety and strengthens harmful-request safety while preserving general capability. Our results highlight traits as an important factor in LLM safety and robust model behavior.
Safety alignment aims to ensure that large language models (LLMs) refuse harmful requests by post-training on harmful queries paired with refusal answers. Although safety alignment is widely adopted in industry, the overrefusal problem where aligned LLMs also reject benign queries after safety alignment post-training, remains insufficiently studied. Such an issue degrades the usability of safety alignment in real-world applications. In this paper, we examine how overrefusal arises under safety alignment, and propose a mitigation strategy inspired by our findings. We define refusal triggers as linguistic cues in the training data that elicit refusal responses, safety alignment encourages LLMs to associate refusal triggers within a training sample with refusal responses, leading aligned LLMs to refuse harmful queries. However, the refusal triggers include not only harmful linguistic cues but also non-harmful cues, therefore causing overrefusal to benign queries. Building on this mechanistic analysis, we propose a method that explicitly considers refusal triggers in the safety alignment fine-tuning. Empirical results demonstrate that our approach achieves a more favorable trade-off between defense against jailbreak attacks and responsiveness to benign queries, outperforming prior methods. Warning: this paper contains harmful and biased sentences.
Zhiyu Xue, Zimo Qi, Guangliang Liu +2
University of California, Santa Barbara · Johns Hopkins University · Michigan State University +1
Safety-aligned language models are known to suffer degradation in refusal behavior following domain-specific fine-tuning, even when the fine-tuning data is entirely benign. The predominant mitigation strategy, preference optimization on the fine-tuned model, is computationally expensive and requires domain-specific preference data that is often unavailable in practice. We propose SPECTRA, a training-free, weight-level method that restores refusal behavior by transferring the base model's refusal direction into the fine-tuned model's weights via an activation-aware, low-rank update, requiring no gradient-based optimization or domain-specific safety data. The low-rank design restricts the intervention to the subspace most causally active on harmful inputs, leaving benign behavior largely undisturbed by construction. Empirically, SPECTRA substantially improves refusal behavior across a comprehensive safety evaluation, while preserving general coherence, domain-specific knowledge, and producing negligible change in false refusal rates.