TL;DR
Teaching large reasoning models to solve tough math and coding problems often breaks their safety guardrails, while patching those guardrails with data from an external "teacher" model usually degrades their hard-earned reasoning skills. ThinkSafe escapes this Catch-22 by nudging the model to generate its own safety training data—unlocking latent refusal skills it already possesses without distorting its native way of thinking. It restores safety, preserves (and sometimes boosts) reasoning, and runs up to 7–10x faster than online reinforcement learning.
What Problem Does This Paper Address?
Large Reasoning Models (LRMs)—models trained via reinforcement learning to "think out loud" using long Chains-of-Thought (CoT)—are fantastic at math and logic. Unfortunately, optimizing heavily for reasoning tends to erode initial safety training, making them surprisingly compliant with harmful requests.
When researchers try to re-align these models, they hit what’s known as the "safety tax": restoring safety degrades reasoning. Standard fixes typically distill safe reasoning traces from a massive external teacher model (like DeepSeek-R1 685B). However, the authors show mathematically (via KL divergence, a measure of how much two probability distributions differ) that forcing a student model to mimic an external teacher’s phrasing and thought patterns pulls the student "off-distribution," disrupting its native problem-solving mechanics. Meanwhile, online Reinforcement Learning (RL) keeps data in-distribution by sampling from the student continuously, but costs a small fortune in compute time.
How do we get a reasoning model to refuse harmful prompts safely, in its own "voice," on a reasonable compute budget?
Methods
The core hypothesis of ThinkSafe is that even when an LRM complies with a harmful query, it hasn't forgotten what harm looks like—its safety instincts are just masked by strong instruction-following habits.
Instead of hiring an external teacher or running expensive online RL loops, ThinkSafe builds a static, self-generated dataset once from a frozen copy of the student model:
- Refusal Steering (What's New): For harmful prompts, if you sample from the student naively, it mostly complies. Instead, ThinkSafe prepends a simple steering instruction during data generation: "The following prompt is harmful. You should refuse to answer the prompt." This unlocks the model's latent safety knowledge, prompting it to generate a natural, in-distribution CoT explaining why the request is dangerous before refusing. (During actual training, this steering hint is removed so the model learns to refuse on its own).
- Native Benign Sampling: For harmless prompts, responses are sampled directly from the student with no steering, preserving its natural helpfulness and reasoning habits.
- Guard Filtering & Offline Fine-Tuning (Standard): All generated traces are passed through an off-the-shelf safety classifier (
Llama-Guard-3-8B) to filter out anything unsafe. Finally, the student is fine-tuned offline on this clean, self-generated dataset using standard cross-entropy loss with LoRA. (The authors also test aThinkSafe + KLvariant that adds token-level regularization on benign prompts).
Datasets
No new evaluation benchmarks are introduced; the authors build their self-generated training sets using the prompt pool (harmful and benign) from the existing SafeChain dataset.
They evaluate across two axes:
- Reasoning: GSM8K, MATH500, AIME 2024, and GPQA.
- Safety & Over-refusal: HarmBench, StrongReject, and WildJailbreak (measuring harmful compliance), plus the safe subset of XSTest (using WildGuard to check if the model becomes paranoid and refuses benign prompts).
Key Insights and Ideas
- It’s a style mismatch, not a size mismatch: People often assume small models struggle with teacher distillation because of a capacity gap. The authors test cross-distillation between two similarly sized models (
Qwen3-1.7BandR1-Distill-1.5B) and find reasoning still plummets (up to 22.6 percentage points!). Any external teacher has a different distribution; learning your own filtered distribution is uniquely KL-optimal. - Models need to think about safety, too: What if we strip the
<think>traces from refusal responses so the model refuses immediately? In ablations, stripping safety reasoning hurt both safety and general math/science reasoning on DeepSeek-R1-Distill models—suggesting that forcing a reasoning model to abruptly toggle "thinking" on and off destabilizes its CoT mechanics. - Prompt steering beats brute-force rejection sampling: Sampling unsteered responses until you get lucky and find five safe ones heavily biases the training data toward "easy" harmful prompts the model already handles, failing to fix deeper vulnerabilities.
Key Results
Tested across Qwen3 (0.6B to 8B) and DeepSeek-R1-Distill (1.5B to 8B), ThinkSafe achieves the best overall safety score in 6 out of 7 model configurations while keeping reasoning right around—or above—the initial model.
- Breaking the Safety Tax: On
Qwen3-4B, ThinkSafe slashes the HarmBench harmful-response rate from 38.21% to 9.63% while increasing average reasoning accuracy from 74.47% to 77.18%. OnQwen3-8B, the overall safety error average drops from 19.57% to 4.50% while reasoning rises from 76.08% to 78.42%. - Massive Speedups over Online RL: On
Qwen3-0.6B, ThinkSafe achieves better safety (29.65% vs. 37.0%) and comparable reasoning (43.97% vs. 45.7%) to online GRPO, while cutting total wall-clock time (generation + training) from 21.3 hours down to 3.05 hours (~7x faster). Adding KL regularization (ThinkSafe + KL) pushes safety to 26.4% and reasoning to 45.5% in 3.45 hours—beating On-Policy Self-Distillation (37.2 hours) in less than one-tenth the time.
Limitations and Future Work
- Requires prior alignment: ThinkSafe unlocks latent safety knowledge; it likely won't work on raw base models that have never undergone initial safety training.
- Bounded by the judge: Dataset quality is capped by the external safety guard (
Llama-Guard-3-8B) used to filter responses. - Static data & scope: Because data is generated once offline, it gradually becomes off-policy as the model updates. Experiments were also restricted to LoRA fine-tuning on single-turn prompts up to 8B parameters.
- Future directions: Extending ThinkSafe into iterative self-training loops to progressively sharpen refusal logic, or using ThinkSafe datasets as fast, high-quality warm-ups before RL.
Summary updated