Hate speech classifiers make two opposite mistakes. They flag harmless sentences because they contain a word like "Muslim" or "gay", and they miss hateful sentences that contain no slur at all. Both mistakes have one root cause. The classifier scores words one at a time and never checks whether something demeaning is actually being said about a group. "Refugees are rabid foxes" and "Calling refugees rabid foxes is disgusting" share almost every word, but only the first predicates the insult of the target. This proposal trains classifiers so that their toxicity score comes from the joint effect of a target mention and the phrase applied to it. It penalizes the score the target word earns on its own. It then tests whether the model's own internal grammar, the soft dependency structure that emerges in pretrained transformers, carries that joint effect.
In two sentences: we replace "which tokens matter" supervision with "which target–predicate pair matters" supervision, measured by masking the target and the predicate separately and together. We evaluate on minimal pairs that change only the grammatical relation, such as negation, reported speech, or counter-speech, and hold out entire construction types to see whether models learned the relation or the template.
Core Claim
A detector regularized to use the interaction between target and predicate, and not the main effect of the identity term, will reduce false positives on identity-bearing benign text. It will also stay accurate on implicit hate, and it will generalize to grammatical constructions it never saw. Flat rationale supervision and identity-list penalties cannot do this, because they treat explanations as bags of tokens. Because the signal is computed from the classifier's actual output under masking, and not from attention weights, it is faithful by construction. This sidesteps the plausibility-versus-faithfulness problem that attention supervision inherits.
Write $f(x)$ for the toxicity logit on input $x$. Write $x_{\setminus t}$ for $x$ with the target span $t$ replaced by a mask token, and define $x_{\setminus p}$ and $x_{\setminus tp}$ in the same way for the predicate span $p$ and for both spans. The target's main effect and the target–predicate interaction are then
$$M(t)=f(x_{\setminus p})-f(x_{\setminus tp}),\qquad I(t,p)=f(x)-f(x_{\setminus t})-f(x_{\setminus p})+f(x_{\setminus tp}).$$
$M(t)$ is how much the identity term pushes toward "toxic" when nothing derogatory is attached to it. This is keyword bias, measured per example. $I(t,p)$ is how much toxicity arises only from their combination. Training minimizes cross-entropy plus $\lambda\,M(t)^2$ on all examples with an annotated target, plus a hinge term $\mu\max(0,\gamma-I(t,p))$ on hateful examples. Here $\lambda$, $\mu$ and the margin $\gamma$ are tuned on development data.
Relation to Prior Work
Several papers motivate the gap by showing that token-level fixes leave the relation unmodeled. Contextualizing Hate Speech Classifiers with Post-hoc Explanation penalizes occlusion-based importance on a fixed list of 25 identity words and raises accuracy on benign New York Times sentences from about 77.8% to 90.1%. That method penalizes the identity word in full context, so it can also suppress the word when it genuinely anchors an attack, and it cannot reach targets outside the list. Our $M(t)$ term penalizes the target only when the predicate is absent. It uses annotated target spans, not a word list.
Features or Spurious Artifacts? finds that masking identity terms preserves the sentence frame and cuts false positives by up to 3x, but hurts out-of-distribution F1. We reuse its masking choice inside our occlusions, because it keeps the grammatical slot intact. We never mask at inference, so the model keeps access to who is targeted.
HateXplain and Aligning Attention with Human Rationales align classifier attention with flat human rationale masks. The second raises explanation overlap from 0.130 to 0.539 IoU F1. Both note, or leave open, that aligned attention need not drive the prediction, and both treat "rabid foxes" and "refugees" as independent highlights. We keep their rationales as the source of predicate spans but replace attention alignment with an output-level interaction objective.
AmpleHate models target–context relations with a spaCy named-entity tagger and a cross-attention vector injected into the sentence embedding. Its authors acknowledge that the method fails when the tagger misses colloquial targets. Our method needs targets only at training time and adds no inference-time pipeline.
Two papers constrain the design. Evaluating distillation methods for data-efficient syntax learning finds that distilling attention matrices barely helps syntax learning compared with distilling output logits. This suggests that grammatical knowledge is spread across the network rather than sitting in attention heads. Attention Can Reflect Syntactic Structure (If You Let It) finds that trees decoded from raw multilingual BERT attention reach only 50–60% undirected unlabeled attachment score (the fraction of correct word–word links, ignoring direction and label). That is barely above a positional baseline, though fine-tuning raises it to 70–80%. We therefore do not supervise attention. We use attention-decoded structure only as an analysis tool.
Explore Unsupervised Structures in Pretrained Models for Relation Extraction supplies the analysis method. It mines structure from a pretrained model with attention, occlusion and gradients, and finds that this structure beats external parsers for relation extraction.
Probing Critical Learning Dynamics of PLMs for Hate Speech Detection hypothesizes, without syntactic probing, that formal-syntax specialization during pretraining hurts hate detection. Our analysis can test a narrow version of that hypothesis.
Research Program
The first artifact is a structural minimal-pair suite. It is built from hateful posts in HateXplain and the Implicit Hate Corpus (Latent Hatred). Each hateful post is rewritten into benign variants that keep the target and the derogatory phrase but change the grammatical relation. The construction families are:
- Negation and denial: "it is false that…".
- Reported speech with condemnation.
- Counter-speech quoting.
- Argument swap: the derogatory predicate attaches to a non-group entity, such as a policy or a named troll.
- Embedding under a question or hypothetical.
Candidates are produced with a language model and every pair is verified by two annotators. Pairs whose benign reading is disputed are dropped. The main metric is pair accuracy: the hateful original must be flagged and its rewrite must not.
The second artifact is the interaction-regularized classifier described above. It is trained on HateXplain, whose rationales give predicate spans and whose target-community labels are string-matched to target spans, with manual repair on the training split. It is also trained on the Social Bias Inference Corpus (Social Bias Frames), whose targeted-group field is aligned to spans. Backbones are BERT and RoBERTa.
The third component is an internal-structure analysis. For each trained model, we decode dependency trees from attention with maximum spanning tree decoding, following the decoding procedure of Attention Can Reflect Syntactic Structure. We record whether the target–predicate link is recovered and which heads carry it. We then mean-ablate those heads and measure the drop in pair accuracy and in $I(t,p)$. Matched random heads are ablated as a control. This tests whether the regularizer makes the decision depend on emergent syntactic links. If ablation does nothing, that is also informative: it would confirm, for this task, the distillation paper's view that the relation lives outside attention. As a secondary check on the early-peak hypothesis, we run the same arc-recovery measurement on RoBERTa's intermediate pretraining checkpoints for posts from the social-media datasets.
Baselines
The naive reference is standard cross-entropy fine-tuning of the same backbone on the same training data. HateXplain reports a best HateXplain Macro F1 of 0.687 and an area under the ROC curve (AUROC) of 0.851 for its rationale-supervised BERT. Our re-run plain baseline should land near these numbers, which serves as a sanity check.
The strongest bias-mitigation competitor is the occlusion regularizer of Contextualizing Hate Speech Classifiers, which reports 90.1% NYT accuracy. We run it twice: once with its original 25-word list, and once with our annotated target spans. The second run separates "better target coverage" from "interaction objective".
The strongest explanation-alignment competitor is supervised rational attention, from Aligning Attention with Human Rationales. It reports Macro F1 0.682, IoU F1 0.539 and token precision 0.938 on HateXplain. We run it on identical rationales.
The strongest implicit-detection competitor is AmpleHate. It reports an average 6.87-point gain over contrastive baselines, but no per-dataset scores were found on Lacuna, so we re-run its released configuration on our splits. We also include ImpCon (Generalizable Implicit Hate Speech Detection Using Contrastive Learning), which reports cross-dataset gains of up to 9.10% on BERT. For the Implicit Hate Corpus, the reported reference is a binary F1 of 70.4 for BERT with augmentation (Latent Hatred).
Two further baselines address the obvious substitutes. A parser baseline adds the spaCy dependency distance between target and every token as an extra feature, routed through a graph convolution layer. A counterfactual augmentation baseline trains on minimal pairs from the construction families seen in training.
Two ablations isolate the key ingredient. One keeps only the $M(t)$ penalty. The other keeps only the interaction hinge.
All methods share the same backbone, data, and hyperparameter search budget: twenty trials per method on HateXplain development macro-F1 plus development pair accuracy. All runs use five random seeds.
Beating the field means meeting two conditions at once:
- Higher pair accuracy on held-out construction families than every baseline, by a margin outside seed variance.
- NYT benign accuracy at or above the re-run occlusion regularizer, while in-distribution HateXplain Macro F1 stays within one point of the plain baseline.
Why not just…?
Why not just fine-tune a larger model or prompt an LLM? Scale does not obviously fix relational errors. Standard BERT reaches only 58.6 F1 on six-way implicit hate (Latent Hatred). Tox-BART finds GPT-3.5 producing vague explanations that do not commit to the specific hateful claim. We include a larger RoBERTa and a prompted instruction-tuned model on the minimal-pair suite. If they already solve held-out constructions, the method is unnecessary at that scale, and we will report this.
Why not just train on counterfactual minimal pairs? This is the real threat. On constructions it sees, augmentation may match or beat our method. The decisive comparison therefore holds out whole construction families. Augmentation teaches templates, while the interaction objective is construction-agnostic and applies to every annotated training post. If augmentation matches us on held-out families too, our contribution shrinks to the suite and the analysis. Combining the two is the natural follow-up.
Why not just parse with spaCy and feed the dependency path? Relation extraction results show that parser structure loses to structure mined from the model itself on clean text (Explore Unsupervised Structures). AmpleHate's authors attribute failures to the same pipeline on informal text. The parser baseline tests this directly on social media data. We additionally break down errors by whether spaCy recovers the target–predicate arc.
Why not just supervise attention with rationales or with gold trees? Attention supervision raises plausibility without guaranteeing faithfulness (HateXplain). Attention-level distillation fails to transfer syntax (Evaluating distillation methods). Our objective acts on output changes under masking, so it is faithful by definition. The supervised rational attention baseline measures what flat alignment buys on relational pairs.
Decisive Experiments
The central test trains on HateXplain and SBIC, then evaluates on four things:
- Held-out construction families of the minimal-pair suite.
- The NYT benign identity set (Contextualizing Hate Speech Classifiers).
- Out-of-distribution transfer to the Implicit Hate Corpus, Toxigen and DynaHate, measured with macro-F1 to probe the trade-off reported by Features or Spurious Artifacts?.
- HateXplain subgroup bias AUC (GMB-Subgroup and GMB-BNSP).
The hypothesis fails if held-out pair accuracy does not exceed that of the counterfactual augmentation baseline. It also fails if gains on NYT come only from the $M(t)$ term, which would mean we rebuilt the occlusion regularizer with better word coverage.
The mechanistic check asks two questions. Does regularization raise recovery of the target–predicate arc in attention-decoded trees? And does ablating the arc-carrying heads reduce $I(t,p)$ and pair accuracy more than ablating random heads? A positive result would show that implicit-harm decisions can be routed through the model's emergent grammar. A null result would locate the relation outside attention and shape how future structural methods for toxicity should be built.
References
- Contextualizing Hate Speech Classifiers with Post-hoc Explanation
- Features or Spurious Artifacts? Data-centric Baselines for Fair and Robust Hate Speech Detection
- HateXplain: A Benchmark Dataset for Explainable Hate Speech Detection
- Aligning Attention with Human Rationales for Self-Explaining Hate Speech Detection
- AmpleHate: Amplifying the Attention for Versatile Implicit Hate Detection
- Evaluating distillation methods for data-efficient syntax learning
- Attention Can Reflect Syntactic Structure (If You Let It)
- Explore Unsupervised Structures in Pretrained Models for Relation Extraction
- Probing Critical Learning Dynamics of PLMs for Hate Speech Detection
- Latent Hatred: A Benchmark for Understanding Implicit Hate Speech
- Social Bias Frames: Reasoning about Social and Power Implications of Language
- Generalizable Implicit Hate Speech Detection Using Contrastive Learning
- Tox-BART: Leveraging Toxicity Attributes for Explanation Generation of Implicit Hate Speech