Elamur Research

Robust Hate Speech Detection in Social Media: A Cross-Dataset Empirical Evaluation

Paper · 2023 · Dimosthenis Antypas and Jose Camacho-Collados

Summary

A hate speech detector can perform well on the kind of posts it saw during training and struggle when the subject, wording, or source changes. Antypas and Camacho-Collados investigate how much of that difficulty comes from the training data. A collection built around an election, for example, may teach a detector to recognize hostility in political exchanges while giving it little practice with other forms of hate. The authors test what happens when they train on collections one at a time and when they combine them.

They bring together 13 existing datasets, retaining English tweets and translating the original labels into a common format. The resulting collection contains 83,230 tweets for the binary task, which asks whether a post contains hate speech. A separate task asks the classifier to identify a broad type of hate, such as racism or sexism. The authors compare classifiers trained on individual collections, on the full pool, and on smaller, class-balanced samples drawn across the collections. They also build an independent test set of tweets gathered around events concerning women’s rights and LGBTQ people.

Pooling improved the average binary result across the existing test sets for every classifier in the study. TimeLMs-21, a system previously trained on Twitter text, reached 70.7 macro-F1 on that average with the full pool, compared with 61.0 using its strongest individual training collection. Macro-F1 gives each class equal weight and accounts for both missed cases and incorrect predictions. The smaller pooled samples also beat their respective single-source comparisons on average. On the independent test, the highest reported score was 78.3 macro-F1, achieved by RoBERTa trained on a smaller, balanced sample.

The gains extend to the task of identifying types of hate. With HateX as the sole training source, every evaluated classifier scored zero on the disability class. Training on the pooled data raised performance on that class and improved the overall scores. The error analysis shows where the approach still struggles. A short tweet can leave its intended target unclear, and profanity can occur in friendly speech. The experiments establish that combining these English Twitter collections makes the classifiers less dependent on any one collection’s conventions. How well those classifiers travel across languages, platforms, and annotation policies remains open.

Deep dive: Robust Hate Speech Detection in Social Media: A Cross-Dataset Empirical Evaluation

Antypas and Camacho-Collados test whether training on several Twitter datasets improves hate speech detection on unfamiliar data. · about 35 minutes to read

The problem and its context

What a detector learns from a collection

Hate speech detection is a kind of text classification. Given a piece of writing, a classifier assigns it a label from a defined set. In the simplest version of the task, each post receives a hate or non-hate label. A more detailed scheme can distinguish forms of hate, indicate who is targeted, or record other features that matter to the people building the dataset. The choice of labels determines what a detector can be trained to predict and what an evaluation can measure.

The paper situates that task in a setting where people produce large volumes of short, frequently unstructured text. The ways people express hostility can change with events, time, and place. Hate speech also covers several kinds of targeting, including attacks related to race, sex, and sexual orientation. The difficulty therefore concerns both the scale of the material and the range of meanings that a short message can carry. Automatic detection interests the authors partly because it can help researchers track the extent and character of online hate.

A supervised classifier learns from posts that people have already labeled. The labels supply examples of what counts as a successful distinction. Collecting those examples involves choices about where to look, which words to search for, and which judgments to record. If a team searches for terms linked to racism and sexism, its collection can be rich in examples of those topics. Other types of hate may rarely appear. Even within the topics it covers, the collection may favor expressions that happen to contain the search terms.

The same issue applies to the posts labeled non-hate. In an election collection, they can include ordinary disagreement and criticism about the people and events used to gather the tweets. In a collection built with offensive words, they may include profanity used casually. These are different examples of what a detector should let pass. A classifier can get extensive practice distinguishing one kind of harmless speech from hate and have few examples of another. This helps explain the paper’s interest in the data behind both classes.

How earlier work defined and collected the task

The paper describes earlier work as using a range of supervised approaches. Its account of their difficulties emphasizes the resources on which they depend. Some datasets focus on specific targets. Others use keyword searches, and others have particular class distributions. These choices were frequently appropriate to the original research question. Their consequences become important when someone trains a general-purpose hate detector on the resulting collection.

The political corpus used in the study illustrates a source with a particular subject. Its authors retrieved tweets using keywords associated with candidates in the 2020 US presidential election. They annotated stance toward the candidates as well as hateful language. For research about an election, that combination lets investigators distinguish a tweet’s political position from its use of hate. In the cross-dataset study, the corpus also represents a training source whose coverage is shaped by a specific event and search strategy. Hate Towards the Political Opponent

A different line of work concerns the distinction between hate and offense. One collection searched for tweets using keywords and then asked people to distinguish hateful speech, offensive speech without hate, and speech that fell into neither category. That annotation scheme preserves a boundary that a general offensiveness label would leave unresolved. In a pooled resource, preserving the distinction requires attention to how each dataset defines the original negative class. Automated Hate Speech Detection and the Problem of Offensive Language

Other collections narrow the targets while keeping a broad decision about hate. HatE concerns tweets directed at immigrants and women. This makes it possible to study those targets in depth and gives a detector examples associated with them. A separate collection identifies racism and sexism, and related work adds a label for tweets assigned both categories. The presence of a combined category matters when a later study asks each post to receive a label from a common scheme. HatE · Hateful Symbols or Hateful People? · Are You a Racist or Am I Seeing Things?

