Manuscript Offprint

arXiv:2608.14392

Tripwire: Triggering Aligned Refusal via Statistically Certified Safety Neurons

Wei Zhao, Zhe Li, Peixin Zhang, Jun Sun

Abstract

Neuron- and path-level interventions offer the finest-grained route to defending large language models (LLMs) against jailbreak attacks, yet existing methods fall short of this promise, i.e., they often compromise model utility significantly. Specifically, one line of work suppresses toxic neurons to erase harmful semantics, but since such semantics are distributed across the network, blocking every pathway forces a large intervention footprint. An alternative line of research focus on identify safety neurons using external classifiers. While promising, the existing approaches suffer from compromising neurons that are important for the model utility as well. Moreover, both approaches remain always on and thus perturb every benign request even when no attack is present. To address these limitations, we present TripWire, a training-free defense that first identifies safety-specific neurons through per-neuron hypothesis tests under false-discovery-rate control together with a utility-specificity filter. Based on this identification, a trigger-style clamp holds the selected neurons at their harmful-conditional mean activations, injecting an internal harmful-input signal that triggers the refusal behavior learned during alignment. The clamp is then realized by two provably equivalent deployment modes, namely a detector-gated inference-time intervention and an offline bias-patch weight edit. Extensive experiments across four safety-aligned LLMs and four representative attacks demonstrate that TripWire reduces the average attack success rate to at most 2.0% while incurring a utility drop of only 0.5% to 5.3% on MT-Bench, the smallest among all defenses. Code is available at https://anonymous.4open.science/r/Tripwire-65C4.

Singapore Management University

{wzhao,zheli,pxzhang,junsun}@smu.edu.sg

Introduction

Large Language Models (LLMs) such as ChatGPT (Achiam et al. 2023) and Gemini (Anil et al. 2023) have revolutionized natural language processing, achieving remarkable performance in tasks such as question answering, code completion, and text generation (Brown et al. 2020; Chen et al. 2021). However, as these models are increasingly deployed in real-world applications, their vulnerabilities pose significant security and reliability risks. A particularly severe threat is jailbreaking, i.e., the use of adversarial prompts to bypass safety mechanisms and elicit harmful or policy-violating outputs (Guo et al. 2025; Feng et al. 2026). Such attacks have become increasingly automated and effective: optimization-based attacks such as GCG (Zou et al. 2023c), iterative refinement attacks such as PAIR (Chao et al. 2023), and generator-based attacks such as AmpleGCG (Liao and Sun 2024) and Jailbreak-R1 (Guo et al. 2025) have all demonstrated increasing efficiency and effectiveness in bypassing safety mechanisms.

In response, the research community has developed a variety of defense strategies ranging from knowledge-editing approaches such as LED (Zhao et al. 2024) and DELMAN (Wang et al. 2025) to inference-level defenses that examine or perturb inputs and internal states (Robey et al. 2023; Xu et al. 2024). Despite these advances, existing defenses exhibit a persistent safety and utility trade-off: strengthening refusal behavior degrades performance on benign tasks. An ideal defense mechanism would operate at the finest possible granularity: by first identifying the safety-related neurons and then intervening on only those neurons, such a defense should achieve strong protection with the least utility cost (Wu et al. 2025; Wang et al. 2026; Shi et al. 2026). However, existing neuron-level methods fall short of this promise in practice for three reasons.

First, existing methods such as TraceRouter (Shi et al. 2026) and DELMAN (Wang et al. 2025) essentially target toxic neurons: they rely on harmful vocabulary to locate the modules that encode harmful information and then zero out or reverse the neuron values to block the propagation of harmful semantics. However, harmful semantics are distributed across the network and blocking them requires suppressing every route they may take. This demands a large intervention footprint and turns every additional suppressed neuron into a potential utility loss. Moreover, evolving attacks can always exploit an uncovered route, which makes it practically impossible to invalidate all pathways. Second, methods such as NeuroStrike (Wu et al. 2025) instead search for safety neurons that detect harmful requests and trigger refusal. These methods rely on external classifiers to attribute neuron importance. However, such classifier-based attribution cannot distinguish safety neurons from generally important ones. Third, some neurons inevitably serve both safety and general functions. An always-on intervention without taking utility into consideration on these neurons therefore perturbs every benign request even when no attack is present. These three problems are the causes of the observed utility cost rather than the neuron granularity itself.

To address these challenges, we present TripWire, a neuron-level defense framework that addresses each problem with a dedicated design. First, a statistically rigorous identification funnel screens every neuron in the model with direction filtering, per-neuron Welch tt-tests under Benjamini–Hochberg false-discovery-rate control, and a utility-specificity filter that removes neurons which also activate strongly on normal tasks. The surviving neurons are then ranked and the top-NN candidates are selected. This yields a statistical upper bound on the fraction of mis-selected neurons and disentangles safety-specific neurons from generally important ones without any training. Second, a trigger-style clamp holds the selected neurons at their harmful-conditional mean activations, which injects an internal “the current input is harmful” signal and triggers the refusal behavior the model already learned during alignment. Because triggering refusal requires only a stable signal rather than interception of every semantic pathway, a small neuron set is sufficient and the intervention does not depend on the specific attack. Third, two deployment modes realize the same clamp: an inference mode in which a lightweight detector gates the clamp so benign inputs are processed by the unmodified model, and an offline bias-patch weight edit shown to be equivalent to the inference-time clamp, both theoretically and empirically. With this design, a single identification pipeline serves both a detector-gated deployment and a permanent, detector-free, zero-overhead checkpoint.

To validate the effectiveness of TripWire, we conduct comprehensive experiments on four safety-aligned open-source LLMs (Llama-2-7B, Llama-3.1-8B, Qwen2.5-7B, and Qwen2.5-32B) against four representative jailbreak attacks (GCG, AmpleGCG, AutoDAN, and Jailbreak-R1). We compare against state-of-the-art defense baselines organized by deployment form: RepE (Zou et al. 2023a) and TraceRouter (Shi et al. 2026) for the inference-based defense and LED (Zhao et al. 2024) and DELMAN (Wang et al. 2025) for the weight-editing defense. We report the attack success rate (ASR) together with MT-Bench (Zheng et al. 2023) utility scores judged by GPT-5.4 at neuron budgets of top-1000 and top-2500. Results demonstrate that TripWire (when targeting top-2500 selected neurons) achieves an average ASR below 2% across both deployment forms on Llama-2, Llama-3.1, and Qwen2.5, compared to 8.3%–12.6% for RepE and 2.2%–4.9% for TraceRouter, DELMAN, and LED, while incurring the smallest utility drop among all defenses. The inference-based and edit-based forms yield consistent results, confirming that the identified neuron set rather than the specific intervention mechanism carries the defense.

References (29)