Saved in:
Bibliographic Details
Main Authors: Zhu, Junda, Yan, Lingyong, Wang, Shuaiqiang, Yin, Dawei, Sha, Lei
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2502.12970
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908548640800768
author Zhu, Junda
Yan, Lingyong
Wang, Shuaiqiang
Yin, Dawei
Sha, Lei
author_facet Zhu, Junda
Yan, Lingyong
Wang, Shuaiqiang
Yin, Dawei
Sha, Lei
contents Large Reasoning Models (LRMs) have recently demonstrated impressive performances across diverse domains. However, how the safety of Large Language Models (LLMs) benefits from enhanced reasoning capabilities against jailbreak queries remains unexplored. To bridge this gap, in this paper, we propose Reasoning-to-Defend (R2D), a novel training paradigm that integrates a safety-aware reasoning mechanism into LLMs' generation process. This enables self-evaluation at each step of the reasoning process, forming safety pivot tokens as indicators of the safety status of responses. Furthermore, in order to improve the accuracy of predicting pivot tokens, we propose Contrastive Pivot Optimization (CPO), which enhances the model's perception of the safety status of given dialogues. LLMs dynamically adjust their response strategies during reasoning, significantly enhancing their safety capabilities defending jailbreak attacks. Extensive experiments demonstrate that R2D effectively mitigates various attacks and improves overall safety, while maintaining the original performances. This highlights the substantial potential of safety-aware reasoning in improving robustness of LRMs and LLMs against various jailbreaks.
format Preprint
id arxiv_https___arxiv_org_abs_2502_12970
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Reasoning-to-Defend: Safety-Aware Reasoning Can Defend Large Language Models from Jailbreaking
Zhu, Junda
Yan, Lingyong
Wang, Shuaiqiang
Yin, Dawei
Sha, Lei
Computation and Language
Large Reasoning Models (LRMs) have recently demonstrated impressive performances across diverse domains. However, how the safety of Large Language Models (LLMs) benefits from enhanced reasoning capabilities against jailbreak queries remains unexplored. To bridge this gap, in this paper, we propose Reasoning-to-Defend (R2D), a novel training paradigm that integrates a safety-aware reasoning mechanism into LLMs' generation process. This enables self-evaluation at each step of the reasoning process, forming safety pivot tokens as indicators of the safety status of responses. Furthermore, in order to improve the accuracy of predicting pivot tokens, we propose Contrastive Pivot Optimization (CPO), which enhances the model's perception of the safety status of given dialogues. LLMs dynamically adjust their response strategies during reasoning, significantly enhancing their safety capabilities defending jailbreak attacks. Extensive experiments demonstrate that R2D effectively mitigates various attacks and improves overall safety, while maintaining the original performances. This highlights the substantial potential of safety-aware reasoning in improving robustness of LRMs and LLMs against various jailbreaks.
title Reasoning-to-Defend: Safety-Aware Reasoning Can Defend Large Language Models from Jailbreaking
topic Computation and Language
url https://arxiv.org/abs/2502.12970