The authors also cite evidence that performance can change with the time period used for testing. They place their work alongside research that treats generalization across corpora and topics as a research problem in its own right. Time matters here even though the paper does not organize its experiments as a chronological forecast. A corpus gathered during a particular event contains a vocabulary, set of targets, and range of situations associated with that event. Movement between corpora can therefore involve several kinds of change at once.

Why changing the test source matters

An ordinary evaluation sets some examples aside and checks whether a classifier can label those unseen posts. If the training and test examples come from the same collection, the test is still valuable. It shows how well the training procedure works on fresh examples gathered and labeled in much the same way. The score belongs to that setting. A separate question is whether the classifier can make the same distinction when the messages come from another collection whose builders made different choices.

This motivates the paper’s cross-dataset design. Each source can be considered in two roles. As training data, it supplies the examples from which a classifier learns. As test data, it supplies a particular challenge and the judgments used to score responses. A collection can be challenging as a test because its topic is uncommon elsewhere. A collection can also be useful for training some distinctions and have limited overall reach. Success in either role has to be assessed against the other datasets in the comparison.

There are two practical questions behind the design. The first is whether the weaknesses of individual sources become visible when the test source changes. The second is whether combining resources leads to improvement simply because the resulting collection is larger. The full pool addresses the practical question of what happens when all the available training material is used. Smaller pooled samples make the comparison more informative by putting classifiers trained on several sources alongside classifiers trained on one source with nearly the same number of examples.

The target-group task introduces a related problem. A binary answer can register that a post is hateful while leaving the type of hate unspecified. A target label can expose differences that the binary task folds together, but it is harder to assemble reliable training material for that task. Some resources record only the presence of hate. Others name very specific targets. A common classification scheme therefore has to be detailed enough to preserve useful distinctions and broad enough to support evaluation across sources.

The method, step by step

Start with datasets built for different purposes

The authors assemble 13 social media datasets. The selection includes resources centered on particular targets, broad collections of abusive speech, and projects that had already distinguished hate from offense. Several resources contain material outside English Twitter. The authors use them as sources from which to construct a more consistent collection, so a source’s original size describes its scope before the filters used in this study.

Measuring Hate Speech, abbreviated MHS, began with 39,565 annotated comments from Twitter, Reddit, and YouTube. Annotators assessed 10 attributes and indicated a target where applicable. The original project combined those judgments into a continuous hate score. That score can represent degrees of hate, whereas the unified binary task requires a discrete decision. For MHS, constructing the new task therefore involves translating an existing measurement into a label.

Call Me Sexist, But, or CMS, had 6,325 entries in its original form. Its creators combined material from psychological scales with tweets collected using the expression in the title and material from earlier sexism datasets that they annotated again. Their judgments distinguished content from phrasing. The source is useful to the pooling experiment because it represents a specific category of hate and includes distinctions about how a message is expressed. The text of a tweet can be civil in form even when an annotator sees sexism in its content.

Hate Towards the Political Opponent, abbreviated HTPO, supplied a collection of 3,000 tweets associated with the 2020 US election. Its hate annotation could be used directly for the binary decision after the common preprocessing. The stance information illustrates the extra judgments that can be present in a source without becoming outputs of the unified task. A classifier in the binary setup has no separate answer for whether someone supports or opposes a candidate.

The original HateX collection contained 20,148 posts from Twitter and Gab. Annotators distinguished hate, offensive speech, and neither, identified targets, and indicated reasons for their judgments. Its target annotations later make HateX useful as the single-source comparator for the multiclass experiment. The authors can ask whether having training examples for all the target classes is enough to perform well on the common test, and compare that with training on the pooled data.

The Offense collection began with 14,100 keyword-retrieved tweets. Its labels describe whether a tweet is offensive, whether an insult is targeted, and what kind of target it has. A label marking a group target supplies information the authors can use to construct an approximate hate label. That approximation is specific to the way Offense enters the unified resource. Other datasets, including the collection named Automated Hate Speech Detection, or AHSD, already separate hate from other offensive language. AHSD originally contained 24,783 tweets gathered through keyword searches.

The racism and sexism collections HSHP and AYR are closely related. HSHP originally contained 16,000 tweets. AYR extended that line of work with the option to assign both racism and sexism. The authors account for overlap between these sources, and for material that also appears in CMS. Keeping track of these links is part of constructing a test of transfer. Independent dataset names can conceal shared examples and shared collection history.

Multilingual and Multi-Aspect Hate Speech Analysis, abbreviated MMHS, covers 5,647 tweets in its original form. It describes the directness and hostility of speech, whom it targets, and annotators’ emotional reactions, among other aspects. Only its English Twitter material is relevant to the unified resource. Its retained data lack a non-hate class for the individual binary comparison. The source contributes to the pooled setup, with the other datasets providing examples of non-hate. Multilingual and Multi-Aspect Hate Speech Analysis

HatE originally included 19,600 tweets in English and Spanish, with attention to hate directed at immigrants and women. HASOC originally included 17,657 tweets across Hindi, German, and English. Its labels distinguish types of objectionable speech and record whether insults have a target. These cases show how selecting only the English portion and adopting a common decision can change the scale and content of a dataset. The collections used in the experiments are the harmonized versions.

