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

TL;DR

SAFEPATH is an ultra-lightweight alignment method designed to prevent Large Reasoning Models (LRMs) from generating harmful content without destroying their complex problem-solving abilities. By fine-tuning the model to emit a simple 8-token "Safety Primer" ("Let’s think about safety first") at the very start of its chain-of-thought block, it reduces harmful outputs by up to 90% while requiring nearly 300x less compute than traditional safety-tuning methods.

What Problem Does This Paper Address?

Large Reasoning Models (LRMs), such as DeepSeek-R1 or OpenAI's o1, use extended chain-of-thought (CoT) processing to autonomously think through complex math, coding, and logic problems. However, this structured reasoning pathway is a double-edged sword. When exposed to adversarial or harmful prompts, an LRM can inadvertently use its deep reasoning to rationalize a malicious request as benign, leading to highly detailed and dangerous outputs.

Standard safety alignment techniques designed for regular LLMs—like direct refusal training—introduce a heavy "Safety Tax" when applied to LRMs. They rigidly force the model to shut down, which severely degrades its reasoning depth on benign, complex tasks. Existing methods are also computationally expensive and remain highly vulnerable to sophisticated jailbreak attacks.

Methods

The authors introduce SAFEPATH, a lightweight alignment strategy that steers the model's internal reasoning trajectory using a soft, context-aware signal rather than rigid constraints.

  • The Safety Primer: When a harmful prompt is detected during training, the LRM is fine-tuned to emit a fixed 8-token prefix—"Let’s think about safety first"—immediately after the opening <think> token.
  • Unsupervised Reasoning: Crucially, the rest of the reasoning trace is left completely unsupervised, and the <think> block is left open-ended (no closing tag is enforced during the primer phase). This allows the model to naturally leverage its own reasoning capabilities to navigate away from harm.
  • Balanced Training: The training process interleaves a Safety Trigger Set (harmful prompts trained only on the 8-token primer) and a Reasoning Retain Set (benign math problems trained with full reasoning traces) to prevent overfitting.
  • Zero-Shot Variant (ZS-SAFEPATH): For environments where fine-tuning isn't possible, the authors propose a zero-shot version that simply forces the 8-token primer into the model's context window at inference time, requiring zero parameter updates.

Datasets

  • WildJailbreak: Used as the primary Safety Trigger set for training.
  • DeepSeek Math 220K: Used as the Reasoning Retain set to preserve general problem-solving depth.
  • HarmChain: A new dataset constructed by the authors containing 3,724 verified harmful Question-Reasoning-Answer (QRA) pairs, used to properly evaluate and adapt standard LLM baselines to an LRM context.
  • Evaluation Benchmarks: Safety was evaluated using StrongReject and BeaverTails across five adversarial attack frameworks (DAN, PAIR, Jailbreak Trigger, Multilingual, Prefilling). Reasoning and general capabilities were tested via MATH500, GPQA, AIME24, MBPP, MMLU, and ARC-Challenge.

Key Insights and Ideas

  • Emergent Reactivation: A fascinating "aha moment" in the paper is that even though the model is only trained to say "Let’s think about safety first" once at the very beginning of its thought process, it naturally learns to re-trigger this phrase multiple times mid-reasoning when under intense adversarial pressure (like PAIR attacks). It acts as a persistent, internalized safety compass.
  • The Danger of Rigid Refusals: Alternative prefixes that explicitly signal refusal or caution (e.g., "I think it's a harmful request") prematurely kill the model's reasoning process, causing it to fail even on safe, benign tasks (like math problems involving currency conversion that look vaguely financial). SAFEPATH's soft bias keeps task engagement alive while ensuring safety.
  • Early-Stage Intervention Wins: Prepending the safety signal (prefix) is vastly more effective than appending it at the end of the reasoning block (suffix). Setting the safety context early successfully guides the model's internal trajectory before it veers into dangerous territory.

Key Results

  • Massive Compute Savings: SAFEPATH trains in under 5 minutes, running 295.9x faster than Direct Refusal and 314.1x faster than SafeChain on a DeepSeek-R1-Distill-Llama-8B model.
  • High Safety, Low Tax: It reduces harmful responses by up to 90.0% and blocks 83.3% of jailbreak attempts while maintaining competitive reasoning accuracy across MATH500, GPQA, and AIME24.
  • Zero-Shot Success: ZS-SAFEPATH maintains high reasoning accuracy (e.g., 73.33% on AIME24 for a 14B model) compared to other zero-shot methods like ZEROTHINK, which aggressively tank reasoning performance down to 13.33%.
Figure 1: Performance Comparison of SAFEPATH with Baselines. SAFEPATH significantly reduces harmfulness and attack success rates while maintaining strong reasoning ability. It also dramatically lowers computational cost compared to Direct Refusal and SafeChain.

Limitations and Future Work

Despite its success, SAFEPATH still experiences an Attack Success Rate (ASR) exceeding 25% under highly optimized, state-of-the-art jailbreak techniques like PAIR. This highlights that lightweight prefix interventions remain partially vulnerable to heavily optimized adversarial optimization.

The authors note that future work should explore augmenting the primer mechanism with context-sensitive triggers and expanding the framework to handle multi-turn, dialog-based safety interventions.

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