Analysis of Socially Unacceptable Discourse with Zero-shot Learning

Rayane Ghilene, Dimitra Niaouri, Michele Linardi, Julien LonghiarXiv 2024 · DOI

Introduction

The detection of Socially Unacceptable Discourse (SUD)—encompassing hate speech, toxic comments, and aggressive behavior—is a critical yet challenging task for digital platforms. Traditional approaches primarily rely on supervised learning, where models are trained on large, human-annotated datasets. However, this paradigm faces significant hurdles. Annotator subjectivity often introduces cultural or demographic biases into the training data. Furthermore, supervised models are frequently bound to rigid schemas; a model trained on Twitter's definition of "hate speech" may fail to generalize to extremist rhetoric on niche forums. Finally, these models often rely on superficial statistical correlations (e.g., specific slurs) rather than a deep contextual understanding of intent.

To address these limitations, this research explores a "zero-shot" learning approach using Natural Language Inference (NLI). By framing SUD detection as an entailment problem, the authors propose a flexible framework that generalizes across diverse online environments without requiring platform-specific training data.

Methodology: SUD Detection as Natural Language Inference

The core innovation lies in repurposing NLI models for classification. In a standard NLI task, a model evaluates whether a premise (the input text) supports or contradicts a hypothesis (a statement about the text). In this framework, the hypothesis is engineered to represent a specific category of unacceptable discourse.

Conceptual framework for multi-aspect SUD classification.

As illustrated in the conceptual framework, a single piece of text can be analyzed across multiple "aspects," such as topic, emotion, and intensity. For instance, given the premise "I hate politicians so much, I wish we got rid of them all," the model can test hypotheses like "This example is about politics" (Topic), "This example is hate" (Emotion), or "This example is extreme" (Intensity).

Hypothesis Engineering and Bias Mitigation

A key component of this methodology is Hypothesis Engineering. The researchers discovered that the specific phrasing of the hypothesis—particularly the choice of verb—significantly impacts performance. For example, changing the template from "this text contains {} speech" to "this text supports {} speech" can lead to substantial variations in F1 scores. This sensitivity suggests that the "prompt" framing is vital for zero-shot accuracy.

To ensure the models were not simply acting as keyword filters, the authors implemented Token Masking. Using GloVe embeddings, they identified and masked words highly correlated with specific labels (e.g., slurs). This forced the models to rely on the underlying linguistic structure and context of the discourse rather than superficial "bad words," thereby reducing the risk of learning harmful stereotypes.

Experimental Evaluation

The framework was evaluated across 12 publicly available datasets, spanning Twitter, Facebook, Reddit, and various online forums (e.g., Gab, Stormfront). These datasets provided a rigorous testing ground, featuring diverse labels such as abusive, profane, aggressive, and neither. The researchers compared several pre-trained transformer models, including RoBERTa-large-mnli and BART-large-mnli, against traditional supervised baselines like BERT and Logistic Regression (LR).

Key Results and Insights

The experimental results demonstrate that while supervised models often hold an edge due to their exposure to specific training data, zero-shot NLI models are remarkably competitive and, in some cases, superior.

Comparison of supervised vs. unsupervised (zero-shot) classification performance across 12 datasets.

As shown in the performance table, the zero-shot models (particularly RoBERTa and BART) achieved impressive results across the board. Notably, in the Grimminger dataset, which focuses on nuanced political discourse in US election tweets, the zero-shot approach actually outperformed the supervised BERT and LR models. This suggests that NLI-based models may possess a superior ability to handle complex, context-dependent speech that eludes models trained on rigid, often noisy, human labels.

Other key insights include:

  • The Semantic Signal of Labels: The choice of the "safe" or "neutral" label matters. Using "neutral speech" as a hypothesis performed significantly better than "neither," indicating that the NLI model benefits from the clearer semantic meaning of the former.
  • Contextual Robustness: The success of the models even under token masking confirms that they are capturing the intent of the discourse, making them more robust against adversarial attempts to bypass filters by slightly altering toxic language.

Conclusion and Future Directions

This research highlights the potential of zero-shot learning to create more "elastic" and less biased systems for moderating online discourse. By moving away from rigid supervised schemas, platforms can deploy detection systems that are more adaptable to emerging forms of toxic behavior. Future work will focus on automating the optimization of hypothesis templates and investigating the scalability of these models when checking against large sets of potential labels simultaneously. Ultimately, this zero-shot approach could serve as a powerful tool in "human-in-the-loop" systems, helping experts rapidly identify and categorize new extremist narratives as they appear online.

Summary updated

BibTeX
@misc{ghilene2024analysis,
  author = {Rayane Ghilene and Dimitra Niaouri and Michele Linardi and Julien Longhi},
  title = {{Analysis of Socially Unacceptable Discourse with Zero-shot Learning}},
  year = {2024},
  eprint = {2409.13735},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.13735},
}
Figure