Detecting East Asian Prejudice on Social Media, or DEAP, began with 20,000 tweets about East Asian prejudice in the context of COVID-19. Its original annotation distinguishes hostile material from such categories as criticism, counterspeech, and discussion. The distinction matters because posts in all of these categories can mention the same people or topics. DEAP gives the cross-dataset experiment a concentrated test of an event and a target that the authors consider relatively uncommon elsewhere in the training material.

The Large Scale Crowdsourcing collection, abbreviated LSC, started with 80,000 tweets gathered using a boosted random sampling technique. Its annotation distinguishes several kinds of abusive behavior and includes ordinary speech. It gives the pool a source with a different collection design from the corpora explicitly gathered around an event or a narrow kind of prejudice. As with the other sources, what enters the study depends on availability and the authors’ rules for inclusion.

Keep comparable posts and remove overlap

The authors begin by removing material from outside Twitter. They give platform differences as the reason for the restriction. Retweets and short posts are part of Twitter’s conventions, while other social media services have their own patterns of interaction. The paper narrows its platform scope before comparing datasets, which makes the experiment more directly about variation among Twitter collections.

Next, they retain English material. They exclude designated non-English subsets and check language with a fastText-based identifier. The language check operates on the tweets the authors are trying to keep. For multilingual datasets, the comparison therefore uses only part of the original resource. A system evaluated in this study sees English tweets from multilingual projects, so their inclusion does not turn the experiment into an evaluation across languages. fastText subword representations

Availability imposes an additional filter. Some datasets distributed tweet identifiers and annotation labels, with the tweet text to be retrieved through Twitter’s API. The paper names HSHP, AYR, and LSC as sources that required this process. It reports that roughly ten thousand tweets were unavailable from the API. Accordingly, the study works with the retrievable portion of those resources. The original documentation of a dataset and the text available to a later investigator can describe different collections.

The authors then check for near duplicates. Some datasets used similar keywords to find tweets, which creates a chance that the same or very similar material was collected more than once. Their procedure compares normalized forms after lemmatization, which reduces inflected words to common dictionary forms for this comparison. Entries judged duplicate on this basis are left out. The method also strips URLs and removes identifying mentions. The ethics statement describes replacing user mentions with a placeholder to protect privacy.

Deduplication matters directly to the research question. Suppose a tweet appears in one resource’s training set and a copy appears in another resource’s test set. Correctly labeling the test copy would have limited value as evidence of transfer. Removing overlaps identified by the authors’ procedure gives a clearer test of whether what the classifier learned applies to distinct examples. The normalization is an operational rule for recognizing overlap instead of a judgment about every pair of tweets that expresses the same view.

Translate the original judgments into shared labels

A common file format would make it possible to store the posts together, but it would leave a deeper problem unresolved. Different projects gave their annotators different choices. The authors need to decide which of those judgments count as instances of a common hate label. Their binary mapping preserves direct hate judgments where possible and supplies explicit rules for sources whose original labels work differently.

When the original resource already asks whether a post is hateful, the relevant label can carry through. For a source that subdivides hate into several types, the binary task combines those types under a single hate label. The paper treats an assigned label for a specific type such as sexism as an instance of hate in this setting. The outcome is a decision about the presence of hate that can be scored across collections, even where their native label schemes differ.

Some mappings require more interpretation. The authors convert the continuous MHS score using the binary rule proposed by that dataset’s creators. This respects the source project’s interpretation of its scale. A continuous score nonetheless conveys gradations that a binary answer collapses. Once the conversion has been made, the evaluation treats the posts on either side of the boundary as belonging to distinct classes.

The Offense mapping starts from target type. A post marked offensive and aimed at a group is treated as hate under the authors’ assumption that the group attack is likely to concern a protected characteristic. An insult directed at an individual does not meet this particular selection rule. This gives Offense a usable place in the experiment. It also means that the binary decision for these examples comes from a proxy grounded in the dataset’s annotation, rather than from annotators who originally applied a hate label.

Where datasets explicitly distinguish hate from offensive or profane language, the authors use the explicit hate assignments for the positive class. Normal or explicitly non-hateful material supplies the negative class. This lets the authors use evidence from related tasks while preserving distinctions that the original annotators were asked to make.

The paper also has a rule for cases where the separate annotator judgments are available. Agreement by at least two coders can be enough to assign a label. Depending on how many people annotated an item, that threshold can preserve a judgment that would fail a majority requirement. The authors motivate this as a way of representing a wider range of judgments in the dataset. It is part of how they define the training signal for the experiment. They cite related work on preserving annotator perspectives. Affect in Tweets

Group targets for the multiclass task

The multiclass task gives the classifier a more detailed answer space. For each tweet, it can predict a named type of hate, a residual hate category, or non-hate. Starting from all the target distinctions available in the original collections produced 44 candidate hate categories. Some were represented by only a few tweets. A taxonomy that kept those categories separate would ask the classifier to learn distinctions with very few annotated examples.

The authors consequently group source labels with related targets. They place ethnicity and immigration under racism. They keep religious targeting as a distinct category. Gender-related targets form the sexism class, and targets identified by sexuality or sexual orientation are grouped under sexual orientation. The study excludes classes that account for less than 1% of the hate material at this stage. These choices determine which distinctions can appear in the predictions and which are absorbed into broader categories.

The final setup has 7 labels. Racism, sexism, disability, sexual orientation, and religion are the specific categories. Other is a residual hate class for examples outside those named groups. Not-Hate is the remaining label. In the resulting multiclass collection, the authors report that 26% of tweets are assigned a form of hate. Religion has only 709 examples, making it the smallest class the paper identifies in its description.

