Large language models remain vulnerable to producing unsafe content under adversarial prompting, yet how safety behavior is implemented inside the network is poorly understood. We identify a three-stage safety circuit — Harmful Detection Heads that flag harmful inputs, Safety Neurons that stabilize the signal in the residual stream, and Refusal Heads that write the refusal — using lightweight, training-free probing on paired prompts. Targeted ablation and activation patching give causal evidence that detection drives refusal, and this decomposition recurs across six architectures and several jailbreak attacks. Building on it, our training-free weight-scaling intervention (CBSE) improves safety under attack by 26.5% while incurring only a 1.7% average accuracy drop on four standard benchmarks.
We identify three types of safety-related components using probing on paired prompts that differ by a single word (e.g., “...make a bomb...” vs. “...make a model...”) — no training or gradient updates required.
Figure 1: Overview of the detection–refusal circuit and circuit-guided intervention. (Left) Paired prompts identify Harmful Detection Heads. (Middle) Paired responses define a refusal direction used to select Refusal Heads and Safety Neurons. (Right) Scaling these components strengthens safety alignment while largely preserving utility.
Ablating detection heads or safety neurons collapses downstream refusal-head activity, while ablating the same number of random components does not — direct evidence that these components, not the network at large, drive refusal.
Figure 2a: Ablating harmful detection heads causes a sharp drop in downstream refusal-head contribution across six architectures; random ablation of the same size (dashed) leaves refusal largely intact.
Figure 2b: Ablating safety neurons produces an even more pronounced collapse in refusal-head contribution, underscoring their mediating role.
Ruling out a shared cause. Removing component A weakens component C — but does A directly cause C, or do both share a common upstream cause? We rule out the latter with activation patching: swapping only the detection heads’ output between paired harmful and neutral runs, holding everything else fixed, moves the refusal heads’ contribution in the same direction on five of six architectures.
| LLaMA3 | LLaMA2 | Mistral | Guanaco | Qwen2.5 | Qwen3 | |
|---|---|---|---|---|---|---|
| Forward (harmful←neutral) | 0.7% | 30.3% | 34.6% | 31.1% | 31.3% | 19.5% |
| Backward (neutral←harmful) | 18.2% | 65.5% | 70.6% | 39.4% | 51.5% | 59.8% |
Table 1: Activation patching on the detection→refusal pathway: fraction of the harmful–neutral gap in refusal-head contribution explained by patching only the detection heads’ output (51 paired prompts each).
CBSE is a training-free, architecture-preserving weight-scaling intervention that reinforces the identified circuit — no gradient updates, no new parameters, no added inference cost.
Using ~50 paired harmful/neutral prompts that differ by a single word, score each attention head by how strongly it redirects attention toward the harmful token, and keep the top heads.
From paired refusing/complying responses, extract a refusal direction. Select the refusal heads whose residual-stream writes align with it and the MLP safety neurons that modulate its strength.
Multiply the output projection \(W_O\) of the top detection and refusal heads, and the down-projection \(W_{\text{down}}\) columns of the top safety neurons, by a scaling factor \(\alpha > 1\) — leaving every other weight untouched.
Figure 3 sweeps the scaling factor for a single component type at a time. Reinforcing any one type already raises safety, but jointly scaling detection heads, refusal heads, and safety neurons together produces the largest and most consistent gains — while a random-component control of the same size shows no comparable improvement.
Figure 3a: Detection Heads
Figure 3b: Refusal Heads
Figure 3c: Safety Neurons
Figure 3: Scaling each component type in isolation consistently improves Llama-Guard safety rates under GCG attacks across all six architectures.
Averaged across six LLMs, CBSE raises the safety rate under attack from 43.2% to 69.7% (+26.5%) while reducing average accuracy on four standard benchmarks by only 1.7%. The largest gains come on the strongest attacks, where the original models are most vulnerable.
CBSE is evaluated across six LLM architectures under Pure Harmful Prompt, GCG, and ADV-LLM attacks (measured with Llama-Guard), and on four standard utility benchmarks.
| Safety Rate (%) ↑ | LLaMA3 | LLaMA2 | Mistral | Guanaco | Qwen2.5 | Qwen3 |
|---|---|---|---|---|---|---|
| Original (Pure / GCG / ADV-LLM) | 100 / 72 / 14 | 100 / 55 / 10 | 99 / 40 / 9 | 64 / 6 / 10 | 100 / 27 / 3 | 100 / 53 / 8 |
| CBSE (Ours) | 91 / 97 / 27 | 100 / 95 / 99 | 100 / 87 / 68 | 88 / 45 / 71 | 100 / 89 / 43 | 100 / 100 / 29 |
Table 2: Safety rates (%) under Pure Harmful Prompt / GCG / ADV-LLM attacks, jointly reinforcing detection heads, refusal heads, and safety neurons.
| Accuracy (%) ↑ | LLaMA3 | LLaMA2 | Mistral | Guanaco | Qwen2.5 | Qwen3 |
|---|---|---|---|---|---|---|
| Original — MMLU / HellaSwag / PIQA / WinoGrande | 66.6 / 58.7 / 80.9 / 76.2 | 47.6 / 58.0 / 76.3 / 72.5 | 59.1 / 66.9 / 82.2 / 78.7 | 33.8 / 59.5 / 79.0 / 72.9 | 74.0 / 62.5 / 79.2 / 74.9 | 72.6 / 52.6 / 77.9 / 66.5 |
| CBSE — MMLU / HellaSwag / PIQA / WinoGrande | 63.1 / 58.2 / 79.7 / 75.6 | 43.9 / 56.6 / 75.1 / 67.6 | 55.8 / 66.1 / 80.5 / 76.6 | 33.7 / 58.8 / 78.3 / 73.5 | 71.3 / 61.9 / 71.6 / 69.5 | 69.2 / 51.6 / 76.3 / 66.1 |
Table 3: Utility on four standard benchmarks. Across all six architectures, CBSE incurs only a 1.7% average accuracy drop.
Kuan-Lin Chu, Chung-En Sun, and Tsui-Wei (Lily) Weng. “From Detection to Refusal: Safer LLMs via Circuit-Guided Weight Scaling.” Findings of EMNLP, 2026.
@inproceedings{cbse,
title={From Detection to Refusal: Safer LLMs via Circuit-Guided Weight Scaling},
author={Kuan-Lin Chu and Chung-En Sun and Tsui-Wei Weng},
booktitle={Findings of the Association for Computational Linguistics: EMNLP 2026},
year={2026}
}