Manuscript Offprint

arXiv:2608.26222

NeuronFuzz: Safety Neuron Guided Fuzzing for LLM Safety Evaluation

Zhiyuan Xu, Muhammad Firhard Roslan, Joseph Gardiner, Sana Belguith, Lichao Wu

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

Zhiyuan Xu

University of Bristol

zhiyuan.xu@bristol.ac.uk

Muhammad Firhard Roslan

University of Bristol

firhard.roslan@bristol.ac.uk

Joseph Gardiner

University of Bristol

joe.gardiner@bristol.ac.uk

Sana Belguith

University of Bristol

sana.belguith@bristol.ac.uk

Lichao Wu

University of Bristol

lichao.wu@bristol.ac.uk

Abstract

Safety evaluation is critical for assessing whether aligned Large Language Models (LLMs) remain robust against jail-break attacks. Existing automated testing methods, however, largely rely on response-level feedback: each candidate prompt typically requires generating a target-model response to evaluate its attack effectiveness. This process is expensive and, more importantly, provides only sparse guidance on strongly aligned models, where most candidates are rejected with the same failure outcome.

This paper presents NeuronFuzz, a white-box fuzzing framework that exploits internal safety neurons as continuous execution feedback for LLM safety evaluation. A SafetyOracle converts safety-neuron activations into a continuous safety alarm score that serves as feedback for fuzzing and can be obtained during prefill, eliminating response generation from the fuzzing loop. To construct the SafetyOracle, NeuronFuzz uses template-invariant harmful and benign inputs and stability-aware selection to identify a compact set of safety neurons whose activations capture harmful-intent recognition. Moreover, since the safety alarm score is differentiable, NeuronFuzz uses its gradients to identify safety-sensitive template positions and a masked language model to generate fluent, context-compatible mutations while preserving original harmful payload and avoiding additional optimization variables. We evaluate NeuronFuzz across 21 text and multimodal models. Across five white-box source models, it achieves a 76–100% jailbreak discovery rate, outperforming baselines by up to 48 percentage points. Its optimized templates further transfer zero-shot to open-weight and six proprietary target models, achieving average ASR and top-5 ensemble ASR (EASR) of 69.6%/92.6% and 44.1%/60.0%, respectively.

1 Introduction

Large Language Models (LLMs) are increasingly deployed in applications that directly interact with users. To prevent misuse, modern LLMs undergo safety alignment to recognize harmful requests and suppress unsafe responses. However, aligned models remain vulnerable to carefully crafted adversarial prompts, known as jailbreaks, that bypass these safety mechanisms and elicit harmful content [55,64]. As LLMs and their alignment strategies continue to evolve, systematically identifying such safety failures has become an important part of evaluating model robustness before deployment.

Existing LLM safety testing can broadly be divided into manual and automated approaches. Manual red teaming relies on human-designed strategies such as role-playing, instruction conflicts, refusal suppression, and contextual framing [25, 36, 55, 64]. While effective at exposing individual weaknesses, manual testing requires substantial human effort and domain expertise, limiting the scale and diversity of explored inputs. Automated approaches improve scalability by algorithmically generating or optimizing jailbreak prompts. For example, AutoDAN [35] evolves prompts through hierarchical genetic optimization; PAIR [11] iteratively refines attacks using an attacker LLM. Another line of automated testing adapts fuzzing, a widely adopted technique for software and hardware testing [37, 68], to LLM safety evaluation [76]. LLM fuzzers iteratively mutate jailbreak templates using language-based operators such as rephrasing, shortening, and expansion, and retain promising candidates based on response-level safety evaluation feedback. Through repeated mutation and selection, they can gradually discover more effective jailbreak templates. Despite their different search strategies, these methods follow the same evaluation paradigm: each candidate is submitted to the target LLM; a response is generated and then evaluated by a classifier, heuristic detector, or LLM judge.

However, this response-level paradigm introduces two fundamental limitations for automated safety testing: (i) Sparse Search Feedback: Response-level evaluation provides little information about how promising an unsuccessful candidate is. This problem is particularly severe for strongly aligned models, where most mutated prompts are refused and consequently receive the same failure outcome. Yet these candidates may affect the model's underlying safety behavior very differ-ently: one may leave the safety mechanism largely unchanged, while another may substantially weaken it without yet producing a successful jailbreak. Response-level feedback cannot distinguish between them, leaving the fuzzer with limited guidance on which candidates to retain and further explore. Increasing the query budget does not fundamentally solve this problem because the feedback itself remains sparse. (ii) Expensive Response Generation: Evaluating every candidate requires autoregressive decoding, which is substantially more expensive than processing the input prompt alone [26, 32]. Response-based methods may additionally invoke external classifiers or LLM judges after generation. Since automated fuzzers repeatedly evaluate large numbers of candidates, complete response generation becomes a major scalability bottleneck. Thus, an efficient fuzzer requires a feedback signal that can evaluate candidates before response generation.

Our Approach and Contributions: To address these limitations, we present NeuronFuzz, a white-box fuzzing framework that uses internal safety-neuron activations as continuous execution feedback. Inspired by coverage-guided fuzzing [79], NeuronFuzz constructs a lightweight SafetyOracle that maps a compact set of stable safety neurons to a continuous safety alarm score during prefill. To ensure that this signal captures harmful intent rather than jailbreak-template artifacts, we identify safety neurons using template-invariant harmful-benign pairs and stability-aware selection. The SafetyOracle eliminates response generation for intermediate candidates and distinguishes promising mutations even when they share the same response-level failure outcome. Moreover, its differentiable score allows NeuronFuzz to locate safety-sensitive template positions through gradients, while a masked language model generates context-compatible replacements that preserve the harmful payload and natural-language structure. Our main contributions are as follows:

• We introduce a new perspective on LLM fuzzing that uses safety neurons as execution feedback, replacing expensive and sparse response-level evaluation with continuous internal feedback available during prefill.

• We design a lightweight SafetyOracle based on template-invariant activation extraction and stability-aware safety-neuron selection. Its differentiable safety alarm score guides both candidate ranking and gradient-based localization of safety-sensitive template positions.

• We develop NeuronFuzz, which combines prefill-only SafetyOracle feedback with gradient-guided masked-token mutation to efficiently explore jailbreak templates while preserving the harmful payload and natural-language structure.

• We conduct extensive evaluations across 21 text and multimodal models. NeuronFuzz consistently improves jailbreak discovery over representative baselines and its optimized templates transfer across model families, proprietary APIs, datasets, and visual safety tasks.

The remainder of this paper is organized as follows. Section 2 provides background on LLM safety evaluation and fuzzing. Section 3 presents the motivation, threat model, and design of SafetyOracle and NeuronFuzz. Section 4 describes the implementation and experimental setup. Section 5 reports the main results, and Section 6 presents the ablation studies. Section 7 evaluates input defenses and defensive uses of the SafetyOracle. Finally, Section 8 concludes the paper.

References (66)