Building this task depends on the availability of target labels. A tweet can be useful for the binary task even when its dataset provides no information about the group being targeted. The multiclass comparison uses the sources where the target information can support the shared scheme. HateX offers examples for all of the final classes and so serves as the individual-source comparison. Its coverage of the label names allows the experiment to test whether those classes are represented well enough in a single corpus to learn them.

Set aside data and train the comparisons

The binary resource has 83,230 tweets, of which 33% carry a hate label. In general, the authors partition each source so that 70% of examples go into training, 10% into validation, and 20% into testing. The partition is stratified, meaning that examples are assigned with attention to retaining the source’s class proportions across partitions. This keeps a split from acquiring a markedly different class mix by chance. A stratified split can preserve imbalance if the underlying collection is imbalanced.

Where a source provides an existing partition, the authors use it. The binary split table identifies HASOC, HTPO, HatE, and Offense as sources with preexisting splits. The training portion provides examples for fitting the classifier, validation supports training decisions, and the test portion is held out for the reported evaluations. Keeping distinct test sets for the sources is essential. If all the test material were combined into one set before scoring, the study would lose its direct view of how each dataset behaves as a test.

For the binary comparison, the authors first train classifiers on individual sources. They also train using all the available training datasets together, a condition called All. The full pool gives each classifier access to more examples and more sources. A third condition, called All with an asterisk in the paper, draws a smaller sample from the pool for comparison with the strongest single training source for each classifier. The authors balance hate and non-hate in this sample and draw proportionally across the available datasets. The target sample size thus depends on which individual source provides the comparison.

For the multiclass experiment, the authors compare training on the combined target-labeled data with training on HateX alone. Both settings are evaluated on the multiclass task. The experiment asks how much usable coverage the collection provides for each target type. A class might have a training example in both conditions and still be learned successfully only when the classifier has more examples or a wider range of expressions.

From existing datasets to cross-dataset evaluation

The steps in order.

From existing datasets to cross-dataset evaluationStep 1: Collect social media datasets with hate-related labels1. Collect social media datasets with hate-related labelsStep 2: Keep English tweets and remove near duplicates2. Keep English tweets and remove near duplicatesStep 3: Map source annotations to shared labels3. Map source annotations to shared labelsStep 4: Preserve existing splits or stratify new ones4. Preserve existing splits or stratify new onesStep 5: Train on individual datasets and pooled samples5. Train on individual datasets and pooled samplesStep 6: Score each held-out test source separately6. Score each held-out test source separatelyStep 7: Check transfer on independently collected tweets7. Check transfer on independently collected tweets

Use comparable classifiers and tune training

The experiments use base-sized neural classifiers with different pretraining histories. BERT-base and RoBERTa-base are the general-purpose choices. They provide a comparison with systems already adapted to Twitter text. In each case, fine-tuning means adapting a pretrained system to predict the paper’s hate speech labels using the selected training collection. BERT · RoBERTa

The Twitter-oriented choices are BERTweet and TimeLMs-21. BERTweet was pretrained from scratch for Twitter text. TimeLMs-21 began from a RoBERTa-base checkpoint and continued its training on a Twitter corpus. Both begin the hate speech task with experience of writing from the platform, though that experience comes from different training histories. The authors include a support vector machine, or SVM, as a conventional classification baseline. BERTweet · TimeLMs

The neural experiments use the Hugging Face implementations. For tuning, the authors use Ray Tune with HyperOpt and Adaptive Successive Halving. The settings they search include the learning rate, which controls the size of updates during training, and the warmup, which governs the introductory phase of those updates. They also tune the number of passes through the training data and the batch size, the amount of material processed together for an update. The appendix lists the selected settings for training on the combined resource. Transformers

The resulting procedure compares training data within each classifier family. For example, the full TimeLMs-21 experiment and the TimeLMs-21 experiment using just AYR start with the same kind of pretrained system and expose it to different hate speech examples during fine-tuning. Comparisons among classifier families answer a broader question, since their histories and settings also vary. The authors make the trained binary and multiclass detectors available and integrate them into TweetNLP.

Experiments and results

What the scores measure

The authors use macro-averaged F1. F1 for a class combines precision and recall. Precision concerns the predictions assigned to that class and asks how many agree with the test labels. Recall starts with the examples carrying the class label and asks how many the classifier recovered. A detector that predicts hate very freely can recover many hateful posts while making many incorrect accusations. A conservative detector can make fewer such accusations and miss more hateful material. F1 accounts for both sides of that problem.

Macro-averaging gives the class-level scores equal influence. In the binary task, the score for non-hate counts alongside the score for hate. In the multiclass task, a smaller category such as religion contributes on the same footing as a frequent category. Accordingly, a good score requires more than correctly assigning the most common label. The paper includes an all-hate baseline for the binary experiments and a most-frequent-label baseline for the multiclass experiment. These provide points of comparison for systems that make a constant decision.

The binary study uses another average to summarize performance across test sources. The table’s AVG column gives each dataset-specific test set equal weight, irrespective of its number of tweets. This is separate from the class averaging within each test set. The result describes performance across the chosen collection of tests, with a small test corpus carrying the same weight as a large one. The independently gathered set has its own column and does not contribute to AVG.

How the independent test was made

