Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Why Not Act on What You Know? Unleashing Safety Potential of LLMs via Self-Aware Guard Enhancement

About

Large Language Models (LLMs) have shown impressive capabilities across various tasks but remain vulnerable to meticulously crafted jailbreak attacks. In this paper, we identify a critical safety gap: while LLMs are adept at detecting jailbreak prompts, they often produce unsafe responses when directly processing these inputs. Inspired by this insight, we propose SAGE (Self-Aware Guard Enhancement), a training-free defense strategy designed to align LLMs' strong safety discrimination performance with their relatively weaker safety generation ability. SAGE consists of two core components: a Discriminative Analysis Module and a Discriminative Response Module, enhancing resilience against sophisticated jailbreak attempts through flexible safety discrimination instructions. Extensive experiments demonstrate SAGE's effectiveness and robustness across various open-source and closed-source LLMs of different sizes and architectures, achieving an average 99% defense success rate against numerous complex and covert jailbreak methods while maintaining helpfulness on general benchmarks. We further conduct mechanistic interpretability analysis through hidden states and attention distributions, revealing the underlying mechanisms of this detection-generation discrepancy. Our work thus contributes to developing future LLMs with coherent safety awareness and generation behavior. Our code and datasets are publicly available at https://github.com/NJUNLP/SAGE.

Peng Ding, Jun Kuang, Zongyu Wang, Xuezhi Cao, Xunliang Cai, Jiajun Chen, Shujian Huang• 2025

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K (test)
Accuracy99
797
Multitask Language UnderstandingMMLU (test)
Accuracy89
303
Jailbreak DefenseJBB-Behaviors
ASR0.00e+0
101
Jailbreak DefenseDeepInception
Harmful Score1
58
Jailbreak DefenseAutoDAN
ASR0.00e+0
51
Jailbreak DefenseAdvBench
ASR (Overall)0.00e+0
49
Model Helpfulness EvaluationJust-Eval (test)
Helpfulness Score4.96
42
Jailbreak DefenseReNeLLM
Harmful Score1
42
Jailbreak DefensePAIR
Harmful Score1
37
Jailbreak DefenseGCG
Harmful Score1
37
Showing 10 of 22 rows

Other info

Code

Follow for update