Causality Guided Representation Learning for Cross-Style Hate Speech Detection

Chengshuai Zhao, Shu Wan, Paras Sheth, Karan Patwa, K. Selçuk Candan, Huan Liu · DOI

Abstract

Traditional hate speech detection models often function as "slur detectors," relying on explicit linguistic markers that fail to generalize across different platforms or styles. This paper presents CADET (Causality Guided Representation Learning), a framework designed to disentangle invariant hateful intent from superficial linguistic styles. By modeling the generation of hate speech through a causal lens and employing latent counterfactual reasoning, CADET achieves significant improvements in cross-style generalization, effectively identifying implicit hate speech even when trained primarily on explicit examples.

Introduction: The Challenge of Implicit Hate

Online moderation faces an evolving challenge: the transition from explicit hate speech—characterized by overt slurs—to implicit hate speech, which utilizes irony, stereotypes, and coded language to evade detection. Current NLP models frequently succumb to "spurious correlations," where they associate specific platform-specific styles or keywords with hate labels rather than understanding the underlying intent.

This "style gap" leads to a significant drop in performance when models are deployed in environments different from their training data. For instance, a model trained on aggressive, explicit tweets may fail to flag subtle "dog whistles" on other platforms. To address this, the authors argue for a shift from pattern matching to causal reasoning, aiming to isolate the why of a post from the how.

Methodology: The CADET Framework

CADET operates on the principle of disentangling the latent factors that contribute to the creation of a hateful post. The framework is built upon three core technical pillars.

1. Causal Disentanglement

The researchers hypothesize that any post ($X$) is generated by four primary latent factors: Creator Motivation ($M$), Target ($T$), Style ($S$), and Contextual Environment ($U$).

The causal graph representing the generation of a post, where $U$ (context) acts as a confounder affecting style, target, and motivation.

Using a RoBERTa-based encoder, CADET maps input text into a latent space where these factors are separated into distinct representations. The goal is to isolate the domain-invariant features—specifically the motivation ($M$) and target ($T$)—from the domain-specific style ($S$) and context ($U$).

2. Adversarial Confounder Mitigation

The platform or context ($U$) acts as a confounder, potentially inducing false correlations between a specific style and the hate label. To counter this, CADET employs adversarial training via Gradient Reversal Layers (GRL). This ensures that the representations for motivation and target are "purified" of platform-specific signals, making the model's core classification features robust across different environments.

3. Latent Counterfactual Reasoning

To further enhance robustness against style shifts, CADET introduces a Style Flipping Network. This component allows the model to perform "what-if" reasoning during training.

The full CADET architecture, illustrating the disentanglement process, adversarial mitigation, and the style-flipping mechanism for counterfactual reasoning.

By "imagining" a hateful post in a different style (e.g., converting an explicit attack into an implicit metaphor) while keeping the intent and target constant, the model learns Counterfactual Consistency. The classifier is required to produce the same label for both the original and the "flipped" latent representation, forcing it to focus on invariant intent rather than surface-level phrasing.

Experimental Evaluation

The authors evaluated CADET across four diverse datasets: IsHate (multi-platform), Implicit Hate Corpus (IHC) (extremist groups), AbuseEval v1.0 (Twitter), and DynaHate (adversarial benchmarks). Additionally, a controlled test set was generated using GPT-4 to rephrase explicit hate into implicit equivalents.

Key Results

  • Superior Generalization: In explicit-to-implicit transfer tasks, CADET achieved a macro-F1 of 0.815, representing a 13% relative improvement over state-of-the-art baselines like HateBERT and HateXplain.
  • Robustness to Style Shifts: On the GPT-4 transformed test set, CADET maintained an F1 of 0.76, whereas traditional classifiers' performance collapsed once explicit slurs were removed.
  • Ablation Insights: The removal of the counterfactual loss led to a 24-point drop in F1, highlighting that latent flipping is the most critical component for learning style-invariance.

Conclusion and Future Work

CADET demonstrates that causal disentanglement is a powerful tool for building robust hate speech detectors. By isolating intent from style, the model moves closer to human-like understanding of harmful content. Future research will explore extending this framework to multi-modal content (such as memes) and multi-lingual contexts, where cultural nuances further complicate the detection of implicit hate.

Summary updated

BibTeX
@inproceedings{zhao2026causality,
  author = {Chengshuai Zhao and Shu Wan and Paras Sheth and Karan Patwa and K. Selçuk Candan and Huan Liu},
  title = {{Causality Guided Representation Learning for Cross-Style Hate Speech Detection}},
  booktitle = {UCRL @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=vJlbeNEO2x},
}
Figure