Leveraging Intra-User and Inter-User Representation Learning for Automated Hate Speech Detection

Jing Qian, Mai ElSherief, Elizabeth M. Belding, William Yang Wang

Abstract

Hate speech detection is a critical, yet challenging problem in Natural Language Processing (NLP). Despite the existence of numerous studies dedicated to the development of NLP hate speech detection approaches, the accuracy is still poor. The central problem is that social media posts are short and noisy, and most existing hate speech detection solutions take each post as an isolated input instance, which is likely to yield high false positive and negative rates. In this paper, we radically improve automated hate speech detection by presenting a novel model that leverages intra-user and inter-user representation learning for robust hate speech detection on Twitter. In addition to the target Tweet, we collect and analyze the user's historical posts to model intra-user Tweet representations. To suppress the noise in a single Tweet, we also model the similar tweets posted by all other users with reinforced inter-user representation learning techniques. Experimentally, we show that leveraging these two representations can significantly improve the f-score of a strong bidirectional LSTM baseline model by 10.1%.

Introduction

Hate speech detection on social media platforms like Twitter is notoriously difficult due to the brief, informal, and often noisy nature of the content. Traditional NLP models often struggle because they treat each tweet as an isolated snippet of text. This approach fails to capture the broader context—such as the speaker's typical behavior or the common linguistic patterns used in similar contexts—leading to high rates of misclassification.

To address these challenges, this research proposes a framework that "zooms out" from the individual tweet. By incorporating a user's posting history (intra-user context) and semantically similar tweets from the wider community (inter-user context), the model gains the necessary background to disambiguate short, noisy inputs.

Methodology

The core of the proposed approach is a three-branch neural network architecture designed to integrate diverse contextual signals.

The detailed neural network architecture featuring the target, intra-user, and inter-user branches.
  1. Target Branch: A standard bidirectional Long Short-Term Memory (Bi-LSTM) network processes the target tweet to extract its primary semantic features.
  2. Intra-User Branch: This branch models the user's linguistic style by analyzing up to 400 of their historical, unlabeled tweets. This allows the model to learn a representation of the user's typical behavior without requiring manual annotation of their entire history.
  3. Inter-User Branch: To mitigate noise in the target tweet, the model identifies "neighboring" tweets from a massive unlabeled dataset (3.4 million tweets) using Locality Sensitive Hashing (LSH). Because not all similar tweets are relevant, a Deep Reinforcement Learning (RL) agent is employed to select the most informative tweets to assist the classifier.

The final classification is derived by concatenating the representations from these three branches into a single softmax layer.

Experimental Results

The model was evaluated using a dataset of 15,781 tweets labeled for hate speech. The results demonstrate that incorporating contextual representations significantly boosts performance over traditional baselines.

Comparison of the proposed model against various baseline methods across Precision, Recall, and F1 metrics.

As shown in the table, the baseline Bi-LSTM achieved an F1-score of 0.703. Adding the intra-user representation improved this to 0.760. The full model, including the reinforced inter-user representation, achieved the highest F1-score of 0.774, representing a 10.1% relative improvement over the baseline. Notably, the full model also outperformed traditional machine learning approaches like SVMs and N-gram models.

Discussion and Conclusion

A key insight from this work is that unlabeled data—both from a user's history and the broader social media landscape—is a powerful resource for improving classification accuracy. The use of RL as a denoising tool effectively manages the challenge of selecting relevant context from large datasets.

However, challenges remain. The model still struggles with sophisticated linguistic nuances such as sarcasm, satire, and intentional adversarial misspellings. Future work may explore applying this "intra/inter" framework to other domains like fake news detection or sentiment analysis, where user context is equally vital.

Summary updated

BibTeX
@inproceedings{qian2018leveraging,
  author = {Jing Qian and Mai ElSherief and Elizabeth M. Belding and William Yang Wang},
  title = {{Leveraging Intra-User and Inter-User Representation Learning for Automated Hate Speech Detection}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=SkEbo7b_ZS},
}
Figure