Beyond Surface-Level Detection: Towards Cognitive-Driven Defense Against Jailbreak Attacks via Meta-Operations Reasoning

Rui Pu, Chaozhuo Li, Rui Ha, Litian Zhang, Lirong Qiu, Xi ZhangarXiv 2025 · OpenReview

Abstract

Defending large language models (LLMs) against jailbreak attacks is essential for their safe and reliable deployment. Existing defenses often rely on shallow pattern matching, which struggles to generalize to novel and unseen attack strategies. To address this challenge, we propose the Cognitive-Driven Defense (CDD) framework, which targets the underlying structure of jailbreak prompts by applying meta-operations, defined as basic manipulations that conceal harmful intent. CDD emulates human cognitive reasoning through a structured reasoning chain. It begins with a global perception of the prompt and follows with a localized analysis to uncover hidden manipulations. By applying supervised fine-tuning on this structured chain, the model learns to identify and reason about known manipulation patterns. To enhance generalization to unseen threats, an entropy-guided reinforcement learning algorithm (EG-GRPO) is introduced to encourage exploration of new types and variants of meta-operations. Experiments demonstrate that CDD can achieve state-of-the-art defense performance and exhibit strong generalization to unseen jailbreak attacks.

Introduction

Large Language Models (LLMs) are increasingly integrated into critical applications, making them prime targets for "jailbreak" attacks—adversarial prompts designed to bypass safety guardrails. Current defense mechanisms are primarily knowledge-driven, relying on keyword filtering or pattern matching against known attack databases. However, these methods suffer from a reactive "patching loop": as soon as a specific pattern is blocked, attackers develop new obfuscation techniques, such as code injection or role-playing, that bypass the static filters.

Comparison between traditional knowledge-driven matching and the proposed cognitive-driven inference.

The fundamental limitation of these approaches is their lack of deep understanding. This paper proposes a shift from simple detection to cognitive reasoning. By teaching models to understand how a prompt is attempting to manipulate them—rather than just identifying what words are used—we can build defenses that generalize to novel, unseen threats.

The Cognitive-Driven Defense (CDD) Framework

The CDD framework moves beyond surface-level patterns by decomposing complex jailbreaks into their fundamental building blocks, termed meta-operations. These are the atomic manipulations (e.g., Scenario Nesting, Translation, Code Nesting) used to hide harmful intent.

The three-stage pipeline of the Cognitive-Driven Defense (CDD) framework, including data construction, SFT, and RL.

The framework is implemented in three distinct stages:

Stage 1: Cognitive Defense Data Construction

We define a taxonomy of 21 meta-operations. For each jailbreak input, we construct a "Cognitive Reasoning Chain." This chain involves a global perception of the prompt, a local analysis of suspicious elements using the meta-operation taxonomy, and a final determination of the jailbreak status. This structured data allows the model to learn the logic behind the defense.

Stage 2: Supervised Fine-Tuning (SFT) for Shallow Cognition

The model is fine-tuned on the reasoning chains generated in Stage 1. This stage equips the model with "System 2" thinking—deliberate, logical reasoning—enabling it to deconstruct prompts and identify known manipulation patterns instead of providing an instinctive "System 1" response.

Stage 3: Entropy-Guided RL for Deep Cognition

To ensure the model generalizes to attacks not present in the training data, we introduce Entropy-Guided Generalized Reward Policy Optimization (EG-GRPO). This reinforcement learning algorithm uses an entropy-based reward to incentivize the model to explore and identify novel combinations of meta-operations. By rewarding the discovery of high-entropy (diverse) manipulation patterns, the model learns the "essence" of jailbreaking rather than just memorizing specific examples.

Experimental Evaluation

We evaluated CDD using benchmarks such as JailbreakBench and HarmBench, testing against both current attacks and simulated "unseen" attacks from 2025.

  • Defense Efficacy: Against known attacks (e.g., PAIR, ReNeLLM), CDD reduced the Attack Success Rate (ASR) to nearly 0.00% on Llama-3.1 and Qwen-2.5 models.
  • Generalization: Most impressively, CDD maintained an ASR below 10% against novel 2025 attack strategies, where traditional defenses like Perplexity filtering or SafeDecoding often failed.
  • Utility Preservation: Using AlpacaEval and OR-Bench, we confirmed that CDD does not lead to "over-refusal." The models remain highly helpful for benign queries, maintaining performance close to the original base models.
  • Efficiency: The Average Token Generation Time Ratio (ATGR) was kept between 1.1x and 1.2x, demonstrating that the added reasoning steps do not significantly impact real-time performance.

Conclusion

The Cognitive-Driven Defense (CDD) framework represents a significant advancement in LLM safety. By shifting the focus from pattern matching to meta-operation reasoning, CDD breaks the reactive cycle of jailbreak defense. While future work will address multi-turn conversations and multimodal threats, CDD provides a robust foundation for building models that can truly outsmart adversarial manipulation through cognitive understanding.

Summary updated

BibTeX
@misc{pu2025beyond,
  author = {Rui Pu and Chaozhuo Li and Rui Ha and Litian Zhang and Lirong Qiu and Xi Zhang},
  title = {{Beyond Surface-Level Detection: Towards Cognitive-Driven Defense Against Jailbreak Attacks via Meta-Operations Reasoning}},
  year = {2025},
  eprint = {2508.03054},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.03054},
}
Figure