[Paper Review] Contextualizing Hate Speech Classifiers with Post-hoc Explanation
This paper proposes a novel regularization technique that uses post-hoc explanations from the Sampling and Occlusion (SOC) method to make BERT-based hate speech classifiers more context-sensitive to group identifiers like 'gay' or 'black'. By reducing over-reliance on these terms and increasing attention to contextual cues such as dehumanizing language, the method significantly reduces false positives on out-of-domain data while maintaining or improving in-domain performance.
Hate speech classifiers trained on imbalanced datasets struggle to determine if group identifiers like "gay" or "black" are used in offensive or prejudiced ways. Such biases manifest in false positives when these identifiers are present, due to models' inability to learn the contexts which constitute a hateful usage of identifiers. We extract SOC post-hoc explanations from fine-tuned BERT classifiers to efficiently detect bias towards identity terms. Then, we propose a novel regularization technique based on these explanations that encourages models to learn from the context of group identifiers in addition to the identifiers themselves. Our approach improved over baselines in limiting false positives on out-of-domain data while maintaining or improving in-domain performance. Project page: https://inklab.usc.edu/contextualize-hate-speech/.
Motivation & Objective
- To address the problem of hate speech classifiers producing false positives when group identifiers like 'gay' or 'black' appear in non-offensive contexts.
- To improve model generalization on out-of-domain data by reducing over-reliance on high-frequency identity terms in imbalanced datasets.
- To develop a regularization technique that enhances contextual understanding of identity terms without requiring data augmentation or model retraining from scratch.
- To integrate explanation-based feedback into fine-tuned BERT models to guide learning toward more generalizable hate speech features.
Proposed method
- Applying the Sampling and Occlusion (SOC) post-hoc explanation algorithm to extract feature importance scores for group identifiers in fine-tuned BERT classifiers.
- Using SOC explanations to identify that models disproportionately attend to identity terms rather than contextual features like dehumanizing language.
- Proposing a novel regularization loss that penalizes high importance assigned to identity terms during training, encouraging models to focus on surrounding context.
- Training BERT models with a combined loss: standard cross-entropy loss and a regularization term based on SOC explanation scores.
- Filtering out identity terms from the input during training via a word removal baseline for comparison.
- Evaluating model performance on in-domain hate speech detection and out-of-domain test sets (e.g., NYT corpus) to measure false positive reduction.
Experimental results
Research questions
- RQ1Can post-hoc explanations from SOC effectively reveal model bias toward identity terms in hate speech detection?
- RQ2Does regularizing model attention toward identity terms using SOC explanations reduce false positives on out-of-domain data?
- RQ3How does explanation-based regularization compare to word removal in preserving in-domain hate speech detection performance?
- RQ4To what extent does regularization shift model focus from identity terms to more generalizable hate speech cues like insults or dehumanization?
Key findings
- Regularization using SOC explanations reduced the false positive rate on the out-of-domain NYT corpus by significantly decreasing over-reliance on identity terms.
- On the in-domain Gab Hate Corpus, the method maintained or improved F1 scores compared to the baseline BERT model, indicating no performance degradation.
- The model showed increased attention to contextual hate speech cues such as 'blamed', 'poisoned', and 'dehumanizing' after regularization, as measured by SOC explanation shifts.
- Compared to word removal, SOC-based regularization achieved better recall, suggesting it mitigates bias without sacrificing detection of actual hate speech.
- Visualizations confirmed that regularization corrected false positives by reducing the model’s attention to identity terms and increasing sensitivity to contextual features.
- The approach successfully improved model context-sensitivity without requiring data augmentation or architectural changes to BERT.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.