Unsupervised Domain Adaptation in Cross-corpora Abusive Language Detection
Paper · 2021 · Tulika Bose, Irina Illina and Dominique Fohr
Summary
A detector trained to recognize abusive tweets has to make decisions about language it may never have seen during training. One collection might contain many direct insults, while another contains abuse that is mostly implied. Even when both collections use the same broad label, the language associated with that label can differ. Bose and colleagues ask whether a detector can learn enough from reading tweets in a new collection to recognize abuse there, using human labels only from the collection it already knows.
The authors use Davidson, Waseem, and HatEval, three Twitter corpora that differ in how they were collected and in the abuse they contain. For each transfer, the labeled training set in one corpus supplies examples of abusive and non-abusive tweets. The adaptation stage can read the new corpus’s training tweets with their labels hidden. A separate test set from the new corpus then measures how well the detector transfers. The paper compares techniques adapted from sentiment classification with a procedure built around HateBERT, a version of BERT previously trained on abusive Reddit comments. That procedure first asks HateBERT to predict words or other tokens hidden in the new corpus’s tweets. It then uses the original corpus’s labeled tweets to train the abuse detector.
Across the transfer directions, HateBERT reaches a reported average macro F1 of 62.9 after this extra training, compared with 61.2 when trained for abuse detection on the labeled source alone. Macro F1 gives the abusive and non-abusive classes equal weight. The improvement depends on the direction of transfer. With Waseem as the source and Davidson as the target, the mean goes from 60.1 to 67.1. With Waseem as the source and HatEval as the target, it goes from 57.8 to 56.5. All the sentiment-derived methods score below the source-only HateBERT baseline on the reported cross-corpus average.
The analyses explain why some plausible routes to transfer can fall short. A word can appear frequently in both corpora and still signal abuse in only one of them. And bringing the corpora closer together in a representation of their tweets can leave abusive and non-abusive target examples on the wrong sides of the distinction learned from the source. Target-only training gives the strongest average among the settings tested, while the variation across directions shows how much the result still depends on which corpus provides the labels and which supplies the new tweets.
Deep dive: Unsupervised Domain Adaptation in Cross-corpora Abusive Language Detection
Bose and colleagues test whether unlabeled tweets help abuse detectors transfer across corpora, comparing target-only HateBERT training with other methods. · about 30 minutes to read
The problem and its context
When the next collection differs from the training set
The paper frames automated abuse detection as a way to assist people who moderate online comments. Manual review has to contend with a large volume of material, and the work of preparing labeled training examples is itself demanding. A detector can learn from a collection that has already been labeled, but new comments can concern different people, events, or topics. The authors investigate a practical question that follows from this mismatch. If a new batch of tweets is available before anyone has labeled it, can its text help a detector trained on an older or otherwise different collection?
The task is a form of text classification. Each comment receives an abusive or non-abusive label. The authors treat several kinds of material, including hate speech, offensive language, and toxic comments, as part of the broader abuse category. That common label makes a comparison across corpora possible. It also puts pressure on the transfer procedure. The source may show the classifier plenty of examples from one part of that category and few from another. When a target corpus uses the same label for a different mix of examples, an association learned from the source can lose much of its value.
A test within a corpus and a test across corpora answer different questions. A test within a corpus holds out examples that were gathered under the same collection procedure as the training examples. This measures how well the detector applies what it learned to new examples from that collection. A cross-corpus test also changes the collection itself. The testing tweets may have been found in a different way, may discuss different groups, or may use a different form of abuse. Earlier abuse-detection studies discussed by the authors had already reported deterioration in this setting. The question for Bose and colleagues is whether adaptation using unlabeled text can reduce that deterioration.
The study treats a sufficiently coherent collection as a domain. In this usage, the source domain is the collection that supplies labeled examples, and the target domain is the collection where the detector will be evaluated. The authors follow the account of domain adaptation surveyed by Ramponi and Plank. Their setup assumes access to target-domain text during training, with the abuse labels withheld. It makes sense for a situation in which a team can gather comments from the setting where it plans to use a detector, but has yet to undertake the annotation needed for supervised training there. Neural Unsupervised Domain Adaptation in NLP
How a collection shapes the examples it contains
The first source of change is time and context. The paper contrasts a collection assembled in or before 2016 with one collected during 2018. Their discussions took place in different contexts. A classifier that relies heavily on the names, phrases, or topics associated with earlier examples may find few of those cues in the later collection. The dates help explain why shifts are plausible, but the experiment compares complete corpora, where time changes alongside other characteristics. Hateful Symbols or Hateful People? · SemEval Task 5 on Hate Speech Against Immigrants and Women
Sampling matters as well. The authors point out that Davidson gathered tweets using terms from a hate-speech lexicon. This procedure yielded a corpus with a large proportion of abusive material. The paper also describes Davidson’s tweets as originating in the United States and says Waseem lacked that geographic restriction. A word’s prominence in a corpus can therefore reflect the way the investigators found tweets as well as the way people use the word. The authors draw on earlier work about biased abuse datasets to explain why a detector can inherit associations specific to a collection procedure. Automated Hate Speech Detection and the Problem of Offensive Language · Detection of Abusive Language: The Problem of Biased Datasets
The people targeted and the way abuse is expressed provide further sources of change. The paper notes that women are among the targets in both Waseem and Davidson. It describes more subtle and implicit abuse in Waseem and more explicit, profanity-heavy abuse in Davidson. It also identifies religious minorities and African Americans as additional targets in its discussion of Waseem and Davidson, respectively. Sharing a target group thus gives only a partial account of what transfers. A classifier must still cope with the expressions used in the collection where it will be applied.
These differences also make transfer directional. If a source teaches the classifier how to recognize one kind of abuse, it may perform adequately on a target in which that kind is common. Switching which corpus supplies the labels changes what the classifier has an opportunity to learn. It also changes which examples it has to classify. For that reason the paper studies each direction separately, even when a pair uses the same collections.
Why borrow from sentiment classification?
Earlier work on sentiment classification gave the authors several ways to use unlabeled target text. Sentiment classification and abuse detection both assign a label to a piece of language. The former had an extensive literature on transfer between domains, making it a useful source of methods to try. Bose and colleagues use the comparison to ask how far the assumptions behind those techniques hold when the label concerns abuse.
One tradition builds features around pivots, expressions frequent enough in both domains and associated with the source labels. The idea is that shared expressions can anchor what the classifier learns about text that otherwise looks different. The paper traces this strategy to structural correspondence learning and also describes earlier approaches based on autoencoders, which learn representations through reconstruction. The pivot-based methods in the experiments learn to recover shared expressions from their context. Domain Adaptation with Structural Correspondence Learning
Another tradition uses an adversarial training objective. A discriminator learns to tell source and target representations apart. The part of the system that encodes each example is trained to make that distinction harder. The underlying hope is that a classifier built on those representations will rely less on cues that merely identify a tweet’s corpus. The challenge for abuse detection is to preserve the distinction between abusive and non-abusive tweets while suppressing information about their origin.
The authors also draw on fine-tuning work in which a pretrained encoder continues learning from text in a new domain. They cite review and sentiment studies that used prediction tasks derived from the text itself, including predicting masked tokens and next-sentence prediction. Those tasks can incorporate language from a domain before training on human labels. HateBERT already embodies one such change in training material, from general BERT pretraining to abusive Reddit comments. The experiment asks whether that starting point benefits from another round of training on the particular corpus where it will be tested. BERT Post-Training for Review Reading Comprehension and Aspect-based Sentiment Analysis
The method, step by step
Keep adaptation, supervision, and testing distinct
The procedure starts by giving each corpus a role. The source supplies the examples with abuse labels. The target supplies a set of tweets whose wording can be used for adaptation, plus a separate test set. This use of unsupervised refers to access to target labels. The overall experiment still uses supervised training, because the detector learns the abusive and non-abusive categories from labeled source tweets. It also uses the target test labels when scoring predictions and examining errors after training.
The paper denotes the source domain by Dˢ and the target domain by Dᵀ. The letter D refers to a domain, and the superscripts S and T indicate the source and target roles. Xˢ is the available source training text, with corresponding abuse labels Yˢ. Xᵀ is the target text available for adaptation. Here X denotes the text examples and Y denotes their task labels. The target test examples are held apart from Xᵀ. When the roles are reversed, both the text available for adaptation and the labels available for supervised learning change.
The main HateBERT procedure uses those inputs in sequence. It starts with the released HateBERT checkpoint. It then adapts that checkpoint by predicting hidden parts of the target training tweets. Once that stage is complete, the authors train the detector on the labeled source tweets. They select checkpoints using development data from the source. The resulting detector makes predictions on the held-out target test tweets, where those predictions can be checked against the target labels.
Target-only HateBERT adaptation and cross-corpus testing
The steps in order.
Continue training HateBERT on target text
HateBERT starts from BERT and has already undergone additional training on abusive Reddit comments. The authors use the existing checkpoint so that their adaptation begins with an encoder previously exposed to that kind of language. Their target-training step then narrows the text it sees to the tweets in the target training set. Reddit exposure and target exposure are different parts of the procedure. The first is inherited from HateBERT, and the second is what the paper adds before supervised classification.
In masked-token training, a portion of the text presented to the encoder is hidden. The system uses the visible context to predict what was obscured. The original text supplies the answer to the prediction task. This is the masked language modeling objective, abbreviated MLM in the paper. The facts needed to train this objective are already in the tweets. A hidden word can be recovered and scored even when the tweet’s abuse label is unavailable. The objective encourages the encoder to represent what goes with what in the target’s language. Any benefit to the final abuse judgment has to be established in the classification test.
The next stage changes the objective. The source tweets are now paired with abusive or non-abusive labels, and training uses those labels to fit the detector. The adapted checkpoint is the starting point. A useful way to read the result is as a test of whether the representation learned from target wording is still helpful after supervised training on the separate source. The method depends on the source labels giving the detector a distinction it can apply to the target. Target masking cannot directly teach the detector which side of that distinction any target tweet belongs on.
The source-only HateBERT comparison starts from the same released checkpoint and proceeds directly to supervised training. It leaves out the target masking stage. This is the paper’s closest comparison for the value of adding that stage to HateBERT. Other comparisons also change the adaptation objective, architecture, or initialization. The authors additionally vary the text used for masked-token training, comparing the target set alone with the source and target together and with training text pooled across the corpora. In each of these alternatives, the supervised task still uses source labels.
Choose shared expressions and learn to predict them
The explicit pivot methods take a different route from general masked-token training. They first identify expressions that occur in both corpora and are useful for distinguishing the classes in the labeled source. A pivot can be a unigram or a bigram, meaning a single token or an adjacent pair of tokens. The paper notes that the methods can use longer n-grams as well. In the reported setup, candidates have to occur at least 10 times in both corpora. The authors select candidates that share a high degree of mutual information with the source labels.
Mutual information here measures how much knowing that an expression occurs tells the selector about the class in the source. Frequency and label association do different jobs. The frequency criterion gives both corpora some examples in which the expression can be studied. The source-label criterion favors expressions that carry information for the classification task. A frequent expression that tells the selector little about the source label has limited use as a pivot. The label relationship on the target side remains unknown at selection time, because target labels are unavailable for adaptation.
Pivot Based Language Modeling, or PBLM, uses a long short-term memory network to learn from the selected expressions. It uses the other features in source and target examples to predict the pivots. In effect, the recurring expressions become common prediction targets even when what surrounds them differs. The authors then train a classifier on the labeled source examples. They use the long short-term memory classifier in their main comparison and report that they obtained similar performance with a convolutional classifier. PBLM starts with FastText word vectors pretrained on Wikipedia. These word embeddings provide initial numerical representations of words.
Pivot-based Encoder Representation of Language, or PERL, starts from BERT in its original configuration. It masks the selected unigrams or bigrams and trains the encoder to recover those pivots from the rest of the text. It draws the masking examples from both source and target. A task classifier then applies a convolution, pools the resulting features by averaging, and uses a linear layer to produce the decision. In the original setup, supervised task training changes the classification layers while keeping the encoder weights fixed. The representations used for classification are therefore those produced by the pivot training stage.
The important distinction between PERL and target-only HateBERT is the role of the blank. PERL makes shared, source-label-associated expressions the objects of prediction. The HateBERT procedure uses the ordinary masking objective and leaves pivot selection out. Their original configurations also differ in starting checkpoint, the corpora used during masking, and whether supervised training updates the encoder. The paper later changes PERL’s starting checkpoint and its supervised update policy to see how much its performance can recover.
Learn representations that conceal corpus origin
The adversarial procedures ask whether a tweet’s representation can retain evidence for abuse while becoming less useful for identifying its corpus. Each source or target training example already has a domain identifier from the collection it belongs to. That identifier is available even when its abuse label is hidden. The adversarial task uses corpus membership as supervision, and the final classification task uses only the available abuse labels.
The Hierarchical Attention Transfer Network, or HATN, combines this procedure with learned pivots. It uses attention with the labeled source examples to identify features useful for the task. The source and target examples participate in training that encourages the learned features to be shared across domains. A gradient reversal layer implements the conflict between the discriminator and the encoder. The discriminator receives an update that helps it identify the domain. At the reversal layer, the update sent back towards the encoder has its direction reversed, encouraging features that make domain identification harder.
HATN trains to predict pivots from other features, to confuse the domain discriminator, and to classify source examples. In that design, the signal for task usefulness comes from the source labels, while the domain signal expresses how well the representation hides where a tweet came from. The paper initializes HATN with the same type of Wikipedia-trained FastText vectors used for PBLM. The learned pivots distinguish HATN from the procedures that choose pivots in advance with a frequency threshold and source-label association.
Adversarial Adaptation with Distillation, or AAD, starts from the uncased base version of BERT, as does the original PERL comparison. It uses the Adversarial Discriminative Domain Adaptation framework to bring the representations of source and target examples closer. AAD includes an additional training loss based on knowledge distillation. Distillation uses the behavior of a trained predictor as a training signal. The motivating question in this experiment is whether the combination can yield a representation on which the source’s abuse distinctions extend to the target tweets.
Getting the domains to overlap gives these approaches a way to use unlabeled target text. The useful outcome for classification depends on which examples overlap. If abusive target tweets resemble source tweets from both classes in the adapted representation, the classifier may still have trouble assigning a label. That distinction between alignment of whole corpora and alignment by class becomes central to the authors’ analysis of HATN and AAD.
Measure whether selected pivots keep their class association
The paper’s numbered formulas describe a diagnostic applied after training. The authors take the selected pivots and inspect what kinds of comments they appear in. This time they use the labels in the target test set for analysis. Those labels allow them to check a condition that the pivot selector itself could never verify directly. The diagnostic asks whether a pivot favors the same class in the labeled source training set and in the held-out target.
rᵢ = (# abusive comments containing pᵢ) / (# non-abusive comments containing pᵢ)
The index i identifies a particular pivot, and pᵢ denotes the expression at that index. The symbol # indicates a count of comments, so the counts refer to comments containing the pivot. The numerator counts abusive comments and the denominator counts non-abusive comments. The slash denotes division, and rᵢ is the resulting ratio for the split under examination. A large ratio means the expression appears in more abusive than non-abusive comments containing it. The opposite holds for a small ratio. This ratio describes the composition of the comments that contain the pivot in that split.
(rᵢˢ, rᵢᵗ) < 1 − th or (rᵢˢ, rᵢᵗ) > 1 + th
The superscript s identifies the ratio from the source training set and t the ratio from the target test set. The parentheses enclose the pair of ratios, and the comma separates them. Each inequality applies to both members of the pair. The signs < and > indicate strict comparison below and above the respective cutoffs. The reference value 1 corresponds to equal abusive and non-abusive counts. The quantity th is the threshold, set to 0.3. Subtracting it from 1 gives the lower cutoff, and adding it gives the upper cutoff. The word “or” joins the alternatives. A pivot qualifies when both ratios clear the lower cutoff in the direction of non-abuse or when both clear the upper cutoff in the direction of abuse.
percₛ→ₜ = (# pivots satisfying the affinity condition × 100) / (# total pivots)
The symbol percₛ→ₜ denotes the percentage of selected pivots whose associations meet the preceding condition for a given transfer. The subscript s refers to the source, t refers to the target, and the arrow gives the direction. The count marked by # in the numerator includes only pivots that pass the shared-affinity check. The denominator counts all selected pivots. Multiplication by 100 expresses the fraction as a percentage. This measures directional agreement in class associations. It permits the ratios themselves to differ in size. A pivot can be much more strongly associated with abuse in one corpus than the other and still qualify as long as both ratios exceed the upper cutoff.
Experiments and results
The corpora and the splits
Davidson, Waseem, and HatEval are publicly available Twitter corpora. The authors use them because they cover different forms of abusive language. The shared experimental task has the same two labels for each corpus, which allows a classifier trained on one to be evaluated against the labels of another. The paper uses random splits for Davidson and Waseem, allocating 80% to training, 10% to development, and 10% to testing. For HatEval, it uses the standard shared-task partition.
Davidson contributes 19,817 training comments and 2477 test comments. Its reported average length is 14.1 words per comment, and the abuse percentage reported with its split statistics is 83.2%. Waseem contributes 8720 training comments and 1090 test comments. Its reported average is 14.7 words per comment, with 26.8% abuse. HatEval contributes 9000 training comments and 3000 test comments. Its average length is 21.3 words per comment, and the reported abuse percentage is 42.1%. These differences matter to interpretation. The source corpora vary in the quantity and composition of labeled examples they can provide, and the target corpora vary in the cases on which a detector is judged.
The authors remove URLs, retain often occurring Twitter handles, and use Crazy-Tokenizer to split the words inside hashtags. They then lower-case the text. Preserving a often used handle lets the detector make use of the context it can carry. Splitting a hashtag allows the constituent words to appear in a form the system can use. These decisions apply to the evaluation as a whole. The paper reports the resulting setup without isolating how much each preprocessing choice contributes to transfer.
Each corpus serves as the source for transfers to the other corpora and as the target of transfers from them. For a given direction, supervised training uses the source training set, and the development set used for early stopping also comes from the source. Adaptation can use the target training tweets as unlabeled text. The target test set is the basis for the final transfer score. The authors use the original implementations of the four comparison procedures and the released HateBERT checkpoint. Their main comparison consequently asks how those implementations fare in the shared evaluation protocol when brought to the abuse-detection task.
What the score measures
The paper reports macro-averaged F1. F1 combines precision and recall for a class. Precision concerns how many comments assigned to that class belong there, and recall concerns how many comments belonging to the class receive that label. For macro F1 the paper gives the F1 for each class equal weight when averaging. This matters when the corpora have very different class proportions. A system can predict the more frequent class for many comments and still do poorly on the other class, which then weighs equally in the aggregate.
For each transfer setting, the authors report a mean and standard deviation across five runs with different random initializations. A score written with ± pairs the mean with the standard deviation. The mean summarizes those runs, and the standard deviation describes their spread. The final average in the cross-corpus results summarizes transfer directions. It answers a different question from a mean for a particular source and target. The chart below uses the paper’s reported averages.
The in-corpus reference
The authors first train HateBERT with supervision inside each corpus. Davidson yields 93.8±0.1 macro F1 and Waseem yields 85.5±0.4. HatEval yields 51.9±1.7. These scores provide a reference for interpreting the cross-corpus results. In particular, the authors describe HatEval’s test set as challenging and note that earlier work reported similar performance there. Even when the source of supervision is HatEval itself, performance on its test set is much lower than the corresponding within-corpus performance on Davidson or Waseem.
The in-corpus results also appear alongside examples of frequent words in abusive comments. The Davidson list includes several profanities. The Waseem list includes terms such as “female,” “woman,” and “feminist,” and the HatEval list includes “refugee” and “immigrant” as well as profanity. The lists illustrate differences in content that a shared label can conceal. A term’s presence on such a list says it occurs frequently in abusive comments from that corpus. Understanding how strongly it separates the classes also requires looking at its use in non-abusive comments.
In-corpus scores put some of the transfer results into perspective. Waseem’s in-corpus mean is 85.5, while transferring a source-only detector from HatEval to Waseem gives 66.4 and transferring from Davidson to Waseem gives 67.5. Davidson’s in-corpus mean is 93.8, while the two source-only transfers into Davidson yield 60.1 from Waseem and 63.8 from HatEval. HatEval shows a different pattern. The source-only transfer from Waseem to HatEval reaches 57.8, above HatEval’s in-corpus mean of 51.9. The authors’ broader account of degradation is especially clear on Davidson and Waseem. The comparison on HatEval shows why the in-corpus score is best read as an empirical reference for that split.
Which approaches transfer best?
The source-only HateBERT baseline scores 61.2 on the reported cross-corpus average. The best of the methods borrowed from sentiment classification, PERL with its original BERT initialization, scores 56.8. PBLM scores 54.0. Among the adversarial approaches, HATN scores 51.4 and AAD scores 49.8. HateBERT with additional masking on the target training tweets has the highest reported average, 62.9.
Cross-corpus macro F1 averaged over the Davidson, Waseem, and HatEval transfers
HateBERT adapted on unlabeled target tweets scores highest, followed by source-only HateBERT.
The numbers
| System or setting | macro F1 |
|---|---|
| AAD with BERT | 49.8 |
| HATN | 51.4 |
| PBLM | 54.0 |
| PERL with BERT | 56.8 |
| Source-only HateBERT | 61.2 |
| HateBERT with target-only masking (this paper) | 62.9 |
The baseline makes the comparison demanding. It already uses a checkpoint exposed to abusive language before receiving the paper’s task supervision. A transfer method with access to unlabeled target tweets has to outperform a system that can draw on this earlier exposure. The four original sentiment-derived procedures all fall short of the baseline on the reported average. Their results address the performance of the complete procedures as evaluated. The comparison between the two HateBERT settings more directly tests the effect of adding exposure to target text, because their starting checkpoint and source-label training are shared.
How the direction changes the result
With HatEval as the source, the HateBERT adaptation helps on both targets in the reported means. On Waseem, target-only masking yields 68.0±1.0, compared with 66.4±1.1 from source-only HateBERT. On Davidson, the adapted procedure yields 67.8±1.6, compared with 63.8±2.3. PBLM’s strongest mean among its transfer directions also comes from the latter transfer, at 61.8±5.7. HatEval to Davidson is likewise the strongest mean for HATN, at 61.5±5.8.
Waseem as a source gives a mixed result. On the Davidson test set, target-only masking raises the reported mean from 60.1±4.4 to 67.1±2.9. The other methods show a wide spread in this direction. In their original configurations, PERL reaches 48.3±1.5 and PBLM reaches 46.5±1.3. AAD reaches 35.6±3.7 and HATN reaches 28.0±2.3. On the HatEval test set, however, target-adapted HateBERT scores 56.5±1.1, while source-only HateBERT scores 57.8±0.6. The direction that benefits strongly from target masking and the direction that loses ground both use Waseem’s labels.
Macro F1 on the Davidson test set with Waseem as the source
Target-only HateBERT has the highest mean in a transfer where the original pivot and adversarial methods trail the source-only baseline.
The numbers
| System or setting | macro F1 |
|---|---|
| HATN | 28.0 |
| AAD with BERT | 35.6 |
| PBLM | 46.5 |
| PERL with BERT | 48.3 |
| Source-only HateBERT | 60.1 |
| HateBERT with target-only masking (this paper) | 67.1 |
The transfers out of Davidson further qualify the aggregate. On Waseem, the source-only and target-adapted HateBERT settings yield 67.5±0.5 and 66.7±0.8, respectively. Original PERL reaches 67.4±1.0 in the same direction. This is a case in which a pivot procedure comes close to the strongest mean in the main comparison, even though it fares much worse on average. With Davidson as the source and HatEval as the target, the two HateBERT means are 51.3±0.2 without target training and 51.4±0.4 with it. This pair gives very similar observed performance for the two settings.
The direction-level scores make the scope of the main finding clearer. Target masking improves average transfer in this experiment, with some of the gains coming from transfers into Davidson. A reader choosing a setting for a particular target would also want to know which labeled corpus is available, since it governs what supervised examples the detector can learn from. The same adaptation procedure yields different outcomes when only the target changes. The score for an individual direction describes the joint effect of source supervision, target text, and the particular held-out test set.
What the ablations show
Which text should HateBERT read?
The authors vary the text used for masking while keeping the final classification training on the labeled source. In one setting, the encoder reads training text from all the corpora. In another, it reads the source and target training sets. In the target-only setting, it reads just the target training tweets. This comparison probes whether extra breadth during masking is helpful or whether concentrating on the destination corpus gives the stronger transfer result.
Training on the target alone gives the best reported average for these variants. With text from all the corpora, the macro F1 average is 61.4. With source and target text it is 61.0. The target-only procedure reaches 62.9. The authors relate this finding to the earlier work they discuss on sentiment classification, where language training restricted to a target domain helped capture knowledge specific to it. For abuse detection, the aggregate offers some support for their hypothesis that adapting to the target’s particular language is useful.
Cross-corpus macro F1 for the three HateBERT masking-data choices
Using only the target training text gives the strongest average across transfer directions.
The numbers
| System or setting | macro F1 |
|---|---|
| Source and target training sets | 61.0 |
| All corpus training sets | 61.4 |
| Target training set only (this paper) | 62.9 |
The pattern varies by direction. For HatEval to Waseem, masking on all the corpora gives 69.7±0.8 macro F1 and using the source and target together gives 68.9±0.6. Target-only masking gives 68.0±1.0. For Davidson to Waseem, the ranking places target-only masking first among these choices at 66.7±0.8. All-corpus masking yields 60.2±0.7, and source-plus-target masking yields 58.8±0.8. Thus a pair with the same target can respond differently to adding other training text when the source changes. Into HatEval from Davidson, all-corpus masking and target-only masking both have a mean of 51.4, and source-plus-target masking gives 51.5. These close means indicate little observed separation among the masking corpora for that transfer.
The experiment changes which texts the encoder sees and, with that, the balance and quantity of those texts. It establishes the relative performance of the tested data selections. The authors’ explanation is that target-only training gives the encoder a better chance to learn the target’s distinctive language. The comparison leaves open which specific linguistic cues account for the gains and how much of the effect would remain if the quantities and mix of text were controlled separately.
What changes when PERL starts from HateBERT?
Original PERL and adapted HateBERT differ along several dimensions. The authors bridge part of that gap by initializing PERL with HateBERT while retaining its pivot prediction procedure and keeping the encoder frozen during supervised training. This asks how much changing the starting checkpoint can help within the existing PERL approach. On the reported cross-corpus average, frozen PERL goes from 56.8 with BERT to 57.7 with HateBERT. The authors describe the average gain as insubstantial.
Individual directions again tell different stories. For HatEval to Waseem, frozen PERL improves from 57.1±1.8 with BERT to 63.2±1.7 with HateBERT. For Davidson to Waseem, the original configuration gives 67.4±1.0 and the version initialized with HateBERT gives 65.9±1.3. For Waseem to Davidson, the corresponding scores are 48.3±1.5 and 48.1±3.7. The checkpoint changes what the encoder brings to pivot training, but the original pivot objective and the restrictions on supervised updates still shape what the classifier can do with it.
The authors then let supervised training update all layers of HateBERT-initialized PERL. They use the hyper-parameters from the HateBERT work for this extension. The reported cross-corpus average rises to 60.8. In the Waseem-to-Davidson direction, this version scores 64.4±2.1. In the HatEval-to-Waseem direction, it scores 68.3±0.8. For Davidson to Waseem, it scores 57.3±3.1, below the means for both frozen PERL settings. Overall it remains behind HateBERT with target-only masking.
The updated version shows that PERL can achieve materially different results when the source classification stage can alter the encoder and the training settings change. The comparison attributes the result to that configuration as a whole. The paper distinguishes its intervention from an ablation in the original PERL work, which varied unfrozen layers during masked-token training. Here the change concerns the subsequent stage that learns the abusive and non-abusive classes. That is an important distinction because it determines whether the source labels can reshape the encoder itself.
Do pivots signal the same class in both corpora?
The pivot analysis compares PBLM’s strongest and weakest transfer directions. In the stronger direction, HatEval to Davidson, 51.4% of selected pivots meet the shared-affinity condition on the source training and target test splits. In the weaker direction, Waseem to Davidson, 18.8% do. PBLM’s means on the Davidson test set in these directions are 61.8±5.7 from HatEval and 46.5±1.3 from Waseem. Holding Davidson as the destination makes the analysis particularly readable. The target test distribution is the same, while the source text, labels, and resulting pivot list change.
The authors point to profanity as part of the explanation for the stronger transfer. The pivots selected with HatEval as the source include many profane terms. Profanity also features prominently in Davidson’s abusive examples, making those terms useful connections between the corpora in this direction. Waseem offers a different starting point, with more implicit expressions and less profanity in its abuse. A frequent expression that correlates with a source label can still enter the pivot list even if it has a weaker or different association in Davidson.
The diagnostic ties the results to a specific premise of pivot selection. Counting occurrences in both corpora establishes that the expressions are shared as text. Checking target test labels retrospectively reveals how often they are shared as evidence for a class. The lower percentage in the weak direction is consistent with the authors’ explanation that presence and task usefulness can come apart. PBLM and PERL use the same pivot selection criteria, so the authors expect similar percentages for PERL. They present the comparison around PBLM’s performance, which is distinct from directly measuring the contribution of pivot affinity to every configuration.
Are aligned corpora separated by class?
For the adversarial comparison, the authors focus on HatEval to Davidson, the strongest direction for HATN. They apply principal component analysis, or PCA, to the representations of the HatEval training tweets and the Davidson test tweets. PCA supplies a view of the features in a plane, making it possible to inspect where examples from the domains and classes fall relative to one another. The paper uses this visualization as a diagnostic after training.
In both HATN and AAD, the authors see source and target representations occupying nearby regions. They also observe some separation between abusive and non-abusive examples from the source. The target examples in HATN appear to follow that separation more closely. In AAD, the Davidson test examples do not appear to follow the same division as the HatEval training examples. Both procedures can thus bring the corpora close in the visualization, while producing different relationships between their classes.
The counts offer another view of the difference. Treating abuse as the positive class, HATN registers 1393 true positives on this transfer and AAD registers 1105. A true positive is an abusive Davidson test comment correctly classified as abusive. The true-negative counts, for correctly classified non-abusive comments, are 370 for HATN and 373 for AAD. These figures are consistent with the authors’ reading of the projection. The difference is particularly visible in how many abusive target comments each procedure recognizes, while the numbers of correctly recognized non-abusive examples are close.
What the source contributes
The authors also examine the corpora in their role as providers of supervised examples. They describe HatEval as a generally more robust source, offering abuse directed at both immigrants and women as well as a mixture of implicit and explicit language. Its strong performance as a source can coexist with a difficult in-corpus test, since the usefulness of its training examples for transfer and the difficulty of its own held-out examples are separate properties. Waseem, by comparison, often supplies a narrower set of examples for the transfers studied here.
The authors connect this observation to how they obtained the Waseem tweets. The dataset was distributed as tweet identifiers, and they report that many comments had been removed before they retrieved the text. In the Waseem comments they collected, 99.3% of the abusive comments are sexist and 0.6% are racist. Those percentages describe the recovered abusive subset. Alongside the paper’s qualitative account of more implicit language and less profanity, they explain why a classifier trained on the available Waseem tweets may encounter many unfamiliar kinds of abuse when moved to another corpus.
Limitations
Limits the authors identify
The authors conclude that the methods they tested leave substantial room for improvement in portable abuse detection. Masking target tweets helps HateBERT on average, but the results depend on the source and target. The source still supplies all the classification labels. Reading target text can help the encoder learn target-specific wording and context, while the abuse distinction it ultimately applies comes from a different collection. The transfer into HatEval from Waseem, where the source-only mean is higher, illustrates that the extra stage can yield a less effective detector for an individual direction.
For the pivot methods, the authors identify a limit in the shared features chosen by frequency and source-label association. Those criteria can select expressions whose distribution over the classes changes in the target. The diagnostic shows that in PBLM’s weak Waseem-to-Davidson direction, a relatively small proportion of pivots satisfy the shared-affinity test. The paper proposes investigating pivot selection that represents higher-level meaning across corpora, so that the bridge between collections can rely on more than recurring surface expressions. That is a research direction set out by the authors.
For domain adversarial training, the authors emphasize that making domains hard to distinguish can leave class boundaries poorly placed. An encoder can put source and target examples in nearby regions without bringing examples of the same class together there. The authors point to class-aware alignment as a direction for future work. The goal would be to bring source and target examples of the same class closer while increasing the separation between classes, even with the target labels unavailable for training. The paper uses its visualization and classification results to motivate this goal.
Further limits visible in the design
The corpora differ in time, sampling method, targets of abuse, class proportions, and language. These changes come bundled together in each transfer. That makes the evaluation relevant to the problem the authors pose, because a new corpus can differ in several ways at once. It also means that a difference in scores cannot establish which source of variation caused the change. The explanation involving HatEval’s wider mix of abuse, for example, fits the reported source behavior. The design does not independently vary that mix while holding the source size and collection procedure fixed.
The pivot ratio also reflects the overall class balance within each split. A pivot can occur largely in abusive comments in a corpus where abusive comments are already prevalent. Its ratio answers how the comments containing it divide between the classes. The calculation has no adjustment for how common each class is in the split as a whole. As a consequence, the measured agreement between two ratios is evidence about their raw class affinities. It gives a more limited account of the expression’s predictive value once differences in class prevalence are taken into account.
The PCA and pivot analyses cover selected directions. In the pivot analysis, the authors choose the strongest and weakest PBLM cases. In the adversarial analysis, they examine the strongest HATN direction. These are helpful cases for seeing what might go wrong or right. They leave open how frequently the same patterns arise among the remaining pairs, and whether directly changing the diagnostic quantities would improve classification. A plane obtained by PCA also shows only part of the representation. The true-positive and true-negative counts corroborate the classification behavior in that comparison, but the projection alone cannot establish how the full decision boundary operates.
The averaged results and standard deviations summarize a set of runs on fixed corpus splits. Run-to-run variability is relevant when comparing closely spaced means, as in the Davidson-to-HatEval transfer where the HateBERT settings have means of 51.3 and 51.4. Those figures describe the outcomes observed in the experiments. The paper does not establish whether the same ordering would recur under different splits or corpus collections. Likewise, the PERL extension changes supervised layer updates along with its training hyper-parameters. Its gain supports the revised configuration, with room for a more tightly controlled comparison to identify the contribution of each change.
The study evaluates a binary judgment on Twitter corpora. That scope permits a consistent metric across collections and exposes substantial difficulty even within a single platform. It provides limited evidence about transfer to other platforms, or about finer distinctions among the kinds of material pooled under abuse. Retaining frequent handles and splitting hashtags also means that the evaluation includes those particular textual cues. The aggregate results cannot show how reliant a given detector is on a specific handle or topic, or whether it would continue to work when those cues disappear.
Finally, the procedure assumes access to an unlabeled training portion of the target corpus before evaluation. Its strongest average is evidence for adaptation when examples from the destination are already available. A deployment to an unseen collection with no prior target text would pose a different test. A setting that permits target annotations for development would change the evaluation as well. In these experiments the source development set determines when training stops, so the measure of improvement on the target is reserved for the held-out test evaluation.
What came after
No later citing studies are identified for this paper. The authors leave open two questions that follow directly from the experiments. One is how to find pivots that preserve their meaning as evidence of abuse across collections. The other is how to align representations so that the distinction learned from labeled source examples also holds on the unlabeled target. The paper establishes a comparison for those questions by showing where existing pivot and adversarial procedures struggled and where target-only masked training helped.
Cite
Cite as Tulika Bose, Irina Illina and Dominique Fohr. 2021. Unsupervised Domain Adaptation in Cross-corpora Abusive Language Detection. Proceedings of the Ninth International Workshop on Natural Language Processing for Social Media.
@inproceedings{bose2021unsupervised,
title = {{Unsupervised Domain Adaptation in Cross-corpora Abusive Language Detection}},
author = {Tulika Bose, Irina Illina and Dominique Fohr},
booktitle = {Proceedings of the Ninth International Workshop on Natural Language Processing for Social Media},
year = {2021},
doi = {10.18653/v1/2021.socialnlp-1.10},
url = {https://doi.org/10.18653/v1/2021.socialnlp-1.10}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bose-2021-unsupervised-domain-adaptation-cross-corpora/