HateBench: Benchmarking Hate Speech Detectors on LLM-Generated Content and Hate Campaigns

Xinyue Shen, Yixin Wu, Yiting Qu, Michael Backes, Savvas Zannettou, Yang Zhang · DOI

Introduction

As Large Language Models (LLMs) advance, their potential for misuse in generating toxic content grows. While AI developers implement safety guardrails, "jailbreaking" techniques can bypass these filters, leading to the generation of harmful speech. The primary defense against such content on social platforms is the hate speech detector. However, most existing detectors were trained on human-authored text. This research introduces HateBench, a comprehensive framework designed to evaluate the effectiveness of current hate speech detectors against AI-generated content and automated hate campaigns.

The HateBench Framework

The researchers developed a systematic three-stage pipeline to assess the robustness of moderation tools in the LLM era.

The HateBench framework: (1) Dataset Construction, (2) Detector Selection, and (3) Assessment.
  1. Dataset Construction: The team prompted six diverse LLMs (including GPT-4, Vicuna, and OPT) to generate content targeting 34 identity groups. They utilized both standard prompts and adversarial "jailbreak" prompts to bypass safety filters.
  2. Detector Selection: Eight representative detectors were evaluated, including commercial APIs like Google’s Perspective and OpenAI’s Moderation endpoint, as well as popular open-source models like Detoxify and TweetHate.
  3. Adversarial Assessment: The framework tests detectors against "adversarial hate campaigns," simulating real-world threats where attackers modify text at character, word, or sentence levels to evade detection.

Data and Methodology

The study produced the HateBenchSet, a novel dataset of 7,838 samples generated by LLMs and meticulously labeled by human experts. This dataset serves as a benchmark for comparing AI-generated toxicity against traditional human-written hate speech found in datasets like MHS (Measuring Hate Speech). T-SNE visualizations of this data revealed that LLM-generated hate is more linguistically "concentrated" than human hate, making it easier to catch in raw form but potentially easier for attackers to systematically bypass.

Key Results and Insights

The Impact of Jailbreaking

A counterintuitive finding of the study is that detectors often perform better on content generated via jailbreak prompts compared to standard prompts. Jailbreak prompts typically force the model into an overtly toxic persona, making the resulting hate speech "louder" and easier for automated systems to flag.

Comparison of detector F1 scores on content from original versus jailbroken LLMs across various detection models.

The GPT-4 Paradox

Performance significantly declined when moving from GPT-3.5 to GPT-4. For instance, the Perspective API’s F1-score dropped from 0.878 to 0.621. GPT-4's more sophisticated linguistic capabilities allow it to use complex vocabulary and profanity in non-hateful contexts (e.g., emphatic praise), which confuses detectors that rely heavily on keyword-based signals.

Vulnerability to Automated Campaigns

Adversarial attacks proved devastatingly effective. The TextFooler attack achieved an average Attack Success Rate (ASR) of 0.966 across detectors. Furthermore, by using "model stealing" techniques—where an attacker builds a local surrogate of a target detector—adversaries can optimize hateful messages 13–21 times faster than through traditional trial-and-error, enabling massive, stealthy campaigns.

Conclusion and Future Directions

The study highlights a critical gap in current moderation infrastructure. While commercial APIs remain the most effective baseline, they are highly vulnerable to sophisticated LLM-generated content and targeted adversarial attacks.

The researchers advocate for several defensive strategies:

  • Adversarial Training: Incorporating LLM-generated adversarial examples into the training sets of detectors to build immunity.
  • Distribution Monitoring: Moving beyond individual post analysis to monitor query distributions for patterns of automated adversarial attempts.
  • Continuous Updates: Regularly updating benchmarks like HateBench to include evolving slurs and linguistic shifts in AI-generated text.

Summary updated

BibTeX
@inproceedings{shen2025hatebench,
  author = {Xinyue Shen and Yixin Wu and Yiting Qu and Michael Backes and Savvas Zannettou and Yang Zhang},
  title = {{HateBench: Benchmarking Hate Speech Detectors on LLM-Generated Content and Hate Campaigns}},
  booktitle = {USENIX Security},
  year = {2025},
}
Figure