Jailbreaking the Matrix: Nullspace Steering for Controlled Model Subversion
Authors: Vishal Pramanik, Maisha Maliha, Susmit Jha, Sumit Kumar Jha
Organizations: Department of Computer & Information Science & Engineering, University of Florida, Gainesville, FL 32611, USA · School of Computer Science, University of Oklahoma, Norman, OK 73019, USA · Computer Science Laboratory, SRI International, Menlo Park, CA 94025, USA
Large language models remain vulnerable to jailbreak attacks -- inputs designed to bypass safety mechanisms and elicit harmful responses -- despite advances in alignment and instruction tuning. We propose Head-Masked Nullspace Steering (HMNS), a circuit-level intervention that (i) identifies attention heads most causally responsible for a model's default behavior, (ii) suppresses their write paths via targeted column masking, and (iii) injects a perturbation constrained to the orthogonal complement of the muted subspace. HMNS operates in a closed-loop detection-intervention cycle, re-identifying causal heads and reapplying interventions across multiple decoding attempts. Across multiple jailbreak benchmarks, strong safety defenses, and widely used language models, HMNS attains state-of-the-art attack success rates with fewer queries than prior methods. Ablations confirm that nullspace-constrained injection, residual norm scaling, and iterative re-identification are key to its effectiveness. To our knowledge, this is the first jailbreak method to leverage geometry-aware, interpretability-informed interventions, highlighting a new paradigm for controlled model steering and adversarial safety circumvention.
Figures & tables
Figure 1: HMNS successfully jailbreaks LLaMA 3.1 70B , demonstrating high attack success and compute efficiency even on large-scale, strongly aligned models.
Figure 2: Overview of HMNS procedure. Each step in the closed-loop intervention pipeline is shown: attribution identifies influential heads; masking suppresses them; nullspace steering computes an orthogonal direction; and a scaled perturbation is injected into the residual stream. If unsuccessful, the process repeats with updated attribution.
Model / Method
AdvBench
HarmBench
JBB-Behaviors
StrongReject
ASR ↑
ACQ ↓
ASR ↑
ACQ ↓
ASR ↑
ACQ ↓
ASR ↑
ACQ ↓
LLaMA-2-7B-Chat
Foot-In-The-Door (FITD)
44.00 / 38.00
16.20
41.30 / 36.10
16.80
45.10 / 39.20
15.90
38.70 / 33.40
17.10
AutoDAN
72.60 / 66.20
12.80
69.10 / 63.20
13.10
73.40 / 67.50
12.50
66.20 / 60.40
13.60
ArrAttack
92.00 / 87.00
7.50
90.00 / 86.00
7.90
93.00 / 88.00
7.30
88.00 / 89.09
8.00
Many-shot JB (MSJ)
64.80 / 58.90
10.90
62.20 / 56.70
11.40
66.00 / 60.10
10.60
58.30 / 53.10
11.80
Table 1: Jailbreak effectiveness across evaluation benchmarks. We report Attack Success Rate (ASR, %; left/right = GPT4o/GPT-5) and Average Query Count (ACQ; lower is better) on four datasets—AdvBench, HarmBench, JBB-Behaviors, and StrongReject. Results are grouped by target LLM and averaged over three independent runs; best values are bolded and second-best are underlined . Our method (HMNS) achieves the strongest performance across all models and datasets, exceeding the next-best ASR by at least 5–6 percentage points while also attaining the lowest ACQ ( ≈2 ). The standard deviation across three independent runs is <0.4 for all reported entries.
Variant
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
HMNS (Full)
96.8 / 92.1
2.1
32
0.58
6.8
Remove masking (Projection-only)
89.5 / 84.0
2.4
30
0.61
7.1
Remove projection (Mask-only)
87.9 / 82.2
2.3
29
0.55
6.3
Inject direct dir. (Direct– ϕ , no nullspace)
88.7 / 83.1
2.5
32
0.63
7.2
No re-identification (freeze top– K at t=1 )
90.2 / 85.0
2.7
24
0.60
7.0
Random– K head selection
81.4 / 76.0
2.2
32
0.56
6.7
Table 2: Ablation results on Phi–3 Medium 14B (AdvBench) . Each row disables one component of HMNS to measure its contribution. Metrics: ASR (GPT4o / GPT-5), ACQ (external queries), IPC (internal passes), FPS (FLOPs per success; ×1012 ), and LPS (latency in seconds).
Method
IPC ↓
FPS (×10 12 ) ↓
LPS (s) ↓
AutoDAN
0
0.44
5.2
ArrAttack
0
0.62
6.7
Many-shot JB
0
0.91
8.0
PrisonBreak
0
0.98
8.9
HMNS (Ours)
32
0.53
6.1
Table 3: Compute cost comparison on LLaMA-3.1-70B (AdvBench) . Each value reports mean compute per successful attack. IPC counts internal passes only; FPS includes all internal and decoding FLOPs; LPS is wall-clock latency.
Attack / Defense
SMO
DPP
RPO
PAR
PAT
SAF
Avg
LLaMA-2-7B-Chat (AdvBench)
FITD
10.0 / 7.0
12.0 / 9.0
20.0 / 14.0
14.0 / 10.0
12.0 / 8.0
11.0 / 7.0
13.2 / 9.2
AutoDAN
15.0 / 11.0
24.0 / 18.0
38.0 / 28.0
28.0 / 20.0
22.0 / 16.0
18.0 / 12.0
24.2 / 17.5
ArrAttack
34.0 / 22.0
48.0 / 36.0
74.0 / 55.0
58.0 / 41.0
42.0 / 30.0
40.0 / 29.0
49.3 / 35.5
Tempest
26.0 / 19.0
42.0 / 31.0
68.0 / 50.0
52.0 / 38.0
36.0 / 25.0
33.0 / 24.0
42.8 / 31.2
HMNS (Ours)
40.0 / 25.0
54.0 / 41.0
82.0 / 61.0
64.0 / 45.0
48.0 / 33.0
47.0 / 34.0
55.8 / 39.8
Table 4: Effectiveness of jailbreak methods under defense across three models. We report Attack Success Rate (ASR, %) under six defenses (SMO, DPP, RPO, PAR, PAT, SAF) on LLaMA-2-7B-Chat , Phi-3 Medium 14B Instruct , and LLaMA-3.1-70B . Values are GPT4o / GPT-5 evaluations. Best results are bolded , second best are underlined .
Figure 3: Ablation studies on Phi-3 Medium 14B (AdvBench). (a) Attribution mechanisms: KL-divergence achieves the best ASR–compute tradeoff; removing proxy pre-selection preserves ASR but nearly triples IPC. (b) Nullspace and injection design: strict orthogonality and hard masking are critical; partial masking ( γ=0.5 ) degrades ASR and raises ACQ. Bars show ASR (%, GPT-4o/GPT-5); overlaid lines show FPS ( ×1012 ) in (a) and ACQ in (b).
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
Model / Method
AdvBench
HarmBench
JBB-Behaviors
StrongReject
ASR ↑
ACQ ↓
ASR ↑
ACQ ↓
ASR ↑
ACQ ↓
ASR ↑
ACQ ↓
Mistral-7B-Instruct-v0.2
FITD
42.0 / 36.5
16.4
39.5 / 34.1
16.9
43.2 / 37.6
15.8
36.8 / 31.7
17.2
AutoDAN
70.8 / 64.6
12.7
67.2 / 61.3
13.1
71.6 / 65.5
12.2
64.9 / 59.4
13.5
ArrAttack
91.1 / 86.2
7.6
89.2 / 84.7
7.8
92.4 / 87.5
7.4
87.1 / 82.9
8.1
HMNS (Ours)
97.4 / 92.5
2.0
95.3 / 90.7
2.1
98.2 / 93.1
1.9
93.0 / 88.4
2.2
Appendix
Table 5: Jailbreak effectiveness on alternative open-weight models. We report Attack Success Rate (ASR, %; left/right = GPT4o/GPT-5) and Average Query Count (ACQ; lower is better) on AdvBench, HarmBench, JBB-Behaviors, and StrongReject. Best values are bolded ; second best are underlined .
FPS(x)←∑j=1J(x)Cint(x,j)+∑i=1Q(x)Cdec(x,i)
Appendix
Algorithm 1 Compute-Matched Evaluation for HMNS and Baselines (Per Input x )
AdvBench
HarmBench
JBB-Behaviors
StrongReject
κ
0.78±0.03
0.74±0.04
0.75±0.03
0.70±0.04
Appendix
Table 6: Inter-rater agreement (test split). Cohen’s κ between GPT4o and GPT-5 by benchmark; mean ± 95% CI over three runs.
Method
Fluency ↑
Toxicity (score) ↓
Toxicity (rate) ↓
FITD
0.58±0.02
0.22±0.01
18.1%±1.6
AutoDAN
0.61±0.02
0.28±0.01
24.9%±1.7
ArrAttack
0.63±0.02
0.31±0.01
28.7%±1.8
Tempest
0.64±0.02
0.29±0.01
26.5%±1.7
HMNS (ours)
0.66±0.02
0.33±0.01
30.9%±1.9
Appendix
Table 7: Fluency and toxicity by method (pooled across models and benchmarks; means ± 95% CI over three runs). Toxicity: continuous Detoxify score ↓ and binarized rate at τ⋆=0.42 (ROC–AUC =0.94 ).
Method
Metric
SMO
DPP
RPO
PAR
PAT
SAF
ArrAttack
FPS (×10 12 )
1.12
1.35
1.88
1.47
1.21
1.19
LPS (s)
10.2
11.4
14.8
12.5
10.7
10.6
ACQ
26.8
32.0
44.5
36.7
29.2
28.9
HMNS (Ours)
FPS (×10 12 )
0.74
0.85
1.09
0.89
0.76
0.78
LPS (s)
7.1
7.8
9.5
8.3
7.0
7.3
ACQ
2.1
2.1
2.2
2.2
2.1
2.3
Appendix
Table 8: Compute under defenses on LLaMA-2-7B-Chat (AdvBench) . Means over successful runs. HMNS attains lower or comparable FLOPs/latency than prompt-only baselines despite higher internal passes; ACQ reflects external-query efficiency only.
Figure 4: ASR vs. FLOPs under defenses on LLaMA-2-7B-Chat (AdvBench). Curves average over 3 seeds and 196 test prompts. HMNS maintains higher ASR at a given FLOP budget than prompt-only baselines, especially under RPO and PAT.
Variant (14B / AdvBench)
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
HMNS (Full)
96.8 / 92.1
2.1
32
0.58
6.8
Remove masking (Projection-only)
89.5 / 84.0
2.4
30
0.61
7.1
Remove projection (Mask-only)
87.9 / 82.2
2.3
29
0.55
6.3
Inject direct function dir. (Direct– ϕ , no nullspace)
88.7 / 83.1
2.5
32
0.63
7.2
No re–identification (freeze top– K from t=1 )
90.2 / 85.0
2.7
24
0.60
7.0
Random– K head selection
81.4 / 76.0
2.2
32
0.56
6.7
Appendix
Table 9: Ablation on Phi–3 Medium 14B (AdvBench) . Metrics: ASR (%; left/right = GPT4o/GPT-5), ACQ (external queries), IPC (internal passes; FEPs without KV cache), FPS ( ×1012 FLOPs per success; internal + decoding), LPS (seconds; A100–80GB, bf16 ). HMNS (Full) combines KL attribution, masking, and nullspace steering at the final position with closed-loop re-identification.
Attribution Variant
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
KL-div (global- K , proxy+exact, batched)
96.8 / 92.1
2.1
32
0.58
6.8
Target-logit drop
91.0 / 85.9
2.4
26
0.54
6.3
Confidence drop (max-logit change)
89.2 / 84.3
2.6
24
0.51
6.1
Entropy change
88.5 / 83.2
2.7
23
0.49
6.0
Exact-only (no proxy preselection)
96.7 / 92.0
2.1
78
0.84
9.7
Serial masking (vs batched)
96.7 / 92.0
2.1
32
0.71
8.5
Appendix
Table 10: Attribution ablation on Phi–3 Medium 14B (AdvBench) . Each variant modifies the head scoring or selection method. Metrics: ASR (%; GPT4o/GPT-5), ACQ (queries), IPC (internal passes), FPS ( ×1012 ), and LPS (s). Full KL scoring with proxy preselection and global top- K (first row) yields the best overall tradeoff.
Table 11: Nullspace / Injection ablation on Phi-3 Medium 14B (AdvBench), vertical layout. Each row shows metric–value pairs to fit a single-column width. ASR is % (left/right = GPT4o/GPT-5); FPS in ×1012 ; LPS in seconds on A100-80GB, bf16 .
Category
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
Reference
HMNS (Full)
96.8 / 92.1
2.1
32
0.58
6.8
Top- K
K=4
92.4 / 87.7
2.3
24
0.50
6.2
Top- K
K=6
95.0 / 90.3
2.2
28
0.55
6.6
Top- K
K=8
96.2 / 91.5
2.1
30
0.57
6.7
Top- K
K=10
96.8 / 92.1
2.1
32
0.58
6.8
Top- K
K=12
96.9 / 92.0
2.2
36
0.62
7.1
Appendix
Table 12: Hyperparameter ablation on Phi–3 Medium 14B (AdvBench) . Each row modifies one factor relative to the HMNS reference.
Category
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
Reference
bf16 + TF32 on
96.8 / 92.1
2.1
32
0.58
6.8
Model dtype
fp16 (no loss-scaling)
95.9 / 91.0
2.2
32
0.58
6.7
Model dtype
fp16 (+ static loss-scaling)
96.5 / 91.8
2.2
32
0.58
6.8
Model dtype
fp32
96.9 / 92.3
2.1
32
0.62
7.5
TF32 matmul
off (bf16)
96.7 / 92.0
2.1
32
0.60
7.1
Quantization
INT8/AWQ (act-side mask)
96.2 / 91.5
2.1
32
0.57
6.7
Appendix
Table 13: Numerical / precision ablation on Phi–3 Medium 14B (AdvBench) .
Category
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
Reference
Adaptive (multi-layer), final-only
96.8 / 92.1
2.1
32
0.58
6.8
Layer policy
Early-only layers
90.7 / 85.5
2.3
28
0.54
6.5
Layer policy
Mid-only layers
94.8 / 90.1
2.2
30
0.56
6.7
Layer policy
Late-only layers
96.1 / 91.5
2.1
31
0.57
6.7
Layer policy
Adaptive (top- K global)
96.8 / 92.1
2.1
32
0.58
6.8
Token position
final + (T − 1)
97.0 / 92.3
2.1
33
0.60
7.1
Appendix
Table 14: Layer/position policy ablation on Phi–3 Medium 14B (AdvBench) .
Category
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
Reference
Chat template: on
96.8 / 92.1
2.1
32
0.58
6.8
Chat template
off (raw prompt)
94.2 / 89.6
2.3
32
0.58
6.9
Tokenizer
space-prefix on
96.6 / 91.9
2.1
32
0.58
6.8
Tokenizer
strict BOS/EOS
96.8 / 92.2
2.1
32
0.58
6.7
Appendix
Table 15: Model/format sensitivity on Phi–3 Medium 14B (AdvBench) .
Defense
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
None
baseline
96.8 / 92.1
2.1
32
0.58
6.8
Single
SMO
95.6 / 90.8
2.1
33
0.59
6.9
Single
DPP
95.2 / 90.2
2.2
33
0.60
7.0
Single
RPO
93.8 / 88.7
2.2
34
0.62
7.2
Single
PAR
95.0 / 90.0
2.2
33
0.60
7.0
Single
PAT
94.0 / 89.0
2.2
34
0.62
7.2
Appendix
Table 16: Defended performance for HMNS on Phi–3 Medium 14B (AdvBench) .
Category
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
Regime
FLOP-matched
96.8 / 92.1
2.1
32
0.58
6.8
Regime
Latency-matched
96.7 / 92.0
2.1
32
0.59
6.8
Regime
ACQ-matched
96.8 / 92.1
2.1
32
0.58
6.8
Appendix
Table 17: Compute-fairness regimes (metrics shown are HMNS’s).
Category
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
Seeds
3
96.8 / 92.1
2.1
32
0.58
6.8
Seeds
5
96.8 / 92.1
2.1
32
0.58
6.8
Seeds
10
96.9 / 92.1
2.1
32
0.58
6.8
Grader
GPT4o (det.)
96.8 / —
2.1
32
0.58
6.8
Grader
GPT-5 (det.)
— / 92.1
2.1
32
0.58
6.8
Fluency LM
LLaMA-2-7B (base)
(fluency baseline)
—
—
—
—
Appendix
Table 18: Evaluation sensitivity on Phi–3 Medium 14B (AdvBench) .
Category
Setting
ASR (Fuzz/G4) ↑
ACQ ↓
IPC ↓
FPS ↓
LPS (s) ↓
Reference
HMNS (Full)
96.8 / 92.1
2.1
32
0.58
6.8
Shuffle heads
Permute head IDs (same K )
84.3 / 79.1
2.3
32
0.59
6.9
Random inject
Random unit vec. (no projection)
82.7 / 77.4
2.3
32
0.59
6.9
Random mask
Mask random slices (size-matched)
83.5 / 78.0
2.2
32
0.58
6.8
Appendix
Table 19: Sanity / control variants on Phi–3 Medium 14B (AdvBench) .
Iteration pair (t,t′)
ρ (all heads)
Top- K overlap (%)
(1,2)
0.78
81
(2,3)
0.74
78
(3,4)
0.71
75
(1,4)
0.63
68
Appendix
Table 20: Head-importance stability across HMNS iterations (Phi-3-Medium-14B, AdvBench dev). ρ = Spearman correlation over all heads; “Top- K overlap” = percentage of heads common to both global top-10 sets.
Failure mode
Share
Example behavior (paraphrased)
Distributed safety
≈55%
Compare several synthesis routes for an illegal drug and pick the easiest at home.
Defense re-framing / deflection
≈30%
Slightly edit a political article to favor an extremist group (often turned into high-level/meta discussion).
Other / model-specific
≈15%
Long, multi-step prompts mixing several harms where Tatt=10 is sometimes insufficient.
Appendix
Table 21: HMNS failure modes on AdvBench/HarmBench dev (avg. over Φ -3-14B / LLaMA-3.1-70B).
Method
MHJ on Φ -3-Medium-14B
MHJ on LLaMA-3.1-70B
ASR (%) ↑
ACQ ↓
ASR (%) ↑
ACQ ↓
Defense-only
4.8
—
3.2
—
AutoDAN
61.7
12.3
66.0
11.8
ArrAttack
81.0
7.5
85.3
7.2
Tempest
76.2
9.4
81.1
9.1
HMNS (Ours)
91.6
2.1
95.2
2.0
Appendix
Table 22: MHJ multi-turn evaluation (GPT-4o-graded). ASR = attack success rate (higher is better, ↑ ); ACQ = average query count (lower is better, ↓ ).
Attack
ASR (%) GPT-4o ↑
ASR (%) GPT-5 ↑
ArrAttack
31.2
23.5
Tempest
27.8
21.0
HMNS
39.6
29.7
Appendix
Table 23: ASR under a Self-Defense–style output filter on Φ -3-Medium-14B (AdvBench dev). ASR = attack success rate (higher is better, ↑ ), evaluated with GPT-4o and GPT-5.
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
As vision-language models (VLMs) are increasingly deployed in open-world scenarios, they can be easily induced by visual jailbreak attacks to generate harmful content, posing serious risks to model safety and trustworthy usage. Recent activation steering methods inject directional vectors into model activations during inference to induce refusal behaviors and have demonstrated effectiveness. However, a steering vector may both enhance refusal ability and cause over-refusal, thereby degrading model performance on benign inputs. Moreover, due to the lack of theoretical interpretability, these methods still suffer from limited robustness and effectiveness. To better balance safety and utility, we propose NullSteer, a null-space projected activation defense framework. Our method constructs refusal directions within model activations through a linear transformation: it maintains zero perturbation within the benign subspace while dynamically inducing refusal along potentially harmful directions, thereby theoretically achieving safety enhancement without impairing the model's general capabilities. Extensive experiments show that NullSteer significantly reduces harmful outputs under various jailbreak attacks (average ASR reduction over 15 percent on MiniGPT-4) while maintaining comparable performance to the original model on general benchmarks.
Xingyu Zhu, Beier Zhu, Shuo Wang +4
MoE Key Lab of BIPC, University of Science and Technology of China · National University of Singapore · Nanyang Technological University
Jailbreak attacks bypass LLM safety alignment, yet their mechanisms remain poorly understood. We provide evidence that attacks do not comprehensively eliminate safety features, but instead selectively suppress specific attention heads. We identify two functionally differentiated types: Adversarially Compromised Heads (ACHs) concentrated in early layers, which are suppressed under attacks, and Safety-Aligned Heads (SAHs) in mid-layers, which maintain robust activations even when attacks succeed. Ablation studies support the causal role of ACHs and the contribution of SAHs to robust activations: suppressing a small number of ACHs is sufficient to induce jailbreak-like behavior on normally refused inputs, while removing SAHs substantially weakens mid-layer safety activations. Token-level attribution further shows that ACH suppression is driven specifically by attack-template tokens, providing a mechanistic account of why attacks can bypass refusal decisions through ACH suppression while leaving internal safety signals sustained by SAHs -- a phenomenon we term Robust Harmful Features. To validate the practical significance of this robustness, we show that simply reading these persistent activations -- without any training -- yields competitive aggregate detection performance with strong adversarial robustness.
Yanchen Yin, Dongqi Han, Linghui Li
Beijing University of Posts and Telecommunications, Beijing, China.