Introduction
Automating the detection of online hate speech is a critical task for social media platforms. However, supervised learning models often struggle due to severe data imbalance. In most datasets, hateful content is the "minority class," typically comprising less than 12% of the total samples. While data augmentation is common in computer vision, it is challenging in Natural Language Processing (NLP) because simple noise injection or word swapping can easily break syntax or alter meaning.
Methodology: The HateGAN Framework
To address these challenges, the authors propose HateGAN, a deep generative reinforcement learning framework based on the SeqGAN architecture. HateGAN is designed to perform controlled text generation, producing synthetic hateful tweets that are both linguistically coherent and highly targeted.
The system consists of three primary components:
- The Generator: An LSTM-based model that produces synthetic hateful tweets.
- The Discriminator: A binary classifier that distinguishes between real and synthetic tweets, ensuring syntactic realism.
- The Toxicity Scorer: A pre-trained multi-label classifier that evaluates text across dimensions like "toxicity" and "identity attack."
Because text generation involves discrete choices, HateGAN employs Policy Gradient methods for optimization. The generator receives a dual reward: a Realistic Score from the discriminator and a Hate Score from the toxicity scorer. To estimate rewards for incomplete sequences, the model uses Monte Carlo (MC) search to "peek ahead" and guide the generation process.
Datasets
The study utilized four public datasets: WZ-LS (sexism/racism), DT (hate/offensive/neither), FOUNTA (large-scale, multi-class), and HateLingo (hateful tweets only). While all datasets were used to train the generator for diversity, evaluation focused on WZ-LS and DT to measure the impact of augmentation on standard detection tasks.
Key Results
HateGAN augmentation significantly improved performance across various architectures, including LSTM, CNN, and CNN-LSTM. On average, the model achieved a 5% boost in F1 scores for the hate speech class.
Key findings include:
- Precision vs. Recall: On the DT dataset, the model saw a 12.8% increase in identifying hateful tweets with only a 1.0% drop in accuracy for the "offensive" class.
- Superiority over Baselines: HateGAN outperformed traditional sampling methods (upsampling/downsampling) and other augmentation techniques like GenAug and ThreshAug.
- Semantic Coherence: Case studies demonstrated that HateGAN generates diverse tweets targeting specific groups (e.g., "feminazi") while maintaining linguistic structure.
Conclusion
HateGAN provides a robust solution for the class imbalance problem in hate speech detection. By balancing realism with hatefulness through a dual-reward system, it allows classifiers to generalize better without sacrificing overall accuracy. Future work will explore more diverse generative architectures like Variational Autoencoders (VAEs) and more granular attribute controls for targeted data generation.
Summary updated