Abstract
Large Language Models (LLMs) increasingly exhibit over-refusal—erroneously rejecting benign queries due to overly conservative safety measures—a critical functional flaw that undermines their reliability and usability. Current methods for testing this behavior are demonstrably inadequate, suffering from flawed benchmarks and limited test generation capabilities. This paper introduces the first evolutionary testing framework, ORFuzz, for the systematic detection and analysis of LLM over-refusals. ORFuzz uniquely integrates three core components: (1) safety category-aware seed selection for comprehensive test coverage, (2) adaptive mutator optimization using reasoning LLMs to generate effective test cases, and (3) OR-Judge, a human-aligned judge model validated to accurately reflect user perception of toxicity and refusal. Our extensive evaluations demonstrate that ORFuzz generates diverse, validated over-refusal instances at a rate (6.98% average) more than double that of leading baselines. Furthermore, ORFuzz's outputs form the basis of ORFuzzSet, a new benchmark of 1,855 highly transferable test cases that achieves a superior 63.56% average over-refusal rate across 10 diverse LLMs, significantly outperforming existing datasets.
Introduction: The Security Duality of LLMs
As Large Language Models (LLMs) are increasingly integrated into critical software systems, ensuring their safety has become paramount. Developers employ rigorous guardrails, such as Reinforcement Learning from Human Feedback (RLHF) and keyword filters, to prevent harmful outputs. However, this focus on safety has introduced a significant functional flaw: over-refusal. This occurs when a model erroneously rejects a benign query because it contains "sensitive" words or resembles a toxic prompt.
As illustrated in the figure above, over-refusal represents a failure in the model's ability to distinguish between truly toxic intent and benign requests that happen to share linguistic features with harmful content. For example, a coding assistant might refuse to answer "How to kill a python process?" due to the word "kill." This "security duality" means that while models are better at blocking jailbreaks, they are becoming less reliable for legitimate tasks. Current benchmarks like XSTest and OR-Bench often fail to capture the complexity of this behavior or suffer from poor alignment with human perception.
The ORFuzz Framework
To systematically address this, we introduce ORFuzz, the first evolutionary fuzzing framework designed to detect over-refusals. ORFuzz treats the LLM as a system to be probed through iterative, automated testing, utilizing three core components to maximize test coverage and effectiveness.
1. Category-Aware Seed Selection
ORFuzz employs a Monte Carlo Tree Search (MCTS) algorithm to select "seeds" from a dataset across eight safety categories (e.g., Ethics, Cybersecurity, Extremism). This ensures that the fuzzing process explores a wide spectrum of potential triggers rather than relying on random sampling.
2. Adaptive Mutator Optimization
The framework uses a "reasoning LLM" (e.g., DeepSeek-R1) in an analyze-generate-feedback loop. Instead of simple word replacement, the mutator learns which linguistic variations—such as shortening, expanding, or embedding sensitive words in benign contexts—are most likely to trigger an over-refusal in a specific target model.
3. OR-Judge: A Human-Aligned Oracle
Automated evaluation of over-refusal is challenging because it requires determining if a refusal is truly irrational. We developed OR-Judge, a fine-tuned Qwen2.5-14B model trained on 2,000 human-annotated pairs. OR-Judge acts as a reliable test oracle, accurately distinguishing between truly harmful intent and benign queries that trigger irrational refusals, significantly outperforming general-purpose models like GPT-4o.
Evaluation and Key Results
Our extensive evaluation across diverse LLMs reveals several critical insights into the current state of model safety:
- Superior Detection Rate: ORFuzz achieved a validated over-refusal generation rate of 6.98%, which is more than double the performance of leading baselines.
- The ORFuzzSet Benchmark: From our testing, we curated ORFuzzSet, a benchmark of 1,855 high-quality, transferable test cases. This dataset achieved a 63.56% average over-refusal rate across 10 diverse LLMs, significantly outperforming existing static benchmarks.
- Alignment Gaps: Our user study found that 51% of queries labeled "benign" in existing benchmarks like OR-Bench were actually perceived as harmful by humans, highlighting the need for better-aligned evaluation tools like OR-Judge.
- Model-Specific Vulnerabilities: Over-refusal patterns vary by model. For instance, Llama-3.1 is particularly sensitive to "Crimes and Illegal Activities," while Gemma-2 over-refuses more frequently on health-related topics.
- Reasoning Mitigates Over-Refusal: We observed that models with stronger reasoning capabilities generally exhibit lower over-refusal rates, as they are better at understanding context rather than just reacting to keywords.
Conclusion
ORFuzz provides a robust, automated framework for identifying and analyzing over-refusal vulnerabilities. By generating the ORFuzzSet benchmark and the OR-Judge model, we provide the community with essential tools to improve the reliability and trustworthiness of LLM-based systems. Future work will explore using these tools for targeted fine-tuning to help models better distinguish between truly harmful intent and benign context.
Summary updated