mlsanityData to 14 Oct 2026

SDGO: Self-Discrimination-Guided Optimization for Consistent Safety in Large Language Models

arXiv 2508.15648 ↗First posted 21 Aug 2025cs.CLcited by 0

On the map: LLM safety and security → Safety alignment, refusal and guardrails

Abstract (arXiv)

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.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 25 of its 32 references that are in the map. First posted on arXiv 21 Aug 2025.

Builds on

25 of 32 references.

Closest ancestors · 1

Same direction, newest first

  1. 2024CodeAttack: Revealing Safety Generalization Challenges of Large Language Models via Code Completion12 Mar

Other references · 24

  1. 2022Training language models to follow instructions with human feedbackcited by 15,971
  2. 2017Proximal Policy Optimization Algorithmscited by 15,215
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  5. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
  6. 2020Measuring Massive Multitask Language Understandingcited by 7,963
  7. 2017Deep reinforcement learning from human preferencescited by 3,912
  8. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  9. 2020Learning to summarize from human feedbackcited by 2,588
  10. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,420
  11. 2023GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Promptscited by 560
  12. 2023Catastrophic Jailbreak of Open-source LLMs via Exploiting Generationcited by 451
12 more
  1. 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 431
  2. 2023DeepInception: Hypnotize Large Language Model to Be Jailbreakercited by 367
  3. 2023A Wolf in Sheep's Clothing: Generalized Nested Jailbreak Prompts can Fool Large Language Models Easilycited by 259
  4. 2024SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decodingcited by 247
  5. 2023LLM Self Defense: By Self Examination, LLMs Know They Are Being Trickedcited by 244
  6. 2024Meta-Rewarding Language Models: Self-Improving Alignment with LLM-as-a-Meta-Judgecited by 204
  7. 2023Defending Large Language Models Against Jailbreaking Attacks Through Goal Prioritizationcited by 170
  8. 2024Attacks, Defenses and Evaluations for LLM Conversation Safety: A Surveycited by 130
  9. 2024Intention Analysis Makes LLMs A Good Jailbreak Defendercited by 74
  10. 2022CodeAttack: Code-Based Adversarial Attacks for Pre-trained Programming Language Modelscited by 53
  11. 2025Process-based Self-Rewarding Language Modelscited by 22
  12. 2025Why Not Act on What You Know? Unleashing Safety Potential of LLMs via Self-Aware Guard Enhancementcited by 8

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Jailbreak Antidote: Runtime Safety-Utility Balance via Sparse Representation Adjustment in Large Language Models
  2. 2024Defending Large Language Models Against Jailbreak Attacks via Layer-specific Editing
  3. 2025TRIDENT: Enhancing Large Language Model Safety with Tri-Dimensional Diversified Red-Teaming Data Synthesis
  4. 2026Safety Paradox: How Enhanced Safety Awareness Leaves LLMs Vulnerable to Posterior Attack
  5. 2025Improving LLM Safety Alignment with Dual-Objective Optimization
  6. 2026Adversarial Reframing: A Framework for Targeted Generation in Language Models
  7. 2026Safety Targeted Embedding Exploit via Refinement
  8. 2026When Prompt Optimization Becomes Jailbreaking: Adaptive Red-Teaming of Large Language Models