SafeChain: Safety of Language Models with Long Chain-of-Thought Reasoning Capabilities

Fengqing Jiang, Zhangchen Xu, Yuetai Li, Luyao Niu, Zhen Xiang, Bo Li, B. Lin, Radha Poovendran

arXiv:2502.12025 · 2026-07-27 공개 · arXiv · PDF

llm-safety reasoning-benchmarks deepseek-r1 wildjailbreak strongreject long-chain-of-thought zerothink lessthink

Abstract

Emerging large reasoning models (LRMs), such as DeepSeek-R1 models, leverage long chain-of-thought (CoT) reasoning to generate structured intermediate steps, enhancing their reasoning capabilities. However, long CoT does not inherently guarantee safe outputs, potentially leading to harmful consequences such as the introduction of security vulnerabilities in code or the spread of misinformation. Current research on large language model (LLM) safety usually focuses on short-answer responses, overlooking the long CoT style outputs of LRMs. To bridge this gap, we conduct a systematic study of LRM safety. First, we investigate safety evaluators calibrated against human annotations. Using our newly developed metrics, we thoroughly assess the safety of 12 state-of-the-art LRMs on StrongReject and WildJailbreak datasets. Our results show that LRMs are not safe compared to their reasoning advance. Further, we perform a fine-grained analysis of the reasoning trace and final answer. We find that three decoding strategies-ZeroThink, LessThink, and MoreThink-can improve model safety without additional training. However, these strategies either use constrained reasoning traces or incur high inference costs. To better strengthen LRM safety, we introduce SafeChain, the first-of-its-kind safety training dataset in CoT style. We fine-tune two LRMs with SafeChain, showing that it not only enhances model safety but also preserves performance across 6 reasoning benchmarks.

한국어 요약

한 줄 요약

SafeChain은 CoT 형식의 안전성 훈련 데이터셋으로, DeepSeek-R1 모델의 안전성을 향상시키며 추론 성능을 유지한다.

핵심 기여도

핵심 아이디어

기존 LLM 안전성 연구는 주로 짧은 답변에 집중했으나, Long Chain-of-Thought (CoT)를 사용하는 LRM은 추론 과정 자체가 길고 구조화되어 있어, 단순히 최종 답변만 평가하는 방식이 한계가 있다. 연구팀은 CoT와 최종 답변을 함께 평가하는 새로운 메트릭을 개발하고, 이를 통해 12개의 최신 LRM을 체계적으로 평가했다. 또한, decoding 전략을 조정하는 방식으로 훈련 없이도 안전성을 개선할 수 있음을 발견했으며, SafeChain이라는 CoT 형식의 안전성 훈련 데이터셋을 통해 모델의 안전성과 추론 능력을 동시에 유지하는 방법을 제시했다. SafeChain은 LRM의 학습 분포와 유사한 CoT 데이터를 사용하여, 모델의 추론 성능 저하 없이 안전성을 향상시킬 수 있다는 점에서 혁신적이다.

기술적 접근법

주요 결과

의의 및 한계

SafeChain은 CoT 형식의 안전성 훈련 데이터셋으로, LRM의 안전성과 추론 능력을 동시에 유지하는 데 기여한다. 특히, 기존 안전성 훈련 데이터가 추론 과정을 고려하지 못한 반면, SafeChain은 CoT 구조를 반영하여 모델의 학습 분포에 더 가까운 데이터를 제공한다. 그러나 SafeChain은 현재 영어 기반 데이터셋이며, 다국어 환경으로 확장하는 것이 필요한 한계점이다. 또한, SafeChain의 생성 과정이나 데이터 수집 방식에 대한 구체적인 설명은 제공되지 않았다.

실용적 활용

SafeChain은 코드 생성, 과학 연구, 학습 도우미 등 복잡한 추론이 필요한 산업 및 연구 분야에서 LRM의 안전성을 보장하는 데 활용될 수 있다. 특히, 코드베이스의 보안 취약점 방지나 오해를 일으키는 정보 확산 방지에 유용하다.