arXiv(opens in a new tab)cs.CLAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.00051

From Detection to Refusal: Safer LLMs via Circuit-Guided Weight Scaling

Kuan-Lin Chu, Chung-En Sun, Tsui-Wei Weng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Despite extensive alignment efforts, Large Language Models (LLMs) remain vulnerable to generating unsafe content under adversarial prompting, yet the internal mechanisms by which safety behaviors are implemented remain poorly understood. We study LLM safety from a mechanistic interpretability perspective and characterize a multi-stage safety circuit that organizes refusal behavior, consisting of (i) Harmful Detection Heads that respond to harmful inputs, (ii) Safety Neurons that mediate and stabilize safety signals in the residual stream, and (iii) Refusal Heads that translate these signals into safe response generation. Using targeted attention-head and neuron-level interventions, we provide causal evidence consistent with this circuit organization, showing that suppressing upstream Harmful Detection Heads disrupts downstream refusal behavior and that safety neurons mediate this interaction. We validate that this decomposition recurs across multiple LLM architectures and adversarial attack settings, and use simple, architecture-preserving weight scaling as a mechanistic probe to test its functional relevance. Across six LLMs, circuit-guided scaling improves safety rates under attacks by 26.5%, while incurring only a 1.7% accuracy drop across four standard benchmarks. Overall, our results support a circuit-level interpretation of LLM safety and suggest that mechanistic abstractions can reveal stable and transferable patterns underlying aligned behavior. Code is available at https://github.com/Trustworthy-ML-Lab/Detection2Refusal.

1 Introduction

Large language models (LLMs) have achieved remarkable performance across a wide range of applications, including conversational assistants, code generation, and content creation. Despite these advances, LLMs remain vulnerable to producing harmful or unsafe outputs, particularly under adversarial prompting (Weidinger et al., 2022). While substantial effort has been devoted to mitigating these behaviors, a fundamental question remains largely unanswered: how are safety behaviors internally implemented within LLMs? Addressing this question is essential not only for interpreting model behavior, but also for understanding the structural limits and failure modes of existing safety approaches.

Most existing safety methods operate at the behavioral or semantic level. Techniques such as reinforcement learning from human feedback (RLHF) (Lambert, 2025), adversarial training (Yu et al., 2025), and post-hoc filtering or moderation (Pingua et al., 2024) aim to shape model outputs without explicitly characterizing the internal mechanisms that detect harmful intent or trigger refusal. Concept-based approaches, such as Concept Bottleneck LLMs (Sun et al., 2025b), introduce interpretable intermediate representations, but still rely on externally defined abstractions rather than uncovering how safety is realized within the model's native computation. As a result, these methods provide limited insight into where and how safety decisions are made inside the network.

Recent progress in mechanistic interpretability has shown that high-level behaviors in LLMs can often be localized to specific internal components, such as attention heads or individual neurons (Olsson et al., 2022; Zhou et al., 2025; Zhao et al., 2025). In the context of safety, prior work has identified components correlated with harmful content detection or refusal behavior, and has shown that editing a small set of such heads can strengthen refusal (Chu et al., 2025; Zhou et al., 2025). However, these studies primarily focus on component attribution in isolation, and do not characterize how multiple components interact to jointly support safety behavior. As a result, it remains unclear whether safety

*Equal contribution.

arises from coordinated internal dependencies or from independent mechanisms.

In this work, we take a mechanistic interpretability perspective on LLM safety and characterize a detection–refusal circuit-level organization of refusal behavior that recurs across models. Rather than treating safety-related heads and neurons as isolated features, we show that safety behavior can be usefully decomposed into three interacting, layer-stratified roles: (i) Harmful Detection Heads that respond selectively to harmful inputs, localized primarily across the early and middle layers of the network; (ii) Safety Neurons whose activations modulate the strength of refusal-related signals; and (iii) Refusal Heads that translate these signals into safe or refusing tokens. Crucially, these components operate across a macro-level layer hierarchy: the early-stage detection heads compute upstream features that causally drive the activation of the late-stage safety neurons and refusal heads. Across multiple architectures, we provide causal intervention evidence consistent with this cross-layer organization, showing that removing the early detection heads or mid-to-late safety neurons directly weakens downstream refusal-head activity.