For an additional test, the authors collected tweets with keywords associated with International Women’s Day. They also gathered tweets for the International Day Against Homophobia, Transphobia and Biphobia. They took the posts from the relevant days in 2022. The aim was to evaluate transfer to a collection newly assembled for the study, using a procedure that gave the researchers direct control over the annotation.

An expert annotated 200 tweets. The guidelines asked for a hate label when the text expressed discrimination or disparagement towards a person or group, a non-hate label when that criterion was absent, and an uncertain label when the annotator could not decide. The judgment had to be based on the tweet’s text. Links and attached material were outside the annotation procedure. The final test, called Indep, has 151 non-hate tweets and 20 hate tweets.

The independent test is a different kind of comparison from simply choosing another existing test set. It uses its own collection and annotation decisions. Its events still overlap thematically with several categories present in the training resource, especially sexism and sexual orientation. It therefore provides an additional test of transfer to a new sample, with a subject range tied to its collection strategy.

Full pooling improved the average binary score

Across the existing dataset-specific test sets, every classifier has a higher reported average when trained on the full pool than when trained on its strongest individual source. TimeLMs-21 records the highest full-pool average at 70.7, followed by BERTweet at 70.1. RoBERTa reaches 69.7, and BERT reaches 67.9. These are binary macro-F1 results averaged across the existing test datasets under the equal-dataset weighting.

The best single-source training choice varies among the classifiers. TimeLMs-21 and RoBERTa do best overall with AYR among their individual training options, at 61.0 and 60.1 respectively. BERTweet’s strongest individual source is MHS, at 58.3. BERT’s is HTPO, at 57.2. For the SVM, the strongest individual source is MHS, at 47.7. The pooled average for the SVM is reported as 61.2. The all-hate baseline averages 23.0 on the same collection of tests.

The TimeLMs-21 comparison illustrates the ordering of the training conditions. Its strongest stand-alone source yields the lowest of its three averages. The smaller balanced pool improves on that source, and the full pool improves further. That ordering holds for the neural classifiers on the average across the existing tests. The individual columns tell a more varied story, because some training sources give their classifiers a particular advantage on tests drawn from the same resource.

TimeLMs-21 binary macro-F1 averaged across existing test datasets

The smaller pooled sample improves on the strongest individual source, and the full pool scores highest.

TimeLMs-21 binary macro-F1 averaged across existing test datasetsAYR alone: 61.0AYR alone61.0Size-matched balanced pool: 64.0Size-matched balanced pool64.0Full pool (this paper): 70.7Full pool (this paper)70.7
The numbers
System or settingmacro-F1
AYR alone61.0
Size-matched balanced pool64.0
Full pool (this paper)70.7

A high average can coexist with a weaker result on a particular source. For example, TimeLMs-21 trained on AYR scores 87.7 on the AYR test set. With full pooled training, it scores 87.2 on that test. On DEAP, the same comparison goes from 9.8 with AYR training to 68.0 with the full pool. These are both binary macro-F1 comparisons. The clearest advantage of pooling appears in the breadth of performance, as seen when the test moves from a source the classifier knows well to one with a different focus.

The paper also highlights the range of results on DEAP. In its discussion of the binary results, it reports 19.79% F1 for BERT trained on HTPO and 49.27% F1 for BERT trained on the full pool. Within the single-source comparisons selected for the main table, the former was the strongest DEAP result highlighted by the authors, while the latter was the weakest full-pool result. DEAP concerns East Asian prejudice during a specific event, and the paper treats its results as evidence of how poorly material from other settings can prepare a classifier for that test.

The smaller pooled samples transferred well

The binary results table lists 58,213 training examples for the full pool. The smaller pooled variants are sized according to each classifier’s strongest stand-alone source. For TimeLMs-21 and RoBERTa, the table lists 1146 examples for the small pool and 1147 for AYR. For BERTweet, it lists 5290 for the small pool and 5291 for MHS. For BERT, the corresponding counts are 2098 for the small pool and 2099 for HTPO. The reported counts make these near-matched comparisons in size.

Each smaller pooled variant beats its individual-source comparison on the average across the existing tests. In addition to the TimeLMs-21 results in the chart, BERTweet scores 68.6 with a small pool and 58.3 with MHS alone. RoBERTa records 62.8 with its small pool and 60.1 with AYR alone. BERT scores 61.4 with small-pool training and 57.2 with HTPO alone. The samples give the classifier examples from different sources and a balanced hate versus non-hate distribution. The results apply to that combination of choices.

On Indep, the smaller pooled samples yield the strongest scores for each of the classifier families in the main binary table. The highest is RoBERTa’s 78.3. TimeLMs-21 reaches 70.6 with its smaller pool, compared with 63.7 with the full pool and 59.3 with AYR training. BERTweet’s smaller pool scores 69.2, compared with 61.0 for its full-pool condition and 58.6 for MHS alone. All of these are macro-F1 scores on the same independent test.

RoBERTa binary macro-F1 on the independent Twitter test

The size-matched balanced pool scores above both the full pool and the individual source.

RoBERTa binary macro-F1 on the independent Twitter testAYR alone: 53.8AYR alone53.8Full pool: 56.2Full pool56.2Size-matched balanced pool (this paper): 78.3Size-matched balanced pool (this paper)78.3
The numbers
System or settingmacro-F1
AYR alone53.8
Full pool56.2
Size-matched balanced pool (this paper)78.3

