Identifying Slurs and Lexical Hate Speech via Light-Weight Dimension Projection in Embedding Space

Sanne Hoeken, Sina Zarrieß, Ozge AlacamACL 2023

TL;DR

This paper introduces a novel method for identifying slurs, a specific type of hate speech, by leveraging contextualized word embeddings and a "hate dimension." By projecting word representations onto this dimension, the authors achieve high accuracy in detecting slurs, offering a more targeted and efficient approach to hate speech detection.

What Problem Does This Paper Address?

Online hate speech is a growing concern, and accurately detecting it is crucial. While much research focuses on identifying hate speech at the utterance level, this paper tackles a more granular problem: identifying hate speech at the lexical level, specifically focusing on slurs. Slurs are defined as derogatory terms referencing social groups, and their meanings are generally stable across contexts. Existing hate speech detection methods often rely on broad lexicons or complex utterance-level analysis, leaving a gap in efficiently and accurately identifying these specific, yet potent, linguistic units. The challenge lies in capturing the inherent "hatefulness" encoded within these words, even when they appear in diverse contexts.

Methods

The core of the proposed method is semantic dimension identification. Here's how it works:

  1. Extracting Lexical Representations: Instead of single words, the authors consider "lexical units" (which can include multi-word expressions like "porch monkey"). They use pre-trained contextualized language models (like DistilBERT) to generate embeddings for these units within various social media contexts. This involves averaging hidden layers and subword token representations.
  2. Creating a "Hate Dimension": A "hate dimension" vector is created by calculating the average difference between the embeddings of carefully selected slur-neutral counterpart pairs. These pairs are linguistically chosen to differ primarily in their hateful connotation.
  3. Projection onto the Dimension: Each lexical unit's contextualized embedding is then projected onto this hate dimension. The projection value indicates the degree of "hatefulness" encoded in that unit's representation. Positive values suggest hateful terms, while negative values suggest neutral terms.

This approach is described as "light-weight" because it doesn't require massive annotated datasets for training, relying instead on linguistic theory and existing lexicons to define the dimension.

Datasets

  • For Dimension Creation:
    • HateBase: A lexicon of hate speech terms used to identify potential slur-neutral pairs.
  • Reddit: A large corpus of user-generated comments (5.8 million from general Reddit, and 10 million from the domain-specific r/The_Donald subreddit) used to provide contexts for generating lexical representations.
  • For Evaluation:
    • HateBase Lexicon: A subset of pairs from HateBase was used for initial testing.
  • HateXplain Dataset: A dataset of over 20,000 annotated posts from Twitter and Gab, specifically designed for explainable hate speech detection. This dataset was used to create test sets for both person-specific and general noun evaluation.

Key Insights and Ideas

  • Slurs as a "Hate Dimension": The core idea that slurs, due to their stable derogatory meaning, can define a specific semantic dimension of "hate" within word embeddings is a powerful insight.
  • Contextualized Embeddings are Key: The method's success hinges on using contextualized embeddings, allowing it to capture nuances of word meaning as they appear in real-world text.
  • Data Efficiency: The approach demonstrates that effective hate speech detection (specifically for slurs) can be achieved with relatively small amounts of data, making it more accessible and cost-effective.
  • Linguistic Theory Validation: The findings reinforce linguistic theories about the stable semantic properties of slurs across different contexts.
  • Broader Applicability: The "hate dimension" shows promise beyond just slur detection, hinting at potential for identifying other forms of lexical hate speech.

Key Results

  • High Accuracy on HateBase: The method achieved accuracy rates of around 0.90 on the HateBase test set.
  • Good Accuracy on HateXplain (Persons): For person-related terms in the HateXplain dataset, accuracy was around 0.77.
  • Robustness to Context Size: The effectiveness of the dimension was not significantly influenced by the number of contexts used (even with as few as 2-4 contexts), suggesting efficiency.
  • Domain Agnosticism: Using contexts from a domain-specific subreddit (r/The_Donald) did not significantly impact performance compared to general Reddit data, indicating versatility.
  • Generalization Challenges: While effective for slurs, performance dropped when generalizing to non-person nouns (correlation decreased by 0.3), with a notable increase in false positives. This suggests limitations when the "hate dimension" is applied to terms not directly related to social group denigration.

Limitations and Future Work

  • Generalization to Non-Person Nouns: The method's performance significantly declines when applied to non-person nouns, indicating that the "hate dimension" derived from slurs is most effective for terms directly targeting social groups. The authors suggest this might be due to the nature of the evaluation data and the need for more robust part-of-speech filtering.
  • Evaluation Data Quality: The authors note that the HateXplain dataset's rationale scores, designed for utterance-level hate, might not perfectly align with their lexical-level evaluation, potentially explaining some false negatives.
  • Technical Considerations: Future work could explore different methods for computing semantic dimensions (e.g., PCA-based) and investigate the impact of selecting specific hidden layers in contextualized models.
  • Alternative Contexts: Exploring how the method performs with non-derogatory uses of slurs in in-group contexts is a promising avenue.
  • Broader Hate Speech Detection: Further research could focus on extending this approach to detect other categories of lexical hate speech beyond slurs.

Summary updated

BibTeX
@inproceedings{hoeken2023identifying,
  author = {Sanne Hoeken and Sina Zarrieß and Ozge Alacam},
  title = {{Identifying Slurs and Lexical Hate Speech via Light-Weight Dimension Projection in Embedding Space}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
}
Figure