Reasoning-Induced Misalignment, where fine-tuning on reasoning data containing no harmful content, including mathematics, code, and problem-solving with chain-of-thought traces can induce harmful behaviors of LLM, posing a serious challenge to the safety of LLM reasoning. Cross-architecture, cross-scale, and cross-dataset checks show that RIM does not always emerge. Previous work attributed RIM to neuron-level entanglement, but did not identify the geometry of the representation space underlying this entanglement or propose a training-time fix. We provide both: a representation-space analysis of RIM and the Safety-Direction Penalty (SDP), which penalizes movement along a learned safety direction during reasoning fine-tuning. The analysis extracts two activation-space directions, one encoding reasoning ability and the other safety behavior. These directions are coupled: fine-tuning that improves reasoning shifts safety representations, and prompts with larger shifts show larger safety degradation. CKA distance ratios and probes locate the safety-decision layers where this shift is most relevant. These findings guide the design of SDP: the coupling motivates penalizing displacement along the safety direction, and the layer localization sets the initial scope. When the initial scope leaves compensatory shifts beyond the penalized layers, the same diagnostics guide iterative expansion. On Qwen2.5-3B and 7B, SDP restores safety while preserving benchmark reasoning performance.
Figures & tables
Figure 1: Conceptual overview of Reasoning-Induced Misalignment (RIM) and its mitigation. Harmless reasoning supervised fine-tuning (SFT) can weaken safety, safety representations drift away from the base state, and Safety-Direction Penalty (SDP) constrains this shift during training.
3B
7B
Base
AM-SFT
Base
AM-SFT
HEx-PHI% ↓
10.00
20.33
13.33
25.33
SafetyBench ↑
69.11
57.93
79.50
76.45
GPQA ↑
29.69
28.57
33.26
35.71
AIME 2024 ↑
4.2 ± 2.4
5.8 ± 3.5
10.4 ± 3.3
10.8 ± 5.6
AIME 2025 ↑
0.4 ± 1.2
4.2 ± 3.5
10.4 ± 6.8
7.5 ± 3.5
Table 1: Safety degrades after reasoning fine-tuning (AM-SFT) while benchmark reasoning performance is largely preserved.
Figure 2: Probe accuracy across layers for 3B (top) and 7B (bottom). The harm-perception probe remains stable after AM-SFT. The safety-decision probe collapses after AM-SFT.
Figure 3: Per-layer R–S diagnostics within M1 . Top row: whitened cosine similarity cosw , all negative, consistent with coupling. Bottom row: displacement dS along S^ after AM-SFT. 7B displacement is uniformly negative; 3B displacement is sign-mixed.
3B
7B
Base
AM-SFT
SDP
Base
AM-SFT
SDP
HEx-PHI% ↓
10.0
20.3
10.0
13.3
25.3
11.3
SafetyBench ↑
69.1
57.9
69.6
79.5
76.5
79.4
GPQA ↑
29.7
28.6
25.9
33.3
35.7
31.3
AIME 2024 ↑
4.2 ± 2.4
5.8 ± 3.5
3.8 ± 3.1
10.4 ± 3.3
10.8 ± 5.6
15.0 ± 2.9
AIME 2025 ↑
0.4 ± 1.2
4.2 ± 3.5
2.5 ± 1.4
10.4 ± 6.8
7.5 ± 3.5
9.6 ± 5.1
Table 2: SDP results at both scales. 3B uses M={L19,…,L32} ; 7B uses M={L15,…,L19} . SDP restores base-level safety while retaining most evaluated reasoning performance. Intermediate configurations appear in Appendix D.2 .
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
Qwen2.5-Instruct
Parameters
3B
7B
14B
Hidden dim. ( d )
2,048
3,584
5,120
FFN dim.
11,008
18,944
13,824
Layers
36
28
48
Attention heads
16
28
40
KV heads
2
4
8
Appendix
Table 3: Architecture details for the Qwen2.5-Instruct models. All three are instruction-tuned and safety-aligned during post-training.
Hyperparameter
3B
7B
Model and adapter
Base model
Qwen2.5-3B-Instruct
Qwen2.5-7B-Instruct
LoRA r/α
16/16
16/16
LoRA target
All linear layers: q/k/v/o/gate/up/down_proj
LoRA dropout
0.0
0.0
γs (SDP)
0.5
0.5
Appendix
Table 4: Training configuration for 3B and 7B. AM-SFT uses the same setup with γs=0 and no penalty scope.
Run 1
Run 2
Training examples
24,000
10,000
Quantization
4-bit
none (bf16)
Learning rate
2e-4
5e-5
Epochs
3
5
Effective batch
2
8
Optimizer
AdamW 8-bit
AdamW
Appendix
Table 5: 14B AM-SFT training configurations.
Model
Training corpus
Train N
Epochs
Max length
LR
Batch × accum.
Qwen2.5-3B-Instruct
MetaMathQA
10,000
3
16,384
5e−5
1×8
Gemma 3 4B IT
AM-DeepSeek
24,337
3
16,384
5e−5
1×8
Ministral 3 3B Instruct
AM-DeepSeek
24,337
3
16,384
5e−5
1×8
Appendix
Table 6: Training settings for the cross-dataset and cross-architecture checks. All runs use seed 3407, AdamW with a cosine schedule, and LoRA rank/alpha 16/16 with zero dropout. Qwen and Ministral target q/k/v/o/gate/up/down_proj ; Gemma restricts the corresponding targets to text-decoder modules and excludes the vision tower. The 24,337-example setting is the executed model-specific cross-architecture setting, not an architecture-only match to the Qwen 10k experiment.
Setting
HEx-PHI% ↓
SafetyBench ↑
GPQA ↑
AIME 2024 ↑
AIME 2025 ↑
Qwen2.5-3B MetaMathQA-SFT
12.67
66.59
24.78
0.42±1.18
0.00±0.00
Gemma 3 4B IT Base
12.67
71.05
28.79
11.67±1.78
10.00±1.78
Gemma 3 4B IT AM-SFT
5.00
63.06
28.79
6.25±3.30
5.83±3.88
Ministral 3 3B Instruct Base
34.00
68.47
41.52
26.25±4.15
17.50±1.54
Ministral 3 3B Instruct AM-SFT
30.67
35.84
18.97
2.92±1.18
0.00±0.00
Qwen2.5-14B Base
7.00
82.94
38.39
13.33
20.00
Appendix
Table 7: Cross-dataset, cross-architecture, and scale-check induction results. The MetaMathQA HEx-PHI entry is the validated 300-sample rejudge, and the Gemma AM-SFT GPQA entry is recovered from the completed evaluation. AIME reports mean ± sample standard deviation over eight runs.
Layer
cosw
Layer
cosw
L0
+0.471
L18
−0.127
L1
+0.323
L19
−0.128
L2
+0.238
L20
−0.092
L3
+0.166
L21
−0.085
L4
+0.138
L22
−0.129
L5
+0.079
L23
−0.159
Appendix
Table 8: 3B per-layer cosw(R^,S^) . Negative from L10 onward, peaking in {L27,…,L32} (mean −0.20 ).
Layer
cosw
Layer
cosw
L0
+0.264
L14
−0.080
L1
+0.198
L15
−0.072
L2
+0.120
L16
−0.083
L3
+0.092
L17
−0.103
L4
−0.015
L18
−0.173
L5
−0.019
L19
−0.205
Appendix
Table 9: 7B per-layer cosw(R^,S^) . Negative from L4 onward, increasing in magnitude through the deep layers.
Layer
CKA h
CKA a
Drop h
rCKA
Layer
CKA h
CKA a
Drop h
rCKA
L0
0.999
0.999
0.001
0.76
L18
0.942
0.956
0.058
1.31
L1
0.999
0.999
0.001
0.86
L19
0.938
0.958
0.063
1.49
L2
0.989
0.995
0.011
2.17
L20
0.920
0.957
0.080
1.88
L3
0.979
0.989
0.021
1.85
L21
0.908
0.952
0.092
1.93
L4
0.981
0.991
0.019
2.03
L22
0.872
0.932
0.128
1.89
L5
0.974
0.988
0.026
2.09
L23
0.819
0.920
0.181
2.27
Appendix
Table 10: 3B per-layer CKA profile (base → AM-SFT). CKA h = CKA on HEx-PHI; CKA a = CKA on Alpaca; Drop h = 1−CKAh ; rCKA is the CKA distance ratio. Bold rows = initial M1 . Horizontal rules separate noise ( {L0,…,L11} ), valley ( {L12,…,L16} ), transition ( {L17,…,L19} ), M1={L20,…,L26} , and tail ( {L27,…,L35} ).
Layer
CKA h
CKA a
Drop h
rCKA
Layer
CKA h
CKA a
Drop h
rCKA
L0
0.999
0.999
0.001
1.20
L14
0.870
0.887
0.130
1.15
L1
0.989
0.987
0.011
0.82
L15
0.846
0.883
0.154
1.32
L2
0.975
0.973
0.025
0.91
L16
0.818
0.864
0.182
1.34
L3
0.961
0.963
0.039
1.06
L17
0.780
0.853
0.220
1.50
L4
0.963
0.956
0.037
0.82
L18
0.763
0.840
0.237
1.48
L5
0.926
0.944
0.074
1.33
L19
0.767
0.814
0.233
1.25
Appendix
Table 11: 7B per-layer CKA profile (base → AM-SFT). Bold rows = M1 . Above M1 , rCKA is unstable with small absolute drops. Below M1 , the ratio drops sharply below 1, indicating capability-dominant drift.
HEx-PHI% ↓
SafetyBench ↑
GPQA ↑
AIME 24/25 ↑
3B Base
10.00
69.11
29.69
4.2 ± 2.4 / 0.4 ± 1.2
3B AM-SFT
20.33
57.93
28.57
5.8 ± 3.5 / 4.2 ± 3.5
3B SDP( {L20,…,L26} )
18.67
62.80
26.79
7.1 ± 3.5 / 0.4 ± 1.1
7B Base
13.33
79.50
33.26
10.4 ± 3.3 / 10.4 ± 6.8
7B AM-SFT
25.33
76.45
35.71
10.8 ± 5.6 / 7.5 ± 3.5
7B SDP( {L15,…,L19} )
11.33
79.44
31.25
15.0 ± 2.9 / 9.6 ± 5.1
Appendix
Table 12: Initial SDP on M1 . 7B restores base-level safety; 3B does not. AIME reports mean ± std over 8 runs.
M1dS
Post- M1dS
HEx-PHI%
SafetyBench
Base
0.000
0.000
10.0
69.1
AM-SFT
− 0.013
− 2.805
20.3
57.9
SDP( {L20,…,L26} )
+ 0.088
− 3.006
18.7
62.8
SDP( {L20,L21} )
− 0.937
− 5.374
14.3
46.0
SDP( {L19,…,L32} )
+ 0.038
+ 0.159
10.0
69.6
Appendix
Table 13: 3B compensation diagnostic. M1={L20,…,L26} ; Post- M1 = {L27,…,L35} . SDP( {L19,…,L32} ) is the final expanded configuration.
Figure 4: Per-layer dS displacement profile (3B, all 36 layers). AM-SFT shows sign-mixed displacement concentrated in the deep layers. SDP( {L20,…,L26} ) and SDP( {L20,L21} ) suppress M1 but leave or amplify post- M1 displacement. SDP( {L19,…,L32} ) suppresses the displacement-active zone. {L34,L35} show large-magnitude displacement driven by activation scale in the final layers.
Table 15: 7B displacement by region. Expanding the penalty scope to include CKA <1 layers intensifies displacement in the first unpenalized layer (L24: −2.66→−5.90 ), consistent with the compensation pattern in 3B.
Layer
AM-SFT
SDP( {L20,L21} )
SDP( {L20,…,L26} )
SDP( {L19,…,L32} )
L0
−0.005
+0.003
−0.001
−0.002
L1
−0.116
+0.000
−0.002
−0.004
L2
−0.027
−0.027
−0.013
+0.002
L3
−0.183
−0.026
−0.015
−0.005
L4
−0.321
−0.015
−0.013
−0.009
L5
−0.248
−0.001
−0.025
−0.004
Appendix
Table 16: 3B per-layer dS across all configurations (mean over 300 HEx-PHI prompts, position (a)). Negative = comply direction; positive = refuse direction.
Base
AM-SFT
γs =0.01
γs =0.05
γs =0.1
γs =0.5
γs =1.0
γs =5.0
HEx-PHI% ↓
10.0
20.3
7.7
10.3
18.0
10.0
9.3
13.3
SafetyBench ↑
69.1
57.9
64.9
67.4
67.7
69.6
66.5
66.6
GPQA ↑
29.7
28.6
27.5
26.8
23.4
25.9
23.7
27.7
AIME 24 ↑
4.2 ± 2.4
5.8 ± 3.5
6.7 ± 4.4
6.7 ± 2.5
1.2 ± 1.7
3.8 ± 3.1
3.3 ± 3.1
4.2 ± 3.5
AIME 25 ↑
0.4 ± 1.2
4.2 ± 3.5
4.6 ± 4.0
3.8 ± 2.8
3.8 ± 3.3
2.5 ± 1.4
1.2 ± 1.7
2.1 ± 2.5
Appendix
Table 17: Penalty weight γs ablation on 3B with M={L19,…,L32} . γs=0.5 achieves the best balance between safety recovery and reasoning preservation. Bold = best safety metric.
14B Run
AIME
GPQA
GSM8K
HEx-PHI
Base
0/60
0/448
0/200
0/300
AM-SFT (ckpt5000)
0/60
0/448
0/200
1/300
AM-SFT (final)
0/60
0/448
0/200
1/300
Appendix
Table 18: 14B <think> adoption rate. The model almost never enters extended thinking, even on reasoning benchmarks. The same AM-DeepSeek data induces <think> in 46% (3B) and 60% (7B) of HEx-PHI responses.