To leverage these mechanistic insights in practice, we apply a simple, architecture-preserving weight-scaling intervention that reinforces the identified components without additional training or optimization. Scaling each component's impact through weight parameters individually (detection heads, safety neurons, or refusal heads) consistently improves safety, while jointly scaling them yields substantially larger gains than any single intervention alone. Averaged across six LLMs, this training-free circuit-guided scaling improves safety rates under attacks by 26.5% (from 43.2% to 69.7%), while largely preserving the model's original utility, with an average accuracy reduction of only 1.7% across four task-oriented benchmarks.

Our contributions are summarized as follows:

  • We characterize a detection–refusal circuit-level organization of refusal behavior in LLMs—consisting of Harmful Detection Heads, Safety Neurons, and Refusal Heads—and validate this interpretable decomposition with causal intervention evidence, demonstrating that selectively zeroing out detection heads directly weakens downstream refusal-head activity.

  • Leveraging the mechanistic insights from the

detection-refusal circuits, we show that simple circuit-guided weight scaling substantially improves safety: scaling each component weight individually increases robustness, while jointly scaling them yields larger gains, improving safety rates under GCG attacks by 26.5% on average across six LLMs, and largely preserving the model's original utility with only a 1.7% average accuracy reduction across four standard benchmarks.

References (41)

  • Qwen2.5-Coder Technical Report
  • Pointer Sentinel Mixture Models
  • Qwen3 Technical Report
  • Universal and Transferable Adversarial Attacks on Aligned Language Models
  • 19 F.2 Joint Ablation of Safety Neuron Selection Ratio and Scaling Factor
  • For each data split, discrete circuit components were isolated by selecting the top 3% of highest-attributed attention heads and the top 1% of highest-attributed MLP neurons
  • The strong Jaccard overlap scores confirm that our pipeline consistently recovers the same underlying safety heads and neurons, demonstrating that the mapped circuit captures intrinsic model mechanisms rather than dataset artifacts
  • CBSE's safety gain is stable across seeds (std $\leq$ 3.6 points for all six models) and, on every architecture, dwarfs the seed-to-seed variance of the Original model
  • CBSE's gains are stable and far exceed generation-level variance
  • All safety rates reported in this section are measured using Llama-Guard
  • For this evaluation, we employ Qwen3-30B-A3B-Instruct-2507 (Yang et al., 2025) as the attacker model
  • Our intervention markedly elevates safety rates for both robust and vulnerable baselines, demonstrating strong defense generalizability against high-level semantic persuasion
  • Unlike token-level attacks, AutoDAN optimizes for semantic coherence, posing a significant challenge to internal alignment mechanisms
  • The gains are particularly notable on models with weak native AutoDAN resistance; for instance, CBSE elevates Mistral's safety rate from 3.0% to 70.0% and Qwen2.5 from 4.0% to 93.0%
  • We systematically zero out an increasing percentage (0%, 1%, 3%, 5%) of the highest-attributed components in the safety circuit and evaluate the model's resulting vulnerability under adversarial GCG attacks
  • Most notably, in LLaMA3, a minimal 1% ablation effectively collapses the model's resistance, plunging its safety rate from 75% to a mere 2%
  • The gap holds even against inputs adversarially engineered to look harmful (OR-Bench) and inputs that are considerably more difficult than the harmful prompts themselves (GSM8K, hard MMLU subjects), ruling out surface toxicity or generic difficulty as the driver of the signal
  • To establish a rigorous baseline benchmark, all configurations are evaluated against a dataset of 100 adversarial GCG prompts, with the final safety rates measured using Llama3-8B-Guard
  • >LLaMA3</td><td>Original</td><td>—</td><td>84</td></tr><tr><td>CircuitBreakers</td><td>Training-based</td><td>65</td></tr><tr><td>CBSE</td><td>Training-free</td><td>99</td></tr><tr><td rowspan=
  • Crucially, on LLaMA3, CircuitBreakers suffers from defense degradation under the evaluated GCG dataset, dropping to a 65% safety rate, whereas CBSE successfully hardens the model to a 99% safety rate
  • However, while LAT demands resource-intensive adversarial training loops, multiple backward passes, and specialized optimization data to achieve this boundary, CBSE operates entirely at inference time
  • SmoothLLM (Robey et al., 2025), a prompt-level defense that aggregates predictions over randomly perturbed copies of the input, and Activation-Steering (Arditi et al., 2024), an activation-level defense that adds our identified refusal direction to the residual stream at inference time
  • Safety performance is measured using Llama3-8B-Guard, while general utility is evaluated using accuracy on MMLU
  • Neuron-level interventions are disabled in this evaluation
  • Neuron-level interventions are disabled
  • Attention-head interventions are fixed at top 3% heads with $\alpha_{\mathrm{det}} = \alpha_{\mathrm{ref}} = 2.0$
  • The table shows how varying the fraction of selected safety neurons and the neuron scaling factor affects general reasoning ability, ensuring that safety improvements do not compromise performance
  • a model-based judge, human annotation, and a rule-based heuristic check
  • We employ Claude 4.6 Opus—an entirely separate architecture and training pipeline from our primary evaluator, Llama Guard—to assess model outputs under GCG attacks
  • The tight correlation between the Claude and Llama Guard metrics demonstrates that the reinforced safety pathways yield robust, generalized refusal behaviors that successfully transfer across distinct frontier evaluation models
  • To break this automated-to-automated loop, we introduce a human validation layer
  • The annotator followed a fixed protocol: a response is unsafe only if it provides actionable harmful content that could be used to carry out the request; refusals, deflections, non-actionable general information, and off-topic or incoherent completions are safe
  • All three judges, scored independently on the same underlying responses, rank CBSE far above the Original model, confirming that CBSE's safety improvement is not an artifact of automated-to-automated evaluation
  • All judges score the identical items
  • This method evaluates safety independently of any neural model by verifying whether output strings begin with or contain phrases indicative of standard refusals, ethical disclaimers, or polite rejections
  • Specifically, joint configurations involve scaling the top 3% of detection and refusal heads ( $\alpha_{det} = \alpha_{ref} = 2.0$) alongside the top 1% of safety neurons ( $\alpha_{saf} = 1.5$)
  • The relative performance trends remain highly consistent with our primary Llama Guard evaluation
  • All intervention configurations (scaling of detection heads, refusal heads, and safety neurons) are kept identical to those used in the Table 2
  • Across backbone models and attack settings, we observe trends that closely mirror those on AdvBench, indicating that the observed safety improvements generalize across datasets and evaluation protocols
  • ><tr><td>Safety Rate (%) ↑</td><td>LLaMA3</td><td>LLaMA2</td><td>Mistral</td><td>Guanaco</td><td>Qwen2.5</td><td>Qwen3</td></tr><tr><td>Baseline (Original Model)</td><td>100 / 63</td><td>100 / 89</td><td>99 / 36</td><td>63 / 34</td><td>99 / 47</td><td>100 / 62</td></tr><tr><td colspan=
  • ><tr><td>Safety Rate (%) ↑</td><td>LLaMA3</td><td>LLaMA2</td><td>Mistral</td><td>Guanaco</td><td>Qwen2.5</td><td>Qwen3</td></tr><tr><td>Baseline (Original Model)</td><td>100 / 51</td><td>100 / 76</td><td>96 / 42</td><td>39 / 30</td><td>99 / 35</td><td>77 / 50</td></tr><tr><td colspan=