The independent results change the ordering seen across the existing corpora. Among the neural classifiers, full-pool training produces the best average across the existing datasets. On Indep, the smaller pooled condition comes out ahead. The authors interpret the latter pattern as evidence that balancing the data matters. The independent test establishes that the smaller balanced samples can perform well on those posts. Because sampling changes the source mix and the class distribution together, the results leave their separate contributions open.

Pooling helped identify forms of hate

In the multiclass experiment, TimeLMs-21 trained on all available target-labeled data reaches a reported macro-F1 of 71.6. When trained only on HateX, it reaches 35.9. BERTweet records 70.9 with pooled training and 26.3 with HateX. RoBERTa records 69.5 and 36.3, respectively. The most-frequent-label baseline has a macro-F1 of 12.0. These averages summarize the class-specific scores in the common multiclass evaluation.

Macro-F1 on the unified multiclass hate speech test

Each classifier shown scores higher after training on pooled target-labeled data.

Macro-F1 on the unified multiclass hate speech testTimeLMs-21, HateX training: 35.9TimeLMs-21, HateX training35.9TimeLMs-21, pooled training (this paper): 71.6TimeLMs-21, pooled training (this paper)71.6BERTweet, HateX training: 26.3BERTweet, HateX training26.3BERTweet, pooled training: 70.9BERTweet, pooled training70.9RoBERTa, HateX training: 36.3RoBERTa, HateX training36.3RoBERTa, pooled training: 69.5RoBERTa, pooled training69.5
The numbers
System or settingmacro-F1
TimeLMs-21, HateX training35.9
TimeLMs-21, pooled training (this paper)71.6
BERTweet, HateX training26.3
BERTweet, pooled training70.9
RoBERTa, HateX training36.3
RoBERTa, pooled training69.5

The class-level results give a clearer account of the difference. Disability receives an F1 score of 0 from every classifier trained on HateX alone. The paper reports 21 disability examples in the HateX training subset, so the label was present during training. With pooled training, the disability class reaches 74.2 F1 for TimeLMs-21 and 75.5 for BERT. The improvement makes a distinction visible that would disappear if all the target labels were merged into a binary hate class.

Other classes show varying gains. For TimeLMs-21, racism scores 16.5 F1 with HateX training and 72.9 with pooled training. Sexual orientation scores 58.8 and 76.9 in the same comparison. Religion reaches 31.8 in the HateX setting and 52.6 with the full training data. The non-hate class scores 86.0 with HateX and 90.6 with the pool. Therefore, the classifier can already recognize much of the non-hate material when trained on a single source, even while struggling to identify some of the types of hate.

The paper’s SVM multiclass row warrants care. Its printed aggregate for pooled training exceeds every class-specific score displayed in that row. That is incompatible with interpreting the printed aggregate as the mean of those displayed class results. The neural comparisons and disability scores support the reported improvement from pooled training without relying on the inconsistent aggregate.

What the ablations show

Holding training size roughly fixed

The closest experiment to an ablation swaps an individual training set for a similarly sized sample drawn from the pool. The ordinary comparison between one source and the full pool changes several things at once. The classifier sees more examples, more collection procedures, and a wider range of topics. The smaller pooled samples bring the number of training examples back close to the single-source count. This makes it possible to ask whether the advantage survives without access to the full training volume.

The average binary results say that it does. Every classifier in the main comparison has a higher reported average across the existing test sets with the smaller pooled sample than with its strongest individual source. A practically useful consequence is that collecting examples from several resources can help even under a tight limit on training examples. The result also narrows the explanation of the full pool’s advantage. An increase in the number of labeled tweets cannot by itself account for the improvement observed in the near-matched comparison.

The smaller samples change the label distribution as well as the number of sources. Their hate and non-hate classes are balanced, while an individual corpus can have its own class proportions. Some of the gain may come from seeing a broader variety of hateful messages. Some may come from more exposure to one class than the single-source comparison allowed. Those effects can interact. More examples of the less frequent class are especially helpful if the additional examples cover types that were poorly represented before. The experiment assesses the joint change.

The independent results sharpen the question. The smaller pooled samples do better there than the full pool, even though the full pool generally leads on the existing test sets for the neural classifiers. The paper takes this as support for the importance of balance. Establishing a separate effect for balance would require a comparison in which the example count and source mix stay fixed while class proportions vary. Likewise, measuring the contribution of particular datasets would require retraining with selected sources removed. The paper’s analysis instead compares the combined strategies that it actually evaluates.

Training source and test source interact

The paper plots the results for pairs of training and test sources in a heat map. One axis indicates the source used for training, and the other indicates the dataset used for testing. A cell on the diagonal represents a run where the training and test partitions come from the same collection. The other cells represent transfers between collections. This arrangement makes it possible to see whether a strong result covers many sources or is concentrated around a classifier’s own training data.

Across the heat maps, performance tends to be higher on the diagonal. The authors give a useful example involving CMS and AYR. Both include sexism, so their topic labels might suggest that the experience gained from one would apply readily to the other. For BERTweet trained on CMS, the paper reports 87% F1 on the CMS test and 52% on AYR. The shared subject is compatible with a considerable difference in successful prediction between the corpora.

