arXiv:2608.23497cs.AIAug 2026

Manuscript Offprint

arXiv:2608.23497

Mitigating Reasoning-Induced Misalignment via Safety-Direction Penalty

Yipeng Zhao, Qishun Yang, Shenzhe Zhu, Shu Yang, Di Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

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.

1 Introduction

Large language models (LLMs) are now widely deployed, but they pose safety risks. Alignment training teaches models to refuse harmful requests, yet this behavior is not robust to further fine-tuning. Betley et al. (2026) discovered Emergent Misalignment (EM): fine-tuning on

Observation: Harmless Reasoning SFT Can Weaken Safety

Figure

Problem: Safety Representations Drift After SFT

Figure

Mitigation: Safety-Direction Penalty (SDP)

Figure

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.

narrow misaligned data, such as insecure code that the model produces without disclosure, can induce broad misalignment across unrelated domains. Reasoning-Induced Misalignment (RIM), identified by Yan et al. (2026), presents an even more surprising case: fine-tuning on purely benign reasoning data, including mathematics, code, and chain-of-thought traces, degrades safety alignment. While EM requires training data that contain narrow misaligned content, RIM arises from supervised fine-tuning on pure reasoning data, with no misaligned content at all. We treat RIM as a conditional failure mode: it does not necessarily emerge for every model–dataset combination. Yan et al. (2026) attributed RIM to neuron-level entanglement between reasoning and safety circuits but left mitigation as an open problem. Deactivating the entangled neurons increases misalignment while degrading reasoning, confirming that reasoning and safety share the same neural substrate.

To mitigate RIM, we need to understand the coupling in a form that allows selective intervention; neuron-level analysis alone cannot provide this because the same neurons serve both functions. Prior work, however, has shown that individual model behaviors, such as refusal, correspond to linear directions in activation space (Arditi et al., 2024), suggesting that distinct behaviors can be separated as directions even when they share neurons. Can we explain RIM via the geometry of the representation space, and can that explanation guide a training-time mitigation?

We hypothesize that this entanglement can be characterized through the geometry of reasoning and safety in the representation space: fine-tuning that improves reasoning should also perturb the representations that encode safety behavior. Building on this framework, we extract two directions from the hidden states of the base model, the model before fine-tuning. The reasoning direction separates correct from incorrect reasoning; the safety direction separates refusal from compliance. In 3B and 7B, where RIM appears, the two directions show consistently negative cosine similarity across the mid-to-deep layers: improving reasoning pushes representations away from safe behavior. Prompts where safety representations are perturbed more show larger safety degradation.

The coupling spans many layers, but a practical intervention requires knowing which layers to target. We use Centered Kernel Alignment (CKA; Kornblith et al. 2019) distance ratios to compare how much each layer's representations change on harmful versus harmless inputs after fine-tuning. Safety-specific change concentrates in a compact set of safety-decision layers. Linear probes provide independent confirmation: within these layers, the model still recognizes harmful requests after fine-tuning. Its refusal rate, however, drops from over 90% to the random-chance level. The model still knows a request is harmful but no longer acts on that knowledge.

Based on these two sets of findings, we propose the Safety-Direction Penalty (SDP). The coupling determines the penalty form: a penalty on the squared displacement along the safety direction during training. Layer localization determines the initial penalty scope. When initial application triggers compensatory displacement in layers beyond the penalized set, the same diagnostics guide iterative scope expansion. On Qwen2.5-3B and 7B, SDP restores safety while preserving benchmark reasoning performance. Figure 1 summarizes our main findings: harmless reasoning SFT can weaken safety, this failure appears as safety-representation drift, and SDP mitigates it by constraining the drift during training.

We summarize our contributions:

  1. Representation-space analysis. We trace RIM to coupled reasoning and safety directions, localized safety-decision layers, and displacement along the safety direction.

  2. Safety-Direction Penalty (SDP). A training-time mitigation guided by that analysis. One penalty term, no safety training data, no reference policy, no inference overhead.

  3. Diagnostic-driven scope adaptation. When the initial penalty scope is insufficient, displacement compensates in unpunished layers. The same diagnostics detect this compensation and guide iterative expansion.