From Shallow to Deep: Pinning Semantic Intent via Causal GRPO
Authors: Shuyi Zhou, Zeen Song, Wenwen Qiang, Jiyan Sun, Yao Zhou, Yinlong Liu, Wei Ma
Organizations: University of Chinese Academy of Sciences, Beijing, China · Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China · Institute of Software, Chinese Academy of Sciences, Beijing, China
Large Language Models remain vulnerable to adversarial prefix attacks (e.g., Sure, here is'') despite robust standard safety. We diagnose this vulnerability as Shallow Safety Alignment, stemming from a pathology we term semantic representation decay: as the model generates compliant prefixes, its internal malicious intent signal fades. To address this, we propose Two-Stage Causal-GRPO (TSC-GRPO), a framework designed to achieve intent pinning. First, grounded in causal identifiability theory, we train a causal intent probe to disentangle invariant intent from stylistic perturbations. Second, we internalize this causal awareness into the policy via Group Relative Policy Optimization. By employing a cumulative causal penalty within fork-in-the-road'' training scenarios, we force the model to learn that accumulating harmful tokens monotonically decreases reward, enabling robust late-stage refusals. Experiments show that TSC-GRPO significantly outperforms baselines in defending against jailbreak attacks while preserving general utility.
Figures & tables
Figure 1: Visualizing Semantic Collapse in Shallowly Aligned Models. (a) PCA projection shows that while harmful (red squares) and safe (blue circles) requests are distinct at t=0 , they collapse into a single, indistinguishable singularity after prefix injection ( t>k ); (b) The accuracy of a linear probe trained at t=0 drops rapidly during the prefix injection phase (Phase 2) and remains slightly above the random chance level ( 0.5 ) during subsequent generation (Phase 3).
Base Model
Safety Alignment
AdvBench Attack Success Rate (%)
GCG
AutoDAN
ReNeLLM
CodeCha.
PAIR
DeepInc.
Prefill
ICA
LLaMA-2-7B-Chat
RLHF Zhou et al. (2024)
47.84
51.02
31.35
80.16
24.17
8.42
27.1 ∗
0.00
TSC-GRPO
18.62
15.56
18.17
25.51
12.46
6.47
0.00
0.00
LLaMA-3.1-8B-Instruct
SFT Phan et al. (2025)
73.86
72.88
80.48
96.44
28.57
86.60
51.24 ∗
49.62
NemoGuard Ghosh et al. (2025)
59.57
65.00
81.53
94.62
57.14
64.52
26.42 ∗
31.35
PSR (N=8) Phan et al. (2025)
25.02
0.00
10.05
35.58
22.45
32.69
0.26 ∗
0.00
Table 1: Attack Success Rate (ASR, %) of open-source LLMs under different safety alignment and safeguarding methods on AdvBench. Results without ”” are cited from the original papers; results marked with ”” were reproduced in this study.
Datasets ↓
mean ± std (%) (over 3 rounds)
Initial
Standard SFT
Constrained SFT Qi and others (2025)
TSC-GRPO (Ours)
Harmful Examples
ASR
1.5±0.2
88.9±1.2
4.6±0.5
1.8±0.4
Identity Shifting
ASR
0.0±0.0
79.5±2.3
8.1±0.1
0.0±0.0
Backdoor Poisoning
ASR (w/o trigger)
1.5±0.2
7.6±1.1
1.9±0.2
1.6±0.3
ASR (w/ trigger)
1.7±0.1
90.9±1.4
10.9±2.8
6.5±1.3
Table 2: ASR on LLaMA-2-7B-Chat under various fine-tuning attack strategies.
Instruct
Setting
Utility ↑
GSM8K
HumanEval
MBPP
TruthfulQA
LLaMA-2-7B-Chat
Pre
32.3
7.9
16.5
40.8
Post
32.1
8.3
18.8
39.7
LLaMA-3.1-8B-Instruct
Pre
84.5
72.6
72.8
54.5
Post
86.1
71.7
76.5
54.8
Qwen2.5-7B-Instruct
Pre
91.6
84.8
79.2
64.7
Table 3: Utility before and after safety alignment on standard benchmarks. “Pre” denotes the original instruct model before post-training with TSC-GRPO, while “Post” is the results after TSC-GRPO.
Figure 2: Hyper-parameter sensitivity analysis evaluating the ASR against GCG attacks on AdvBench across three base models. The sub-figures illustrate the impact of varying (a) the uniformity loss weight λ in Stage 1, (b) the causal reward coefficient α in Stage 2, and (c) the similarity threshold τ .
Figure 3: Ablation study on data construction strategies. The bottom table details the specific combination of data views used for probe training, where ∙ indicates inclusion.
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Harmful Intent ( charm )
Safe Intent ( csafe )
Style: Compliance ( ssure )
Type II Harmful ( qharm⊕“Sure” )
Type II Safe ( qsafe⊕“Sure” )
Style: Default ( sraw )
Type I Harmful ( qharm )
Type I Safe ( qsafe )
Appendix
Table 4: The constructed intervention distribution enforcing independence.
Large language models (LLMs) remain vulnerable to jailbreak attacks that conceal harmful intent within complex adversarial prompts. Existing defenses primarily rely on input perturbation or harmful-output suppression, but they rarely model where malicious intent resides, resulting in brittle protection and excessive over-refusal. We propose SENTINEL, a plug-and-play, generation-time jailbreak defense that reframes mitigation as an intent extraction problem. Our key insight is that instruction-tuned LLMs exhibit strong input--output semantic consistency: regardless of jailbreak complexity, generated outputs tend to align with the attacker's true intent. SENTINEL exploits this property by matching semantically aligned input--output regions to extract intention-revealing subsequences, scores these subsequences using refusal-direction projections to estimate harmfulness, and halts generation when necessary. Experiments on HarmBench across multiple LLMs show that SENTINEL reduces jailbreak success rates to close to 5% while maintaining low over-refusal. We further demonstrate robustness to adaptive attacks and provide a mechanistic interpretation: SENTINEL re-distributes jailbreak features from alignment blind spots to aligned regions.
Luoyu Chen, Weiqi Wang, Chenhan Zhang +2
University of Technology Sydney, Sydney, NSW, Australia · Xi’an Jiaotong University, Xi’an, Shaanxi, China · Southeast University, Nanjing, Jiangsu, China
Currently, open-sourced large language models (OSLLMs) have demonstrated remarkable generative performance. However, as their structure and weights are made public, they are exposed to jailbreak attacks even after alignment. Existing attacks operate primarily at shallow levels, such as the prompt or embedding level, and often fail to expose vulnerabilities rooted in deeper model components, which creates a false sense of security for successful defense. In this paper, we propose Safety Attention Head Attack (SAHA), an attention-head-level jailbreak framework that explores the vulnerability in deeper but insufficiently aligned attention heads. SAHA contains two novel designs. Firstly, we reveal that deeper attention layers introduce more vulnerability against jailbreak attacks. Based on this finding, SAHA introduces Ablation-Impact Ranking head selection strategy to effectively locate the most vital layer for unsafe output. Secondly, we introduce a boundary-aware perturbation method, i.e. Layer-Wise Perturbation, to probe the generation of unsafe content with minimal perturbation to the attention. This constrained perturbation guarantees higher semantic relevance with the target intent while ensuring evasion. Extensive experiments show the superiority of our method: SAHA improves ASR by 14% over SOTA baselines, revealing the vulnerability of the attack surface on the attention head. Our code is available at https://anonymous.4open.science/r/SAHA.
Jinman Wu, Yi Xie, Shiqian Zhao +1
Xidian University, Xi’an, China · Tsinghua University, Shenzhen, China · Nanyang Technological University, Singapore
Recent advances in alignment techniques such as Supervised Fine-Tuning (SFT), Reinforcement Learning from Human Feedback (RLHF), and Direct Preference Optimization (DPO) have improved the safety of large language models (LLMs). However, these LLMs remain vulnerable to jailbreak attacks that disguise harmful intent through indirect or deceptive phrasing. Using causal intervention, we empirically demonstrate that this vulnerability stems from shallow alignment mechanisms that lack deep reasoning, often rejecting harmful prompts without truly understanding why they are harmful. To mitigate this vulnerability, we propose enhancing alignment through reasoning-aware post-training. We construct and release a novel Chain-of-Thought (CoT) fine-tuning dataset that includes both utility-oriented and safety-critical prompts with step-by-step rationales. Fine-tuning on this dataset encourages models to produce principled refusals grounded in reasoning, outperforming standard SFT baselines. Furthermore, inspired by failure patterns in CoT fine-tuning, we introduce Alignment-Weighted DPO, which targets the most problematic parts of an output by assigning different preference weights to the reasoning and final-answer segments. This produces finer-grained, targeted updates than vanilla DPO and improves robustness to diverse jailbreak strategies. Extensive experiments across multiple safety and utility benchmarks show that our method consistently improves alignment robustness while maintaining overall model utility.