Saved in:
Bibliographic Details
Main Authors: Ding, Peng, Sun, Wen, Li, Dailin, Zou, Wei, Wang, Jiaming, Chen, Jiajun, Huang, Shujian
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2508.15648
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914005050720256
author Ding, Peng
Sun, Wen
Li, Dailin
Zou, Wei
Wang, Jiaming
Chen, Jiajun
Huang, Shujian
author_facet Ding, Peng
Sun, Wen
Li, Dailin
Zou, Wei
Wang, Jiaming
Chen, Jiajun
Huang, Shujian
contents Large Language Models (LLMs) excel at various natural language processing tasks but remain vulnerable to jailbreaking attacks that induce harmful content generation. In this paper, we reveal a critical safety inconsistency: LLMs can more effectively identify harmful requests as discriminators than defend against them as generators. This insight inspires us to explore aligning the model's inherent discrimination and generation capabilities. To this end, we propose SDGO (Self-Discrimination-Guided Optimization), a reinforcement learning framework that leverages the model's own discrimination capabilities as a reward signal to enhance generation safety through iterative self-improvement. Our method does not require any additional annotated data or external models during the training phase. Extensive experiments demonstrate that SDGO significantly improves model safety compared to both prompt-based and training-based baselines while maintaining helpfulness on general benchmarks. By aligning LLMs' discrimination and generation capabilities, SDGO brings robust performance against out-of-distribution (OOD) jailbreaking attacks. This alignment achieves tighter coupling between these two capabilities, enabling the model's generation capability to be further enhanced with only a small amount of discriminative samples. Our code and datasets are available at https://github.com/NJUNLP/SDGO.
format Preprint
id arxiv_https___arxiv_org_abs_2508_15648
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SDGO: Self-Discrimination-Guided Optimization for Consistent Safety in Large Language Models
Ding, Peng
Sun, Wen
Li, Dailin
Zou, Wei
Wang, Jiaming
Chen, Jiajun
Huang, Shujian
Computation and Language
Large Language Models (LLMs) excel at various natural language processing tasks but remain vulnerable to jailbreaking attacks that induce harmful content generation. In this paper, we reveal a critical safety inconsistency: LLMs can more effectively identify harmful requests as discriminators than defend against them as generators. This insight inspires us to explore aligning the model's inherent discrimination and generation capabilities. To this end, we propose SDGO (Self-Discrimination-Guided Optimization), a reinforcement learning framework that leverages the model's own discrimination capabilities as a reward signal to enhance generation safety through iterative self-improvement. Our method does not require any additional annotated data or external models during the training phase. Extensive experiments demonstrate that SDGO significantly improves model safety compared to both prompt-based and training-based baselines while maintaining helpfulness on general benchmarks. By aligning LLMs' discrimination and generation capabilities, SDGO brings robust performance against out-of-distribution (OOD) jailbreaking attacks. This alignment achieves tighter coupling between these two capabilities, enabling the model's generation capability to be further enhanced with only a small amount of discriminative samples. Our code and datasets are available at https://github.com/NJUNLP/SDGO.
title SDGO: Self-Discrimination-Guided Optimization for Consistent Safety in Large Language Models
topic Computation and Language
url https://arxiv.org/abs/2508.15648