NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SAFEPATH: Preventing Harmful Reasoning in Chain-of-Thought via Early Alignment

Wonje Jeung, Sangyeon Yoon, Minsuk Kahng, Albert No · OpenReview

Abstract

Large Reasoning Models (LRMs) have become powerful tools for complex problem solving, but their structured reasoning pathways can lead to unsafe outputs when exposed to harmful prompts. Existing safety alignment methods reduce harmful outputs but can degrade reasoning depth, leading to significant trade-offs in complex, multi-step tasks, and remain vulnerable to sophisticated jailbreak attacks. To address this, we introduce SAFEPATH, a lightweight alignment method that fine-tunes LRMs to emit a short, 8-token Safety Primer at the start of their reasoning, in response to harmful prompts, while leaving the rest of the reasoning process unsupervised. Empirical results across multiple benchmarks indicate that SAFEPATH effectively reduces harmful outputs while maintaining reasoning performance. Specifically, SAFEPATH reduces harmful responses by up to 90.0% and blocks 83.3% of jailbreak attempts in the DeepSeek-R1-Distill-Llama-8B model, while requiring 295.9x less compute than Direct Refusal and 314.1x less than SafeChain. We further introduce a zero-shot variant that requires no fine-tuning.

Introduction

The rise of Large Reasoning Models (LRMs), such as OpenAI’s o1 and the DeepSeek-R1 series, has introduced a new safety challenge. Unlike standard LLMs that respond immediately, LRMs use extended Chain-of-Thought (CoT) to "think" through complex problems. However, this internal reasoning can be a double-edged sword. When faced with a harmful or adversarial prompt, an LRM might use its reasoning steps to mistakenly justify the request as benign or "solve" the harmful task step-by-step. Existing safety methods often result in a "Safety Tax": a significant drop in mathematical or logical performance because the model becomes too "cautious" or its reasoning pathways are disrupted by rigid refusal training.

Methodology

SAFEPATH is a surgical intervention that focuses on the very beginning of the reasoning chain. The model is fine-tuned to start its <think> block with a fixed 8-token prefix: “Let’s think about safety first.” During training, the model is supervised only on these initial 8 tokens when responding to harmful prompts. The rest of the reasoning trace remains unsupervised, allowing the model to use its natural reasoning capabilities to navigate away from harm.

SAFEPATH mechanism: Training a Safety Primer to steer reasoning away from harmful paths.

The method utilizes a Safety Trigger Set (harmful prompts from WildJailbreak) and a Reasoning Retain Set (benign math/logic problems from DeepSeek Math 220K) to prevent performance degradation. A zero-shot variant (ZS-SAFEPATH) is also proposed, which simply prepends the primer at inference time without fine-tuning.

Experimental Results

SAFEPATH was evaluated across diverse benchmarks including StrongReject and BeaverTails for safety, and MATH500, GPQA, and AIME24 for reasoning.

Performance comparison across harmfulness, robustness, reasoning, and computational cost.

Key Findings

  • Safety and Robustness: In the R-8B model, SAFEPATH reduced harmful responses by 90.0% and blocked 83.3% of jailbreak attempts.
  • Preserving Logic: On the difficult AIME24 math benchmark, SAFEPATH maintained a 46.7% accuracy, whereas traditional "Direct Refusal" caused accuracy to drop to 26.7%.
  • Efficiency: Because the intervention is limited to just 8 tokens, training is incredibly fast. SAFEPATH for the DeepSeek-R1-Distill-Llama-8B model required 295.9x less compute than Direct Refusal and 314.1x less than SafeChain.
  • Deep Alignment Phenomenon: A surprising emergent behavior was observed: during complex adversarial attacks, the model often re-triggers the Safety Primer multiple times mid-reasoning, effectively "reminding itself" to stay safe.

Discussion and Limitations

While SAFEPATH acts as a highly effective "soft constraint" that biases models toward safety without disrupting the reasoning engine, it is not infallible. It still records a non-negligible attack success rate (over 25%) against highly optimized, iterative adversarial strategies like PAIR. Future work could explore adaptive primers tailored to specific harm types and extending this early alignment approach to multi-turn dialog scenarios.

Summary updated

BibTeX
@inproceedings{jeung2025safepath,
  author = {Wonje Jeung and Sangyeon Yoon and Minsuk Kahng and Albert No},
  title = {{SAFEPATH: Preventing Harmful Reasoning in Chain-of-Thought via Early Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=vIaNnnQxcl},
}
Figure