Rationale-Guided Few-Shot Classification to Detect Abusive Language

Punyajoy Saha, Divyanshu Sheth, Kushal Kedia, Binny Mathew, Animesh MukherjeearXiv 2022

TL;DR

This paper introduces RGFS (Rationale-Guided Few-Shot Classification), a framework that improves abusive language detection by teaching models to focus on "rationales"—the specific spans of text that justify a label. By integrating these rationales into an attention-based architecture, the authors achieve a ~7% boost in classification performance in cross-domain, few-shot settings while providing more human-plausible explanations than standard post-hoc methods like LIME or SHAP.

What Problem Does This Paper Address?

Detecting abusive language is a "moving target." A model trained on Twitter data from 2018 might fail miserably on Gab posts from 2022 due to domain shift—changes in slang, targeted communities, and platform-specific nuances.

While "few-shot learning" (training on just a handful of examples from a new domain) is a common fix, models often overfit to "artifacts"—spurious correlations like specific usernames or neutral words that happen to appear in the few training samples. Furthermore, most detection models are "black boxes," offering no explanation for why a post was flagged. The authors hypothesize that the "nucleus" of abusiveness lies in specific text spans; by guiding models to attend to these rationales, they can improve both generalization and explainability.

Methods

The authors propose a two-stage approach:

  1. Rationale Extraction (BERT-RLT): They first build a multitask learning setup using BERT. The model is trained to simultaneously predict the Label (hate, offensive, or normal), the Rationale (token-level classification of which words are abusive), and the Target (the community being attacked). They found that learning these tasks jointly improves rationale detection by 6% over training a rationale classifier alone.
  2. Rationale-Guided Classification (RGFS): They introduce two architectures that use the predicted rationale scores to weight the importance of tokens before final classification:
  3. RGFS-SA (Self-Attention): Multiplies BERT's hidden states by the rationale scores and then applies a multi-headed self-attention layer.
  4. RGFS-CA (Cross-Attention): Uses the sentence-level representation (CLS token) as a query to attend over the rationale-weighted hidden states.
The RGFS-SA architecture, showing how rationale scores (R) weight the token representations before self-attention.

Crucially, in the few-shot setting, the rationale extractor is pre-trained on a source dataset and then "frozen," preventing the model from overfitting to the small number of samples in the new target domain.

Datasets

The study utilizes several prominent abusive language benchmarks:

  • HateXplain (HX): The primary source for training the rationale extractor, as it contains human-annotated spans for ~20k posts.
  • Evaluation Datasets: To test cross-domain performance, they use Davidson (DA), Founta (FA), OLID (OD), Basile (BA), and Waseem & Hovy (WH).
Summary of the datasets used, showing the variety in labels and sizes.

For evaluation, the authors also manually annotated rationales for 50 abusive samples from each of the five target datasets to create a "gold standard" for explainability metrics.

Key Insights and Ideas

  • Multitask Synergy: Training a model to identify who is being targeted and why (rationales) significantly helps it identify if a post is abusive.
  • Rationales as Anchors: In low-data regimes (50-200 samples), human-like rationales act as a stabilizer. Instead of the model guessing based on random artifacts, the rationale-guidance forces it to look at the "nucleus" of the abuse.
  • Plausibility vs. Faithfulness: The authors distinguish between plausibility (does the explanation make sense to a human?) and faithfulness (does the explanation actually reflect the model's internal logic?). RGFS rationales are far more plausible than those generated by LIME or SHAP, which often highlight irrelevant words like "if" or "user."

Key Results

  • Classification Boost: In the few-shot setting (e.g., 100 samples per label), RGFS-SA outperformed standard BERT baselines by approximately 7% in macro F1 score across various datasets.
  • Superior Explanations: RGFS models achieved significantly higher AUPRC and token-F1 scores for rationale prediction compared to LIME and SHAP. For instance, on the Davidson dataset, RGFS reached an AUPRC of 0.84 compared to LIME's 0.77 and SHAP's 0.45.
  • Efficiency: Generating explanations via the RGFS framework is roughly 7 times faster than using LIME, making it more viable for real-time moderation systems.
Comparison of few-shot performance, highlighting that RGFS models (bolded) consistently outperform standard BERT-L.

Limitations and Future Work

  • Subjectivity: The authors acknowledge that definitions of "abuse" vary wildly across datasets and annotators, which is an inherent challenge in the field.
  • Zero-Shot Rationale Errors: While the rationale predictor generalizes well, it is not perfect. Errors in the rationale stage can propagate to the classification stage.
  • Future Directions: The researchers plan to create a detailed typology of classification and rationale errors and extend the RGFS framework to multilingual settings, where annotated data is even scarcer.

Summary updated

Abstract

Abusive language is a concerning problem in online social media. Past research on detecting abusive language covers different platforms, languages, demographies, etc. However, models trained using these datasets do not perform well in cross-domain evaluation settings. To overcome this, a common strategy is to use a few samples from the target domain to train models to get better performance in that domain (cross-domain few-shot training). However, this might cause the models to overfit the artefacts of those samples. A compelling solution could be to guide the models toward rationales, i.e., spans of text that justify the text's label. This method has been found to improve model performance in the in-domain setting across various NLP tasks. In this paper, we propose RGFS (Rationale-Guided Few-Shot Classification) for abusive language detection. We first build a multitask learning setup to jointly learn rationales, targets, and labels, and find a significant improvement of 6% macro F1 on the rationale detection task over training solely rationale classifiers. We introduce two rationale-integrated BERT-based architectures (the RGFS models) and evaluate our systems over five different abusive language datasets, finding that in the few-shot classification setting, RGFS-based models outperform baseline models by about 7% in macro F1 scores and perform competitively to models finetuned on other source domains. Furthermore, RGFS-based models outperform LIME/SHAP-based approaches in terms of plausibility and are close in performance in terms of faithfulness.
BibTeX
@misc{saha2022rationale,
  author = {Punyajoy Saha and Divyanshu Sheth and Kushal Kedia and Binny Mathew and Animesh Mukherjee},
  title = {{Rationale-Guided Few-Shot Classification to Detect Abusive Language}},
  year = {2022},
  eprint = {2211.17046},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.17046},
}

Loading related content...

Figure