There are several reasons the two tests could diverge. Collection keywords may select different expressions of sexism. The range of examples considered ambiguous may differ. The non-hate class can also contain different kinds of posts. These are interpretations of the pattern and of how the sources were constructed. The heat map establishes where performance changes. It does not identify which particular wording or annotation decision caused the change in that pair.

DEAP exhibits the same problem on a larger scale in the paper’s analysis. It remains a difficult test across individual training sources. Its concentration on East Asian prejudice during the COVID-19 pandemic gives it a distinct topic and setting. The authors suggest that the other sources offer inadequate coverage of that subject. Better scores with pooled training are consistent with the explanation that a wider variety of examples supplies some of the missing experience. They do not by themselves specify which tweets or sources furnish it.

The same figure also shows why the average is useful alongside the individual scores. Training on the pool generally produces a more even spread across the tests. Training on one resource can produce a distinctive peak for that resource and much weaker results elsewhere. A researcher choosing a classifier for one of the represented collections might care most about its column-specific result. For transfer across the range studied, the spread over test sources is the relevant evidence.

Reading disagreements with the labels

The qualitative analysis turns from aggregate scores to individual errors made by the full-pool TimeLMs-21 classifier and by counterparts trained on single sources. In the multiclass task, the authors examine tweets labeled as forms of hate that the pooled classifier assigns to non-hate. One contains a racial expression in a casual reference to someone. Another uses a term associated with religious extremism to describe a person. Both carry wording that can be taken as hostile, and both are hard to interpret confidently without information about who is speaking or whom the words address.

These cases separate a measurable error from the interpretation of the tweet. Under the evaluation, disagreement with the recorded label counts against the classifier. On inspection, the authors consider that there may be plausible readings under which the text is non-hateful. The classifier’s disagreement does not settle the issue either way. It draws attention to how much evidence the text supplies and how much the annotation depends on a judgment about the situation.

The comparison with HateX training illustrates a different kind of mistake. The authors describe friendly messages that use profane terms, including a birthday greeting. The pooled TimeLMs-21 classifier follows the non-hate labels, while the HateX-trained version assigns sexism. The dataset on which the latter was trained already includes sexism. What it appears to struggle with in these examples is when expressions that could figure in sexist abuse are used in an affectionate or friendly way.

This contrast is consistent with the risks of keyword collection. A term used to retrieve hateful examples can appear in messages whose tone or purpose is quite different. A training collection can teach a classifier that the term goes with a certain class, and a wider collection can give it examples that complicate that association. The paired predictions show that pooling helps on the particular friendly messages analyzed. The paper does not estimate how frequently this type of error occurs.

The binary analysis includes posts that the pooled classifier marks as hate even though the recorded label is non-hate. The examples involve opposition to immigration or support for a border wall. The authors see potentially hateful implications in the messages and emphasize the importance of context for deciding whether they cross the boundary into hate speech. A classifier can recognize the subject of a message while being uncertain about the way that subject is being used. The evaluation records a false positive when the prediction disagrees with the label.

Finally, the authors compare the pooled classifier with a version trained on AYR. That individual source focuses on racism and sexism. The AYR-trained classifier misses hateful examples related to disability and sexual orientation that the full-pool classifier identifies. In these examples, the gap between the training focus and the test case is easy to see. This is a concrete illustration of the coverage problem observed in the cross-dataset scores. The examples show how a source can be useful within its area while leaving kinds of hate unlearned.

Limitations

Limits the authors state

The authors restrict their study to English and to material from Twitter. That decision makes the training sources more comparable and still leaves room for differences in topic, time, and labeling. Claims about the benefits of pooling are grounded in that setting. The authors identify extension beyond English as future work and point to earlier multilingual and cross-lingual hate speech research. Extending the experiment would involve new data and comparisons across languages.

The authors also acknowledge that the selection of datasets and target groups may shape the outcome. A pooled resource inherits the parts of the field that its constituent projects chose to study. The target classes depend on which groups the source datasets record and how the authors combine related labels. They treat the target recognition experiments as an initial examination and identify the development of a unified taxonomy as a direction for further work.

Computational limits led the authors to study base-sized neural classifiers. They suggest that larger systems might reach higher scores while showing similar behavior. That is a conjecture. The empirical comparison concerns the systems they trained. The conclusion likewise identifies generative and instruction-tuned approaches as future extensions, leaving their relative behavior outside the experiment.

The independent test has acknowledged limits of its own. It has relatively few posts and relies on one expert annotator. The authors use it to examine behavior on newly gathered material and to see how predictions align with a human judgment of hate. The design yields a focused comparison anchored to that annotator’s decisions. It offers limited information about how other people would label the same tweets, especially the difficult cases.

Limits that follow from the setup

The common labels align the datasets well enough to support the experiments, while retaining consequences of the original annotation schemes. In the binary task, for example, a group-directed offensive tweet in Offense can be counted as hate using its target information. A hateful tweet in another collection may carry that label because an annotator explicitly judged it hateful. Test scores therefore describe agreement with the operational labels constructed for the study. Their meaning depends partly on how those mappings represent the intended distinction.

The target taxonomy creates another boundary around what success means. A racism prediction can cover ethnic targeting or hostility towards immigrants under the authors’ grouping. Religion has its own category, and some distinctions from the sources are left out or combined. Good multiclass performance indicates that the classifier can recover the paper’s broad labels. It supplies limited evidence about how well the system could identify a specific community, handle overlapping targets, or use a more detailed annotation scheme.

