Aligning Attention with Human Rationales for Self-Explaining Hate Speech Detection

Brage Eilertsen, Røskva Bjørgfinsdóttir, Francielle Vargas, Ali Ramezani-Kebrya · DOI

Introduction

Automated hate speech detection is a critical yet challenging task. Most deep learning models operate as "black boxes," leading to two primary issues: unreliability and bias. Models often rely on "shortcuts," such as flagging identity terms (e.g., "Muslim" or "Gay") regardless of context, rather than identifying genuine harm. This oversensitivity can marginalize the very communities the systems are intended to protect.

While post-hoc explanation methods like LIME or SHAP attempt to interpret these decisions, they are computationally intensive and may not accurately reflect the model's internal logic. This research introduces Supervised Rational Attention (SRA), a framework designed to create inherently transparent and fair "self-explaining" models. By aligning model attention with human-annotated rationales, SRA achieves a 2.4x improvement in explainability and reduces systematic biases without sacrificing classification accuracy.

Methodology: Supervised Rational Attention (SRA)

The SRA framework forces Transformer models to align their internal attention mechanisms with human-annotated rationales—specific text snippets that justify a classification label.

Attention Alignment Loss (AAL)

The core innovation is a new loss term that calculates the Mean Squared Error (MSE) between the model’s attention weights (derived from the [CLS] token) and a binary mask representing human rationales. The model is trained using a joint objective: $$\ell_{total} = \ell_{classification} + \alpha \cdot \ell_{alignment}$$ The hyperparameter $\alpha$ controls the strength of the alignment constraint. By training the attention mechanism to be meaningful, the model provides intrinsic explanations at inference time without requiring additional post-hoc tools. The framework was evaluated using standard architectures such as BERT and BERTimbau.

Experimental Setup

The study utilizes two major benchmarks featuring token-level human rationales:

  • HateXplain (English): Approximately 20,000 social media posts categorized as normal, offensive, or hate speech, with high inter-annotator agreement on rationales.
  • HateBRXplain (Portuguese): A dataset of 7,000 Instagram samples, demonstrating SRA's cross-linguistic applicability.

Results and Analysis

SRA demonstrates a significant leap in explainability while maintaining competitive classification performance.

Performance comparison of SRA against baseline models across classification, explainability, bias, and faithfulness metrics.

Explainability and Performance

As shown in the results table, SRA achieved a 0.539 IoU F1 score (measuring overlap with human highlights), a massive improvement over the 0.130 score of a standard BERT model. Crucially, this transparency does not come at the cost of accuracy; the Macro F1 score remained stable (0.682 for SRA vs. 0.699 for the best baseline). The model also achieved a high token precision of 0.938, indicating that its highlights strongly correlate with human judgment.

Bias Reduction

SRA effectively reduces systematic bias. By forcing the model to justify labels through specific rationales, it becomes less likely to trigger false positives based solely on the presence of identity terms in neutral contexts. SRA achieved the second-best performance in the GMB-BNSP metric, which specifically evaluates a model's ability to avoid false positives in toxic posts mentioning identity groups.

Handling Implicit Hate

A key insight is SRA's superior handling of implicit hate speech. Baseline models often focus on neutral framing terms, whereas SRA shifts focus to sentiment-critical and dehumanizing language.

Qualitative comparison of attention weights between a baseline model and SRA on an implicit hate speech example.

In the "Refugee Example" above, the baseline model fails to capture the dehumanizing metaphor comparing refugees to "rabid foxes." In contrast, the SRA-trained model correctly identifies "rabid" and "foxes" as the core components of the hateful rationale.

Conclusion and Future Work

SRA represents a significant step toward trustworthy hate speech detection by aligning model attention with human reasoning. While the framework relies on expensive rationale-annotated data and faces challenges with human subjectivity, it offers a robust path toward reducing bias and increasing transparency. Future research may explore using Large Language Models (LLMs) to automatically generate rationales, potentially alleviating the data bottleneck.

Summary updated

BibTeX
@inproceedings{eilertsen2026aligning,
  author = {Brage Eilertsen and Røskva Bjørgfinsdóttir and Francielle Vargas and Ali Ramezani-Kebrya},
  title = {{Aligning Attention with Human Rationales for Self-Explaining Hate Speech Detection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i44.41069},
}
Figure