Locating and Steering Refusal Beyond Attention
Organizations: Department of Computer Science and Engineering, Indian Institute of Technology Madras
Abstract
Where inside a language model does refusal live, and does that place change when the architecture does? In a transformer, refusal is governed by a single direction in the residual stream, a finding that safety and interpretability tooling now depend on. State-space models (SSMs) route information through a recurrent update instead of attention, sharing no token-mixing mechanism with a transformer. Does the same safety representation survive this shift, or must it be rediscovered per architecture? It survives. A single rigid rotation, which can only reorient a space and not reshape it, aligns one model's representation space with another's, so the two genuinely share the representation. A harm probe trained on a transformer then flags an SSM's harmful inputs, and removing the aligned direction makes a model answer attacks it would otherwise refuse, while a random direction of the same size does far less. What is architecture-specific is not where the direction is steered but where it must be read. Each layer computes a fresh output that is then added into the residual stream, and harm is cleanly readable at this output, the write site, before the addition. A control that holds the intervention's strength fixed shows that what matters is where the direction is estimated, not where it is applied. Applied through a detector-triggered gate, this direction lowers jailbreak success in all four architecture families we test (SSM, transformer, recurrent, hybrid), and on the SSM it holds against an attacker that tunes its prompt against the defense. The gate only matches a trivial rule that returns a fixed refusal whenever the same detector fires, so what transfers across architectures is the direction itself, not defense strength. Safety tooling built on refusal therefore ports to a new architecture by re-estimating the direction at that architecture's write site, not by rebuilding it.
Figures & tables
| Models | Corpora | Attacks | Judges & metrics | Baselines |
| Falcon-Mamba-7B (SSM anchor) Falcon3-Mamba-7B (2nd SSM) Llama-3.1-8B, Mistral-7B, Qwen2.5-7B (transformers) RWKV-6-World-7B (recurrent) Zamba2-7B (hybrid) | AdvBench (harm) Alpaca (benign) XSTest (surface control, over-refusal) | Prefix injection (fluent) Persona roleplay (DAN, fluent) Fictional framing (fluent) Dilution (adaptive) Optimized adversarial suffix (GCG; on the SSM both a gradient-free variant and GCG through the differentiable scan) | Llama-Guard-3-8B (primary) +Llama-3.1-8B-Instruct, Mistral-7B-Instruct, ShieldGemma-9B MMLU, TruthfulQA (capability) Probe AUROC (decodability) | Residual-subspace projection CAST Perplexity filter SmoothLLM Cross-architecture linear-map transfer |
| Selective-scan component | AUROC (surface-controlled) |
|---|---|
| (step size) | 0.95 |
| (input selection) | 0.79 |
| (readout selection) | 0.78 |
| mixer output | 0.99 |
| Source target | Mean own | Mean transp. | Pearson [95% CI] | Folds null (shuffled-category control) |
|---|---|---|---|---|
| Llama-3.1-8B Falcon-Mamba | 0.95 | 0.95 | 0.99 [0.95, 1.00] | 8/8 |
| Mistral-7B Falcon-Mamba | 0.95 | 0.95 | 0.99 [0.97, 1.00] | 8/8 |
| Target (site) | Source | Base | Removed | Random |
|---|---|---|---|---|
| Falcon-Mamba (block out) | Llama | 10.5% | 44.0% | 9.0% |
| Falcon-Mamba (block out) | Mistral | 10.5% | 45.0% | 9.5% |
| RWKV-6 (time-mix out) | Llama | 3.0% | 54.7% | 32.3% |
| Zamba2 (Mamba out) | Llama | 8.9% | 93.3% | 22.8% |
| Zamba2 (attn. out) | Llama | 8.9% | 16.7% | 8.9% |
| Pair / direction | Base | Native | Transferred | Random |
|---|---|---|---|---|
| Llama Mamba | 10.5% | 41.5% | 36.5% | 9.0% |
| Mamba Llama | 2.5% | 50.5% | 79.0% | 8.0% |
| Mistral Mamba | 10.5% | 41.5% | 36.5% | 9.5% |
| Mamba Mistral | 26.5% | 50.0% | 60.0% | 27.0% |
| Llama Mamba3 | 0.0% | 42.0% | 25.5% | 0.0% |
| Mamba3 Llama | 2.5% | 51.5% | 55.5% | 2.5% |
| Architecture | Exemplar | Write site | Base gated | over-ref. |
|---|---|---|---|---|
| Selective-scan SSM | Falcon-Mamba | block output | 98.0% 5.0% | pt |
| Transformer | Mistral-7B | attn. output | 98.0% 14.0% | pt |
| Transformer | Llama-3.1-8B | attn. output | 25.0% 0.0% | pt |
| Token-shift rec. | RWKV-6 | time-mix output | 47.5% 27.5% | pt |
| Hybrid (attn. site) | Zamba2-7B | attn. output | 31.7% 0.0% | pt † |
| Hybrid (Mamba site) | Zamba2-7B | Mamba output | 31.7% 5.0% | pt ‡ |
| Push site | Direction est. at | Falcon-Mamba | Mistral-7B |
|---|---|---|---|
| write site | write site | 6.0% [2.8%, 12.5%] | 15.0% [9.3%, 23.3%] |
| residual | write site | 6.0% [2.8%, 12.5%] | 23.0% [15.8%, 32.2%] |
| residual | residual | 100.0% | 48.0% |
| Attack | Base ASR | Gated ASR, Llama-Guard (95% CI) | Gated ASR, ShieldGemma |
|---|---|---|---|
| Prefix injection | 98.0% | 5.0% [2.7, 9.0] | 2.0% |
| Persona roleplay | 81.5% | 30.0% [24.1, 36.7] | 23.0% |
| Fictional framing | 87.0% | 16.5% [12.0, 22.3] | 10.0% |
| Defense | Prefix | Roleplay | Fiction | Over-ref. |
|---|---|---|---|---|
| None | 98.0% | 81.5% | 87.0% | 12.0% |
| Residual projection | 95.0% | 87.5% | 94.5% | 9.0% |
| CAST (residual loop) | 100.0% | 100.0% | 100.0% | 12.0% |
| Perplexity filter | 98.0% | 81.5% | 87.0% | 19.0% |
| SmoothLLM | 62.0% | 72.0% | 86.5% | 29.0% |
| Open-loop block output (no detector) | 5.0% | 30.0% | 16.5% | 86.0% |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Attack success | Over-refusal (XSTest) | Over-refusal (OR-Bench) |
|---|---|---|---|
| Undefended base | 100% | 2.0% | 32.5% |
| Detect-then-refuse | 0% | 2.0% | 47.5% |
| Write-site gate ( ) | 0% | 2.0% | 46.3% |
| Model | Persona–refusal cosine |
|---|---|
| Falcon-Mamba-7B (selective-scan SSM) | -0.30 |
| Falcon3-Mamba-7B (selective-scan SSM) | -0.30 |
| RWKV-6 (token-shift recurrent) | -0.49 |
| Llama-3.1-8B (transformer, residual) | +0.65 |
| Mistral-7B (transformer, residual) | +0.74 |
| Intervention on the roleplay attack | Attack success |
|---|---|
| Base (no gate) | 81.5% |
| Amplify refusal only | 38.0% |
| Suppress persona only | 79.5% |
| Both (amplify refusal, suppress persona) | 17.5% |
| Model | Attack | Residual | Write site |
|---|---|---|---|
| Mistral-7B | roleplay | +0.74 | -0.11 |
| Mistral-7B | combo_strong | +0.76 | -0.02 |
| Llama-3.1-8B | roleplay | +0.52 | +0.08 |
| Llama-3.1-8B | combo_strong | +0.55 | +0.17 |
| Intervention at the write site | Llama-Guard | Gemma |
|---|---|---|
| none (base) | 97.0% | 79.0% |
| amplify refusal only | 77.0% | – |
| ablate persona only | 96.0% | – |
| both (refusal and persona ablation) | 5.0% | 0.0% |
| Site | Norm | rel | Refusal ASR | Random ASR |
|---|---|---|---|---|
| Block output (residual) | 519 | 4 | 47.5% | 47.5% |
| Time-mix output | 27 | 0.25 | 17.5% | 82.5% |
| Channel-mix output | 54 | 0.25 | 7.5% | 15.0% |
| Model | Direction | Base ASR | rel | ASR | Coherent |
|---|---|---|---|---|---|
| Mistral-7B | residual | 1.000 | 0.02 | 1.000 | 1.000 |
| Mistral-7B | residual | 1.000 | 0.05 | 1.000 | 1.000 |
| Mistral-7B | residual | 1.000 | 0.1 | 0.925 | 1.000 |
| Mistral-7B | residual | 1.000 | 0.15 | 0.675 | 0.875 |
| Mistral-7B | residual | 1.000 | 0.2 | 1.000 | 0.025 |
| Mistral-7B | residual | 1.000 | 0.25 | 1.000 | 0.000 |
| Model | Site | Norm | rel | Base gated ASR | Coherent |
|---|---|---|---|---|---|
| Mistral-7B | Attention | 0.79 | 1 | 100.0% 85.0% | 100.0% |
| Mistral-7B | MLP | 1.33 | 0.5 | 100.0% 0.0% | 100.0% |
| Llama-3.1-8B | Attention | 0.78 | 0.5 | 27.5% 0.0% | 100.0% |
| Llama-3.1-8B | MLP | 1.69 | 0.25 | 27.5% 2.5% | 100.0% |
| rel | ASR | Over-refusal | Coherent |
|---|---|---|---|
| 0.25 | 100.0% | 20.0% | 100.0% |
| 0.5 | 92.5% | 13.3% | 100.0% |
| 1.0 | 77.5% | 20.0% | 100.0% |
| 1.25 | 65.0% | 33.3% | 100.0% |
| 1.5 | 57.5% | 36.7% | 100.0% |
| 1.75 | 32.5% | 46.7% | 98.6% |
| rel | ASR | Over-refusal | Coherent |
|---|---|---|---|
| 0.25 | 87.5% | 46.7% | 100.0% |
| 0.5 | 57.5% | 100.0% | 100.0% |
| 1.0 | 100.0% | 0.0% | 51.4% |
| 2.0 | 100.0% | 0.0% | 87.1% |
| 4.0 | 100.0% | 0.0% | 0.0% |
| Gain | Transported ASR | Transported coh. | Random ASR | Random coh. |
|---|---|---|---|---|
| 1 | 13.3% | 100.0% | 13.3% | 100.0% |
| 2 | 11.7% | 100.0% | 15.0% | 100.0% |
| 4 | 20.0% | 100.0% | 13.3% | 100.0% |
| 8 | 60.0% | 100.0% | 5.0% | 100.0% |
| 12 | 91.7% | 88.3% | 25.0% | 100.0% |
| 16 | 100.0% | 68.3% | 85.0% | 41.7% |
| Attack | Base ASR | Gated ASR | Over-ref. (ours) | Over-ref. (DeTAM) |
|---|---|---|---|---|
| Llama-3.1-8B | ||||
| Prefix injection | 28.0% | 2.0% | 10.0% | 87.0% |
| Persona roleplay | 0.5% | 0.0% | 10.0% | 87.0% |
| Fictional framing | 19.5% | 1.0% | 10.0% | 87.0% |
| Mistral-7B | ||||
| Prefix injection | 96.0% | 15.0% | 11.0% | 69.0% |
| Gated ASR | Harm coh. | Benign coh. | DeTAM benign | |
| Llama-3.1-8B , base ASR 26.0% | ||||
| 0.5 | 7.0% | 100.0% | 100.0% | 100.0% |
| 1.0 | 2.0% | 100.0% | 100.0% | 100.0% |
| 1.5 | 1.0% | 100.0% | 100.0% | 100.0% |
| 2.0 | 1.0% | 100.0% | 100.0% | 100.0% |
| 3.0 | 3.0% | 80.0% | 100.0% | 100.0% |
| Gain | Prefix injection | Persona roleplay |
|---|---|---|
| base (no gate) | 98.0% / 99.5% | 82.5% / 100.0% |
| 1 | 99.0% / 99.0% | 89.5% / 99.5% |
| 2 | 98.0% / 99.5% | 91.5% / 98.5% |
| 4 (deployed at 64) | 17.5% / 10.5% | 55.0% / 23.5% |
| 6 | 48.5% / 0.0% | 60.5% / 0.0% |
| Action on the refusal direction | Base | After |
|---|---|---|
| Amplify at block output (ours), under attack | 98.0% | 5.0% |
| Project out of residual, under attack | 98.0% | 95.0% |
| Remove direction, plain harm | 10.5% | 41.5% |
| labels | Transport | From scratch | Paired | Wins |
|---|---|---|---|---|
| 4 | 0.78 | 0.75 | +0.032 [+0.008, +0.057] | 64% |
| 8 | 0.83 | 0.79 | +0.042 [+0.011, +0.073] | 68% |
| 16 | 0.87 | 0.83 | +0.038 [+0.019, +0.058] | 78% |
| 32 | 0.90 | 0.85 | +0.040 [+0.006, +0.073] | 72% |
| 64 | 0.92 | 0.87 | +0.046 [+0.013, +0.080] | 78% |
| Model | Write site | Gate layers (decision) | final (tried) | Transfer: read / write layers | Notes |
| Falcon-Mamba-7B-Inst. | mixer output | {24,28,30,34,35,36,37,44} (35) | 4 (1,2,4,6,8; capability at 4,8,16) | 44 / {22,24,28,31,38,40,42,43} | anchor; -ranked set for transfer targets |
| Falcon3-Mamba-7B-Inst. | mixer output | -ranked {24,27,28,31,42,45,46,47} (42) | 4 (0.5,1,2,4; Fig. 6 ) | 47 / same set | block-vs-residual control on this set at ; the output-ranked set {14,15,17,18,21,22,23,24} over-steers at (reported at ) |
| Llama-3.1-8B-Inst. | attention output | {10,12,…,24} (18) | 2 (0.5,1,1.5,2,3,4) | 14 / {12,14,16,18,20} | hardened trigger at the deployed point |
| Mistral-7B-Inst.-v0.2 | attention output | {10,12,…,24} (18) | 2 (0.5,1,1.5,2,3,4) | 14 / {12,14,16,18,20} | persona fix: layer 18, , |
| RWKV-6-World-7B | time-mix output | {14,16,…,24} (20) | 16 (0,4,8,16,24,32,48; coh. ) | 20 (target of Llama L14) | defense run gating the block hook at is a separate operating point; the block boundary (residual) is inert |
| Zamba2-7B-Inst. | attention out. / Mamba out. | {36,42,48,54,60} (48) / {20,24,28,32} (28) | 8 / 16 (persona grid , ) | – | hybrid, both write sites gated |