Abstract
With the ever-growing presence of social media platforms comes the increased spread of harmful content and the need for robust hate speech detection systems. Such systems easily overfit to specific targets and keywords, and evaluating them without considering distribution shifts that might occur between train and test data overestimates their benefit. We challenge hate speech models via new train-test splits of existing datasets that rely on the clustering of models' hidden representations. We present two split variants (Subset-Sum-Split and Closest-Split) that, when applied to two datasets using four pretrained models, reveal how models catastrophically fail on blind spots in the latent space. This result generalises when developing a split with one model and evaluating it on another. Our analysis suggests that there is no clear surface-level property of the data split that correlates with the decreased performance, which underscores that task difficulty is not always humanly interpretable. We recommend incorporating latent feature-based splits in model development and release two splits via the GenBench benchmark.
Introduction
Standard evaluation in Natural Language Processing (NLP) typically relies on independent and identically distributed (i.i.d.) data splits. By randomly shuffling a dataset and partitioning a subset for testing, researchers aim to measure model performance. However, this approach often fails to capture the complexities of real-world deployment, where models encounter shifting distributions, new slang, and adversarial attempts to bypass detection. In hate speech detection, models frequently overfit to specific keywords or targets present in the training set, leading to an overestimation of their actual utility.
While existing out-of-distribution (OOD) evaluations often focus on human-interpretable features—such as temporal shifts or dialect variations—models may harbor vulnerabilities within their latent feature space that are not immediately obvious to human observers. This study investigates whether a model's own internal representations can be leveraged to identify these "blind spots" and provide a more rigorous evaluation of generalization.
Methodology
The researchers propose a systematic three-step pipeline to generate challenging data splits based on latent features:
- Latent Representation Extraction: A pre-trained Transformer model (e.g., BERT) is fine-tuned on a hate speech task. The hidden representation of the
[CLS]token is then extracted for every example in the dataset. - Dimensionality Reduction and Clustering: To mitigate the "curse of dimensionality," representations are projected into a lower-dimensional space using UMAP or a learned bottleneck layer. Subsequently, k-means clustering is applied to group examples that the model perceives as similar.
- Algorithmic Splitting: Two methods are introduced to partition these clusters into training and testing sets:
- Subset-Sum-Split: Clusters are selected for the test set to precisely maintain the original class distribution (e.g., the ratio of hateful to non-hateful content).
- Closest-Split: This method selects a specific cluster and its nearest neighbors for the test set, effectively creating a "hole" in the training distribution and forcing the model to generalize to a concentrated, unseen region of its latent space.
Experimental Setup
The methodology was evaluated using two prominent hate speech benchmarks:
- Reddit: A binary classification dataset (Hate vs. noHate) collected from various subreddits.
- HateXplain: A tertiary classification dataset (Hateful, Offensive, or Normal) containing posts from Twitter and Gab.
Four pre-trained models—BERT, HateBERT, BERT-Medium, and RoBERTa—were used to test the robustness of the proposed splits. The authors have released two of these challenging splits via the GenBench benchmark.
Key Results and Discussion
The experimental results demonstrate a significant performance gap between standard random splits and the proposed latent splits.
Catastrophic Performance Drops
On the Reddit dataset, models that achieved ~82% F1-score on random splits saw their performance plummet to between 0% and 25% when evaluated on the Closest-Split. Similarly, for HateXplain, macro F1-scores dropped from ~65% to ~36%, a level comparable to random guessing. These results suggest that models are highly sensitive to specific regions of their latent space that are underrepresented during training.
Latent vs. Surface Features
Crucially, the difficulty of these splits does not appear to correlate with human-interpretable surface features. Correlation analyses involving sentence length and keyword frequency failed to explain the performance degradation. This indicates that the "blind spots" are truly latent, residing in the high-dimensional structure of the model's internal logic rather than obvious linguistic patterns.
Cross-Model Generalization
An unexpected finding was the degree of cross-model generalization. Splits generated using the representations of one model (e.g., BERT) proved nearly as challenging for other architectures (e.g., RoBERTa). This suggests that different Transformer-based models may share similar internal structural vulnerabilities when processing hate speech data.
Conclusion
This research highlights the limitations of standard i.i.d. evaluation and introduces a novel method for identifying model vulnerabilities through latent feature-based clustering. By exposing "blind spots" that surface-level metrics miss, these splits provide a more realistic assessment of a model's ability to generalize. The authors recommend that such splits be integrated into standard model development cycles to improve robustness against distribution shifts.
Summary updated