ToKen: Task Decomposition and Knowledge Infusion for Few-Shot Hate Speech Detection

Badr AlKhamissi, Faisal Ladhak, Srini Iyer, Ves Stoyanov, Zornitsa Kozareva, Xian Li, Pascale Fung, Lambert Mathias, Asli Celikyilmaz, Mona Diab

This paper, titled "ToKen: Task Decomposition and Knowledge Infusion for Few-Shot Hate Speech Detection," presents a novel framework for tackling one of the most challenging problems in natural language processing: identifying hate speech (HS) when training data is extremely scarce.

TL;DR

ToKen improves few-shot hate speech detection by breaking the problem into logical subtasks and infusing the model with external commonsense and stereotype knowledge. This approach yields a massive 17.83% absolute F1 gain in 16-shot scenarios and significantly enhances the model's ability to generalize to new, unseen datasets.

What Problem Does This Paper Address?

Hate speech detection is notoriously difficult because it isn't just about spotting "bad words." It requires an understanding of social nuance, cultural context, and the subtle ways stereotypes are invoked. Furthermore, high-quality, large-scale annotated datasets for HS are rare and expensive to produce.

Current models often struggle in "few-shot" settings—where they only see a handful of examples—and frequently fail to generalize to "out-of-distribution" (OOD) data (e.g., a model trained on Twitter data failing on Reddit). The authors also highlight a lack of explainability: when a standard binary classifier fails, it’s hard to know if it missed the offensiveness of the post or failed to recognize that a specific group was being targeted.

Methods

The authors propose ToKen, a method built on two main pillars:

  1. Task Decomposition: Instead of treating HS detection as a simple binary classification ($Input \rightarrow \{Yes/No\}$), they treat it as a sequence of logical inferences. The model is tasked with generating a string that answers:
  2. Is the post offensive?
  3. Does it target a group, an individual, or neither?
  4. Which specific minority group is being targeted?
  5. Finally, is it hate speech?

    This "chain-of-thought" style approach forces the model to reason through the definitional criteria of hate speech before making a final judgment.

  6. Knowledge Infusion: The authors pre-finetune a BART-Large model on two specialized datasets:

  7. ATOMIC2020: A massive commonsense knowledge graph. They convert these tuples into human-readable templates to teach the model social cause-and-effect.
  8. StereoSet: A dataset designed to measure stereotype bias, helping the model recognize common tropes used against specific groups.
Figure 1: Hate Speech decomposed into several sub- tasks leading to better results.

Datasets

  • SBIC (Social Bias Inference Corpus): The primary dataset used for few-shot training and validation. It contains rich annotations for offensiveness and target groups.
  • ATOMIC2020 & StereoSet: Used for the "Knowledge Infusion" phase.
  • HateXplain, HS18 (Stormfront), and Ethos: Used as out-of-distribution (OOD) benchmarks to test how well the model generalizes to different platforms and types of hateful content.

Key Insights and Ideas

  • The "Group Detection" Bottleneck: Through fine-grained error analysis, the authors discovered that identifying whether a group is targeted is significantly harder for models than identifying offensiveness.
  • Naming the Target Helps: Interestingly, requiring the model to identify the specific group (e.g., "Women," "Ethiopians") actually improves its ability to detect that a group was targeted in the first place.
  • Synergy of Methods: Knowledge infusion alone provides inconsistent gains. However, when combined with task decomposition, it allows the model to better understand the relationships between the subtasks, leading to the best overall performance.
  • Built-in Explainability: Because the model outputs intermediate labels, researchers can pinpoint failure modes. For example, a model might correctly identify a post as offensive but fail because it incorrectly labeled the target as an "individual" rather than a "group."
Figure 2: Examples from the SBIC dataset. The post is classified as HS if it is Offensive and a Group is referenced as the target of the offensive speech.

Key Results

  • Massive Few-Shot Gains: In the 16-shot setting, ToKen achieved a 58.89% F1 score, compared to just 45.31% for the baseline—an absolute improvement of 17.83%.
  • Superior Generalization: ToKen consistently outperformed baselines across all three OOD datasets (HateXplain, HS18, Ethos) in zero-shot evaluations.
  • Increased Robustness: The ToKen models showed much lower variance across different training seeds and hyperparameters compared to the baseline, making them more reliable for real-world deployment.
Figure 3: (a) The validation F1-score of the Offensiveness subtask for the minimal decomposition and task- decomposed models. (b) Similarly, this is the validation F1-score for the Group Detection subtask. It can be seen that adding the Group Identification subtask improves the performance dramatically. (c) Testing Performance of Baseline vs the Task Decomposed model. Random performance plotted for reference.

Limitations and Future Work

  • Model Scale: The authors found that these benefits are most prominent in larger models like BART-Large. When testing with BART-Base, the baseline sometimes outperformed the decomposed model as the data size increased, suggesting that "scale matters" for handling complex subtasks.
  • Cultural Bias: The datasets used are primarily from a Western perspective and in English. The authors acknowledge that hate speech nuances vary wildly across cultures and languages.
  • Annotation Silencing: Labels were determined by majority vote, which can sometimes silence the perspectives of minority groups who may perceive harm differently than the majority.
  • Future Directions: The team plans to explore these methods in low-resource languages and investigate how to incorporate natural language explanations (rationales) directly into the subtask chain.

Summary updated

BibTeX
@inproceedings{alkhamissi2022token,
  author = {Badr AlKhamissi and Faisal Ladhak and Srini Iyer and Ves Stoyanov and Zornitsa Kozareva and Xian Li and Pascale Fung and Lambert Mathias and Asli Celikyilmaz and Mona Diab},
  title = {{ToKen: Task Decomposition and Knowledge Infusion for Few-Shot Hate Speech Detection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=Ny3UP3qxT3},
}
Figure