The dataset-wise average represents an explicit choice about which errors matter. Giving every test set equal weight ensures that a corpus with many examples does not dominate the result. It also gives small, specialized sets substantial influence. The score describes breadth across these test collections. To estimate the experience of a user encountering a stream of posts, one would need an evaluation whose mix of topics and examples reflects that stream. The paper itself contrasts the 33% hate share of its binary resource with an estimate of around 1% for social media content more generally.

Label prevalence also matters to the interpretation of false positives. A system evaluated on a collection rich in hateful posts encounters many opportunities to find such posts. In a setting where hate is much less frequent, incorrect predictions on ordinary content can become more prominent. The study compares datasets using macro-F1 and does not estimate the consequences of applying any particular decision rule to a natural stream of posts. Its reported scores support comparisons under the evaluation conditions.

The independent test gives the classifier a new source, with narrow coverage of the platform. Its collection around two events favors subjects and vocabulary associated with those events. The absence of uncertain annotations from the final evaluation also leaves the hardest-to-judge portion of that annotation exercise outside the reported scores. A high score, such as the 78.3 macro-F1 for the balanced RoBERTa sample on Indep, shows agreement on the evaluated posts. Uncertainty about the labels and the sample’s topical concentration remain part of how that score should be read.

The mixed-source comparison is compatible with several explanations for improvement. A pooled sample can broaden vocabulary, add underrepresented targets, or change how frequently the classifier sees hate and non-hate. The full pool also supplies a larger amount of training material. The paper demonstrates gains for the combinations of choices it tries. The results are insufficient to assign the gains to individual sources, to identify a proportion that would work best in another setting, or to predict what happens when a new source is added.

Finally, the age and availability of tweets affect the material the authors can evaluate. Some posts had disappeared from the retrieval process, and the design compares corpora that differ in subject and collection history. These differences are part of the real transfer problem. They also mean that the experiments cannot isolate the effect of time. The error analysis points to a different kind of missing information, surrounding context. When the target or purpose of a message is unclear, the tweet alone may leave both annotators and classifiers with an ambiguous decision.

What came after

The later papers that cite this study address several neighboring problems, from the construction of polarization benchmarks to the annotation of explanations. Their stated scopes identify connections to the cross-dataset study. The citation relationships establish that they refer to it. The available descriptions do not specify whether they reused its tweets, classifiers, or sampling procedure.

POLAR develops a benchmark for studying online polarization across languages, cultures, and events. Antypas and Camacho-Collados compare sources within English Twitter, where the source topic and time can already change performance. POLAR places other kinds of variation within the scope of a benchmark. Its subject is polarization, so its connection to this study is through the problem of evaluating behavior across settings.

SMARTER proposes a data-efficient framework for detecting toxicity with explanations. It uses self-augmentation as part of that framework. Antypas and Camacho-Collados get more variety by drawing training examples from existing human-annotated sources. SMARTER’s stated approach addresses how to expand the material available for learning and makes explanation part of the detection task. That brings together two questions that the cross-dataset paper treats separately through training comparisons and qualitative inspection.

How Much Do Robots Understand Rudeness? considers rudeness in human–robot interaction. The setting and the label both differ from hate speech in tweets. The connection is the interpretation of language whose social function depends on how it is used. The distinction is visible in the hate speech paper’s examples of profanity in friendly messages. The robotics paper places judgments about rudeness in interactions where understanding the speaker’s use of an expression is part of the problem.

UTokyo Tsuruoka Lab at SemEval-2026 Task 9 addresses multi-label polarization classification with single-forward-pass inference. The stated emphasis is on making prediction efficient when the task involves multiple labels. Antypas and Camacho-Collados study a different design choice, the sources used for training a binary or multiclass detector. The later work applies classification to another form of contentious online language and puts the cost of producing decisions at the center of its approach.

BanHADEX studies explainable hate speech detection in Bangla using human-annotated explanations. Its language extends beyond the English setting of the cross-dataset study, and its stated task includes explaining a judgment. Antypas and Camacho-Collados draw on HateX, whose original annotations include reasons, but evaluate the common hate and target labels. BanHADEX foregrounds human evidence for the judgment itself.

Bias Dynamics in BabyLMs frames compute-efficient experiments as a way to study bias and debiasing during pretraining. Antypas and Camacho-Collados focus on a later stage, where labeled collections shape a pretrained classifier’s hate speech decisions. The connection lies in examining how training conditions affect learned behavior. The later work places that question at the pretraining stage and treats computational accessibility as part of the research design.

Cite

Cite as Dimosthenis Antypas and Jose Camacho-Collados. 2023. Robust Hate Speech Detection in Social Media: A Cross-Dataset Empirical Evaluation. The 7th Workshop on Online Abuse and Harms (WOAH).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.woah-1.25

@inproceedings{antypas2023robust,
  title = {{Robust Hate Speech Detection in Social Media: A Cross-Dataset Empirical Evaluation}},
  author = {Dimosthenis Antypas and Jose Camacho-Collados},
  booktitle = {The 7th Workshop on Online Abuse and Harms (WOAH)},
  year = {2023},
  doi = {10.18653/v1/2023.woah-1.25},
  url = {https://doi.org/10.18653/v1/2023.woah-1.25}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/antypas-2023-robust-hate-speech-detection-social/