Elamur Research

Respectful or Toxic? Using Zero-Shot Learning with Language Models to Detect Hate Speech

Paper · 2023 · Flor Miriam Plaza-del-arco, Debora Nozza and Dirk Hovy

Summary

A hate speech detector trained on labeled posts needs examples of what counts as hate in the setting where it will be used. Those examples can be scarce, and the judgment can change with the social or linguistic context. The authors ask how far a detector can get when it receives the post and a short prompt, with zero labeled examples in that prompt and no additional training on the target dataset. Their approach turns detection into a choice between words that stand for the benchmark’s two classes. A detector might be asked whether a post is better described as respectful or toxic. The authors call these answer words verbalizers. Changing them can change which label the same post receives.

The study first tries 25 pairs of answer words with pretrained encoders, systems that represent a text using its surrounding context and can score possible completions. The comparison spans 8 benchmark datasets. Averaged across the encoders and datasets, respectful–toxic gives the highest macro-F1, at 42.74. Macro-F1 gives equal weight to how well the detector handles each class. Other pairs work better for particular encoders and datasets. The authors take the winning pair from the broad comparison and use it in a direct classification instruction for two systems already trained to follow instructions, mT0 and FLAN-T5. This tests whether the same answer vocabulary remains useful when the task is presented in a different form.

The instruction-trained systems generally score higher than the prompted encoders. FLAN-T5, which had previously been trained on toxic language detection, also exceeds the dataset-trained RoBERTa baseline on the Gab Hate Corpus, HateXplain and MLMA. It scores 67.11 macro-F1 on HateXplain, against 60.34 for that baseline. The supervised system leads on several other datasets, including DAVIDSON and the synthetic DYNABENCH benchmark. FLAN-T5 also scores above the commercial Perspective API on 6 of the 8 datasets. The comparison shows where prior training and a short instruction can substitute for fitting a detector to the evaluation corpus, and where corpus-specific training still has an advantage.

The multilingual experiments keep the instruction and answer words in English while the input language varies. FLAN-T5 leads the prompted systems on English, Spanish and Italian. Against the supervised XLM-R comparison, it leads in English and trails in Spanish and Italian. The authors present prompting as an option when local training examples are scarce. The study also shows why the setup matters. The result depends on the words offered as answers, the detector’s earlier training and the judgments each benchmark encodes. The balance between those factors can change from one dataset to another.

Deep dive: Respectful or Toxic? Using Zero-Shot Learning with Language Models to Detect Hate Speech

Respectful or Toxic? tests how prompt wording affects zero-shot hate speech detection and compares results across English, Spanish and Italian. · about 33 minutes to read

The problem and its context

Why a labeled corpus is hard to replace

Hate speech detection asks a system to assign a label to a piece of language. A binary task reduces that assignment to two outcomes, hateful and non-hateful. The simplicity of the output conceals a difficult judgment. The authors describe hate speech as dependent on social norms, cultural background and the people who encounter it. An expression can carry information about its target or purpose that is hard to recover from the wording alone. Human judgments can differ because people bring different experiences and expectations to the same text.

A supervised detector learns from examples that people have already labeled. In the usual setup described by the paper, a pretrained transformer is adapted to a corpus so that its predictions fit the corpus’s labeling task. That adaptation is called fine-tuning. It gives the detector direct evidence of which examples count as positive or negative under the corpus’s rules. Collecting that evidence depends on having relevant texts, a scheme for labeling them and judgments that can be used in training. The authors identify the shortage of labeled material, particularly outside English, as a practical obstacle to this approach. The adaptation step is known as fine-tuning.

Even where a corpus exists, the annotations reflect choices made for that corpus. A benchmark can be organized around a target group, collected from a particular platform or built to probe difficult cases. Human annotators then apply a labeling scheme to the material that collection process produced. A detector trained on those judgments has evidence about that combination of texts and categories. The paper’s concern with variation across settings follows from this dependence. Access to labeled material in one setting leaves open how well the same categories and judgments will carry across to another. The process of making those judgments explicit is linguistic annotation.

The binary task also requires deciding how to handle related phenomena. Some of the corpora used in the study originally separated offensive language from hate speech. The authors combine those categories for the experiments on those corpora. This gives them a common output format across benchmarks while preserving important differences in what a positive label covers. A detector that performs well on the aggregated category earns credit for recognizing instances from either source category. The distinction between hate speech and language that is offensive under a corpus’s scheme had already been posed as a detection problem in the work behind the DAVIDSON dataset.

These considerations give the study its empirical question. If a detector receives a description of the task in words, how frequently does it recover the decisions represented in labeled data without being fitted to that particular corpus? The labels still make the question answerable. They provide the reference judgments for scoring, even when those judgments are withheld from the detector at prediction time. The paper is therefore concerned with using fewer task-specific examples to run a detector, while relying on benchmarks to establish what its performance means.

From supervised fitting to prompting

The paper describes supervised learning as the prevailing approach in prior work, with fine-tuning pretrained transformers an established way to build a detector. It places this practice in a field that had already documented the scarcity of labeled material and the difficulty of applying hate speech categories consistently. Earlier surveys cited by the authors cover the shift toward automated classification and the resources available for it. One of those accounts is the survey by Schmidt and Wiegand.

Prompting offers a different interface to the knowledge acquired during earlier training. A prompt supplies words that frame what to do with an input. A detector can be asked to complete a sentence about a post or to select a label named in an instruction. In either case, the experimenter designs a way of interpreting the answer as the outcome of a classification task. The prior research described in the paper treats prompting as applicable to a range of tasks, with the relationship among the input, the template and the answer vocabulary forming part of the design. The paper draws on the survey of prompting methods by Liu and colleagues.

A prompt can contain worked examples, each pairing an input with its answer. That is the arrangement the authors distinguish as few-shot. Their own zero-shot setup provides the target text and the task wording without such examples. Zero-shot thus describes the procedure used when making a prediction on the target task. An instruction-trained system can have substantial experience from earlier training, including experience with a related task. That history and the contents of the target prompt are separate parts of the experimental setup. The distinction helps place the study alongside earlier work on few-shot learning.

The paper cites prior efforts that had already put hate-related labels into prompts. In one study, Chiu and colleagues asked GPT-3 to make a yes-or-no judgment about sexism, and also tried a prompt with categories for racism, sexism and neither. Those prompts frame different decisions. A yes-or-no question asks whether one property applies. A list of alternatives asks which of several descriptions fits. The authors of the present study take the answer vocabulary itself as an experimental variable, so that different ways of expressing the same benchmark decision can be compared systematically.

Another earlier line of work prompted a system to assess the toxicity of language during decoding. The paper discusses this as self-diagnosis and associates it with RealToxicityPrompts. There, a judgment about toxicity is used in the study of generated language. In the present study the post is supplied as an input, and the predicted class is compared with a benchmark annotation. Both settings use a textual description of toxicity to elicit a judgment. The role of that judgment differs because one concerns language generation and the other concerns detecting hate in already written text. The earlier approach is described in Self-Diagnosis and Self-Debiasing.

The authors also discuss zero-shot detection based on natural language inference. In that approach the text is treated as evidence for a hypothesis expressed in words. A classifier can judge whether the post supports a statement that assigns it a category. Goldzycher and Schneider explored how to write these hypotheses for hate speech detection, following an earlier approach to zero-shot text classification through entailment. That work gives the choice of wording a role similar to the one it plays here. The present study investigates the words used as completions or named answers, while the inference approach phrases the class as a proposition to assess. The earlier framework appears in Benchmarking Zero-shot Text Classification.

The authors build on this background by asking a question that applies to several corpora at once. A benchmark label such as non-hateful identifies a class through a labeling scheme. Words such as respectful, polite and neutral are plausible ways to prompt for that class, but they describe different properties in ordinary language. A blunt remark can be neutral towards a target group without sounding polite. A hostile remark can be grammatically courteous. The paper treats the choice among these words as part of the task specification. Its comparison also asks whether an answer vocabulary selected through sentence completion can be reused in a direct instruction and with posts written in other languages.

The method, step by step

Turning a benchmark label into an answer word

The starting point is a post and a binary prediction. The benchmark supplies the meaning of its classes through its annotations and any conversion the authors apply. The prompt supplies an expression for each class. The word verbalizer refers to that expression and its mapping back to a benchmark label. With respectful–toxic, respectful represents the non-hate class and toxic represents the hate class. The detector’s output is scored under that mapping. A prediction of respectful counts as a prediction of non-hate, even though an annotator might reasonably describe the post as terse or impolite.

For an encoder, the authors append a short incomplete sentence that asks for a description of the preceding text. The two candidate words can fill the same gap. If the detector assigns a higher likelihood to toxic than to respectful, the decision rule returns the hate label. Reversing the ordering gives the non-hate label. This makes the relative preference decisive for classification. The decision rule compares those particular candidates, so a different pair can produce a different label for the same input.

To illustrate the intuition, the authors use a short statement that directly expresses hatred towards its addressee. The statement is followed by the unfinished description, and the candidate associated with hate is expected to be a better completion. The example explains what the authors want the prompt to elicit. In the benchmark experiments, the reference annotation is what establishes whether choosing that completion is correct. The test therefore includes the corpus’s particular idea of hate, which may be narrower or broader than the way a word is ordinarily used.

From a benchmark post to a zero-shot prediction

The steps in order.

From a benchmark post to a zero-shot predictionStep 1: Map benchmark labels to hate and non-hate1. Map benchmark labels to hate and non-hateStep 2: Choose candidate words for the classes2. Choose candidate words for the classesStep 3: Append a completion prompt to the post3. Append a completion prompt to the postStep 4: Compare candidate likelihoods and record the prediction4. Compare candidate likelihoods and record the predictionStep 5: Rank word pairs across encoders and datasets5. Rank word pairs across encoders and datasetsStep 6: Reuse the highest-ranked pair in a direct instruction6. Reuse the highest-ranked pair in a direct instructionStep 7: Compare predicted labels with benchmark annotations7. Compare predicted labels with benchmark annotations

Searching for a pair that travels across benchmarks

On the hate side the authors consider harmful, abusive, offensive, hateful and toxic. On the non-hate side they consider respectful, kind, polite, neutral and positive. They examine all 25 possible pairings between the lists. Each pairing sets up a distinct comparison. When toxic is paired with respectful, the completed sentence asks the detector to prefer one description over the other. When toxic is paired with neutral, the hate answer is unchanged and the rival answer carries a different meaning. Comparing pairings makes changes of this kind visible in the predictions.

The encoder comparison covers BERT BASE-uncased, the base and large versions of RoBERTa, and the base and large versions of DeBERTa V3. These checkpoints already have the ability to score words in context. The experiments use that ability and the prompt template to obtain the class prediction. The BERT checkpoint comes from the family introduced in BERT. The other encoder families in the comparison are RoBERTa and DeBERTa.

The search produces results that can be read at different levels. The authors identify the encoder and word pair giving the best macro-F1 separately for each dataset. That view shows what each corpus favors when the choice can be made for that corpus. They also aggregate results by encoder and dataset across the folds to find a pair that does well overall. That broader ranking supplies one pair for the next stage. Selection is informed by benchmark scores, while individual predictions use the prompt and the input text. This is an important distinction when interpreting the term zero-shot. The authors fit no target-corpus detector for the prompted runs, and the evaluation across datasets guides their choice of words.

Giving priority to a single pair across experiments makes the later comparisons easier to read. Suppose each instruction-trained system had been given a separately optimized vocabulary. Any differences in performance could then reflect differences in the choice of words as well as differences between the systems. Reusing respectful–toxic holds the answer vocabulary fixed for the follow-up. The cost of that choice is that a pair found through encoder completions might be a poor fit for a direct instruction. The study tests a transfer of prompt wording from one form of prediction to another and leaves the best wording for the second form as a separate question.

Putting the words into an instruction

Encoders see a statement with a missing description. The instruction-trained systems see a request to classify the post using one of the named alternatives. The request comes first, then the post, then a cue for the answer. The verbalizer for non-hate is listed before the verbalizer for hate. This format tells the system both what action is expected and which words are available as answers. The answer can then be interpreted under the same class mapping used for the encoders.

The authors use FLAN-T5 and mT0 for this stage. They identify the checkpoints as FLAN-T5-XL and mT0-XXL. Both had already gone through instruction fine-tuning, which the paper describes as training on varied tasks expressed as natural-language requests. The study makes use of that prior training at inference time. It especially notes that FLAN-T5 had already been trained to detect toxic language. Its performance therefore tests whether that experience carries over to hate speech datasets under the paper’s prompt and label choices. The mT0 approach is associated with earlier work on crosslingual generalization through multitask fine-tuning.

Holding the answer words fixed leaves differences in the rest of the setup. The systems have different training histories, and the encoder and instruction conditions use different prompt forms. The comparison asks how the implemented procedures perform end to end. An instruction-trained system has the benefit of a prompt that explicitly asks it to classify the post. An encoder ranks words used as continuations of a statement. Each procedure uses an interface suited to the way the paper applies the checkpoint, and each ultimately produces the same kind of binary label.

In the multilingual experiments, the authors keep the English prompt and the English answer words for each language. The post can be in English, Spanish or Italian. XLM-R sees the completion-style prompt, and the instruction-trained systems see the classification request. This arrangement tests whether the detector can interpret the input language in the context of an English task description. The English prompt also makes the lexical choices directly comparable across languages. The multilingual encoder comes from work on cross-lingual representation learning.

Preparing the data and the supervised comparison

The corpora supply annotations of different kinds. To run a binary experiment, the authors convert the annotations where needed. In DAVIDSON and HateXplain, they join the hate and offensive categories to form the positive class. In the Gab Hate Corpus, they group calls for violence and assaults on human dignity under the hate label. These conversions define how the predictions will be scored. An answer word serves as the name of the resulting class, including any categories that have been combined in it.

The Measuring Hate Speech corpus, called MHS in the results, uses a continuous score. The authors specify a rule for converting scores at the two ends of that scale.

value < -1 → 0, value > 0.5 → 1

Here value is the corpus’s continuous hate score for the comment. The symbol < means strictly below the cutoff -1, which leads to the binary non-hate label 0. The symbol > means strictly above the cutoff 0.5, which leads to the hate label 1. Each → indicates the label assigned when its condition holds. The rule gives no assignment for the interval between the cutoffs or for scores exactly at either cutoff. The reported dataset size describes the corpus, so the rule alone cannot establish how many comments enter the binary evaluation.

The dataset-trained comparison is a separate use of RoBERTa BASE. It learns from labeled examples for each benchmark, and its evaluation is reported on test partitions. The implementation details give a training batch size of 8 and a run of 3 epochs, meaning passes over the training data. The authors describe 5-fold partitioning. This supplies several partitions on which to evaluate the approach and is also the context in which they describe averaging prompts’ performance across folds. The prompted systems use the default hyper-parameters from Hugging Face. The encoder implementation uses the OpenPrompt framework, and the authors make the study code public in a repository named prompting_hate_speech.

The supervised comparison measures what the same benchmark can yield when labeled examples are available for training. The paper also includes Perspective API, a commercial toxicity detector. That comparison asks how the paper’s prompted procedure fares against a service whose remit is toxicity. A score from either baseline still depends on the benchmark’s binary labels. The paper’s evaluation procedure puts the predictions on a common metric even when the systems that produced them were designed or trained for different purposes.

Experiments and results

What the datasets ask the detector to recognize

The main experiments span material collected from social platforms and a corpus created to challenge detectors. The dataset overview reports corpus sizes. Those counts describe the data sources, while the results come from the evaluation procedure and, where needed, the binary label conversions. The design makes it possible to compare prompting across several kinds of hate speech data without assuming that the datasets ask identical questions.

DAVIDSON contains 24,802 tweets. Its collection used keywords associated with a hate speech lexicon, and annotators distinguished hate speech, offensive language and neither. Joining the first two classes means that offensive posts receive the same binary label as hateful ones. HSHP also contains posts collected from Twitter through filtering for hate-related terms. Its 16,914 tweets were drawn using terms concerning religious, sexual, gender and ethnic minorities, then manually annotated for hate speech. Both datasets come from the same platform, but the collection criteria and labeling histories give the detector different examples to judge. HSHP comes from Hateful Symbols or Hateful People?.

HateXplain contains 20,148 posts from Twitter and Gab. Its annotators assigned a category and also identified the target communities and the portions of text that supported their decisions. The final label was determined by majority vote. The paper’s experiment uses the binary category after combining hate and offensive language. The additional annotations are therefore part of how the original corpus was constructed, while the comparison here measures class prediction. The Gab Hate Corpus, or GHC, has 27,665 Gab posts. Its hate class in this study joins the violence and human-dignity categories. The two corpora have some platform overlap, yet a successful prediction is still defined by the labeling choices of each.

DYNABENCH, with 41,255 examples in the overview, is listed as synthetic. Its construction asked annotators to find examples likely to be classified incorrectly by a target detector. The paper gives the hateful share of the corpus as 54%. This is a benchmark designed around difficulty for a classifier, so the ability to pick up the prominent cues that occur elsewhere may be less helpful on these examples. The data gives the paper a place to test the same prompt against deliberate challenges rather than relying entirely on posts sampled from platforms. The construction method comes from Learning from the Worst.

MHS contains 50,000 comments from YouTube, Twitter and Reddit. Its crowdsourced ratings contribute to a continuous hate score, with the binary labels in this experiment derived from the cutoffs described above. The authors explain that annotators in the original collection rated comments spanning the scale. That history matters to the comparison because the benchmark starts with graded judgments about hate, while the detector returns one of two labels. The threshold rule determines which parts of the original scale have an explicit label in the experiment.

The dataset overview gives HATEVAL a size of 13,000. It consists of Twitter material from a shared task concerned with hate speech against immigrants and women. The paper describes several collection strategies, including following accounts and filtering the stream for relevant terms. The appendix gives a different tweet count for HATEVAL, so 13,000 is the figure from the dataset overview. The English and Spanish portions of the shared task also furnish the data for the separate multilingual comparison. The shared task is described in SemEval-2019 Task 5.

MLMA is listed at 5,647 examples in the dataset overview. The underlying collection includes tweets in English, French and Arabic with annotations for several target and hostility types. The paper reports agreement using Krippendorff’s score, a measure of how consistently annotators make the same judgments. The figures it gives are 0.153 for English, 0.244 for French and 0.202 for Arabic. It describes a majority vote for the final label. The authors connect the difficulty of the benchmark to the low agreement. A detector can be scored against the resulting label while the disagreement behind that label remains relevant to interpreting the score. The corpus was introduced in Multilingual and Multi-Aspect Hate Speech Analysis.

Reading macro-F1 and the baseline comparisons

For the hate class, precision asks how often posts predicted to be hateful carry the benchmark’s hate label. Recall asks how frequently labeled hate posts are recovered by the detector. The F1 score combines these quantities so that poor performance on either is reflected in the score. The non-hate class can be evaluated in the same way, taking non-hate as the outcome of interest. Macro-F1 averages the class scores with equal weight. A detector that recognizes one class well and does poorly on the other is therefore distinguishable from one that performs well in both directions. The paper reports separate class scores for the encoder analyses and uses macro-F1 for the main comparisons.

The supervised RoBERTa BASE baseline asks how much can be gained by fitting a detector to each individual dataset. The paper treats it as an upper-bound comparison in the sense that it is given target-task supervision. Its measured score remains a result for a specific supervised procedure. FLAN-T5 exceeds it on several corpora, so the baseline’s role in the design differs from a numerical ceiling. Perspective API supplies a second comparison with a toxicity service. Scores against the service are useful for judging the detectors under the paper’s labels, which include broad categories on some datasets and more targeted judgments on others.

The strongest prompted encoder and word pair vary by corpus. RoBERTa LARGE supplies the best encoder result on 5 out of 8 datasets when the best configuration is selected separately for each. On DAVIDSON it reaches 55.26 macro-F1 with positive and hateful. On DYNABENCH its best entry uses positive and harmful and scores 55.16. BERT BASE-uncased gives the leading encoder result on HATEVAL, at 59.78 with polite and toxic. DeBERTa V3-BASE leads the encoder comparison on MLMA with polite and hateful, at 52.93. Those figures reflect choices made corpus by corpus. The main comparison of system families uses the shared respectful–toxic pair instead.

What changes with an instruction

The authors report average improvements over the prompted encoders of 39.75% for mT0 and 65.33% for FLAN-T5 using respectful–toxic. These are the paper’s relative improvements in macro-F1 over its encoder comparison. The figures summarize the direction of the comparison across benchmarks. Individual datasets show why it is also important to look at the underlying scores. The supervised baseline can lead by a substantial margin, trade places with the prompted option, or finish below both instruction-trained systems.

On DAVIDSON, FLAN-T5 obtains its highest macro-F1 in the main benchmark comparison, 83.30. Supervised RoBERTa BASE scores 91.28, and Perspective API scores 79.20 on that dataset. The prompted result is stronger than the service result and trails the detector fitted to the corpus. DAVIDSON’s combination of offensive and hateful posts is part of what those scores measure. The benchmark rewards agreeing with that combined label, so its high scores establish performance on the paper’s broad binary version of the corpus.

On HateXplain, FLAN-T5 reaches 67.11 macro-F1, above supervised RoBERTa BASE at 60.34 and Perspective API at 58.86. mT0 scores 56.68. HateXplain also combines offensive speech and hate, yet the relative performance changes compared with DAVIDSON. The shared broad label is only one aspect of the task. The posts come from a different mix of platforms and were annotated under their own scheme. This is one of the cases where the detector used by prompting outperforms the study’s detector trained on that corpus.

HateXplain macro-F1 for prompted systems and baselines

FLAN-T5 leads the comparison on the binary HateXplain task.

HateXplain macro-F1 for prompted systems and baselinesmT0 with respectful–toxic: 56.68mT0 with respectful–toxic56.68Perspective API: 58.86Perspective API58.86Supervised RoBERTa BASE: 60.34Supervised RoBERTa BASE60.34FLAN-T5 with respectful–toxic (this paper): 67.11FLAN-T5 with respectful–toxic (thispaper)67.11
The numbers
System or settingmacro-F1
mT0 with respectful–toxic56.68
Perspective API58.86
Supervised RoBERTa BASE60.34
FLAN-T5 with respectful–toxic (this paper)67.11

GHC provides another favorable case for FLAN-T5 against the supervised baseline. The prompted system scores 61.53 macro-F1, compared with 59.59 for supervised RoBERTa BASE. Perspective API scores 62.35 and leads that dataset’s comparison. The result illustrates how the answer to whether prompting wins depends on the comparator. The study’s FLAN-T5 configuration helps relative to the dataset-trained baseline on GHC, while the commercial service has the top observed score.

On MLMA, FLAN-T5 gives 54.35 macro-F1, against 47.47 for supervised RoBERTa BASE and 43.91 for Perspective API. It is the lowest FLAN-T5 score in the main dataset comparison, even though the prompted detector leads those baselines on MLMA. The paper points to low agreement among annotators as a reason to expect difficulty. The score is consistent with the broader observation that a dataset can be difficult for all the compared systems and still distinguish among their performances. The experiment does not isolate the contribution of annotation disagreement from the other features of the corpus.

The synthetic benchmark offers a different comparison. On DYNABENCH, FLAN-T5 records 58.08 macro-F1 and supervised RoBERTa BASE records 61.76. The authors regard these results as close in view of the challenging examples in the dataset. The supervised baseline still leads. Read alongside its 91.28 on DAVIDSON, that baseline’s score shows that both procedures face a harder evaluation on DYNABENCH. The comparison is useful because the dataset was assembled around difficult cases for classification, while its aggregate macro-F1 gives limited information about which perturbations account for errors.

On HATEVAL, FLAN-T5 reaches 65.38 macro-F1 in the main benchmark comparison. Supervised RoBERTa BASE reaches 70.98. The paper also cites 44.84 as the mean result of participants in the HATEVAL competition. That figure puts the prompted score in the historical context of the shared task. It represents a mean across competition participants, whereas 70.98 is the supervised comparator reported in the authors’ own experiment. These two comparisons answer different questions about how the prompted result sits among other results on the benchmark.

MHS and HSHP are further cases where supervised RoBERTa BASE leads. On MHS its macro-F1 is 90.50, compared with 79.38 for FLAN-T5 and 74.70 for mT0. Perspective API scores 87.90 there. On HSHP, the supervised baseline gives 76.82 and FLAN-T5 gives 64.36. Seen alongside the GHC and MLMA results, these benchmarks qualify any general claim that prompting replaces supervision. They also show why a commercial detector and a corpus-trained baseline are both informative. A prompted result can be strong compared with one procedure and leave appreciable room relative to another. Over all 8 datasets, FLAN-T5 beats the commercial service on 6.

What happens when the prompt stays in English

The multilingual experiment follows the settings of an earlier study by Nozza, whose supervised XLM-R results provide the comparison. The English and Spanish tests use HatEval data. The Italian experiment draws on the automatic misogyny identification challenge for hate directed at women and the HaSpeeDe shared task for hate directed at immigrants. This design keeps attention on the groups targeted by the texts while using corpora available for each language. It also means the Italian result comes from a different collection arrangement than the English and Spanish results.

On English, the prompted XLM-R encoder gives 29.80 macro-F1, mT0 gives 57.85 and FLAN-T5 gives 65.34. Nozza’s fine-tuned XLM-R gives 41.6. These are the figures from the multilingual comparison, whose English result is reported separately from the HATEVAL result in the main benchmark comparison. The authors attribute FLAN-T5’s advantage in this English setting to avoiding the overfitting issues discussed in the earlier study. The comparison reports the performance ordering. It does not include a controlled test of what causes the English baseline’s lower score.

Spanish gives the same ordering among the prompted systems. Prompted XLM-R scores 29.42 macro-F1 and mT0 scores 53.75. FLAN-T5 leads the prompted runs at 62.61. The supervised XLM-R result is 75.2. The authors single out Spanish as a promising case for the prompted approach. The absolute scores give the scale of that claim. FLAN-T5 improves considerably on the prompted encoder, and the supervised comparison still has the higher score.

Spanish HatEval macro-F1 with English prompts and a supervised comparison

FLAN-T5 leads the prompted systems while fine-tuned XLM-R scores highest overall.

Spanish HatEval macro-F1 with English prompts and a supervised comparisonPrompted XLM-R: 29.42Prompted XLM-R29.42Prompted mT0: 53.75Prompted mT053.75Prompted FLAN-T5 (this paper): 62.61Prompted FLAN-T5 (this paper)62.61Fine-tuned XLM-R from Nozza: 75.2Fine-tuned XLM-R from Nozza75.2
The numbers
System or settingmacro-F1
Prompted XLM-R29.42
Prompted mT053.75
Prompted FLAN-T5 (this paper)62.61
Fine-tuned XLM-R from Nozza75.2

On Italian, prompted XLM-R gives 31.34 macro-F1, mT0 gives 43.25 and FLAN-T5 gives 57.29. The supervised XLM-R result is 80.4. The same English prompt and English answer words produce the best prompted result with FLAN-T5 in each of the studied languages. The supervised ordering differs, with the strongest result in the Italian setting and the weakest in the English setting. Since the datasets and their construction also vary, these results describe particular benchmark settings. They give evidence for using English instructions on Spanish and Italian texts while showing the advantage of supervision in the two non-English comparisons.

What the ablations show

Answer words change the balance between classes

The paper varies answer words systematically within the encoder setup and uses cross-system and cross-dataset comparisons to examine how well the chosen wording transfers. The word-pair comparison offers the clearest evidence about prompt design. The basic template and the class mapping are kept in place while the words filling the two answer slots vary. The resulting shifts in performance show that an experimenter can change the detector’s behavior through the wording tied to a label, even when the annotation scheme stays the same.

Respectful–toxic ranks first in the aggregate encoder comparison, with 42.74 macro-F1. Its non-hate F1 is 27.28 and its hate F1 is 58.19. Positive–hateful gives 41.71 macro-F1, with 34.58 for non-hate F1 and 48.84 for hate F1. Positive–offensive gives 41.66 macro-F1, with 19.37 for non-hate F1 and 63.94 for hate F1. These are scores aggregated across encoder runs and datasets. Similar macro-F1 values can accompany quite different results for the individual classes, which matters if an application is particularly sensitive to missing hate or to incorrectly flagging ordinary speech.

Macro-F1 for verbalizer pairs across encoders and benchmark datasets

Respectful–toxic ranks first in the aggregate encoder comparison.

Macro-F1 for verbalizer pairs across encoders and benchmark datasetsPolite–toxic: 41.04Polite–toxic41.04Respectful–hateful: 41.25Respectful–hateful41.25Neutral–toxic: 41.64Neutral–toxic41.64Positive–offensive: 41.66Positive–offensive41.66Positive–hateful: 41.71Positive–hateful41.71Polite–hateful: 41.89Polite–hateful41.89Respectful–toxic (this paper): 42.74Respectful–toxic (this paper)42.74
The numbers
System or settingmacro-F1
Polite–toxic41.04
Respectful–hateful41.25
Neutral–toxic41.64
Positive–offensive41.66
Positive–hateful41.71
Polite–hateful41.89
Respectful–toxic (this paper)42.74

The table also allows a reader to examine pairs that share one word. Respectful–hateful gives 63.91 hate F1 and 18.60 non-hate F1, whereas the pair with respectful and toxic has the balance reported above. Holding the non-hate candidate fixed still changes the comparison because the hate candidate has changed. Similarly, reusing toxic with neutral rather than respectful gives 52.11 hate F1 and 31.17 non-hate F1. Both sides help set the decision boundary for any pair, since the prediction depends on the relative plausibility of the two words.

The class scores summarize errors of more than one kind. Poor F1 for non-hate can come from failing to recognize non-hateful posts, from predicting non-hate for posts labeled hateful, or from a combination. The result alone gives no breakdown between those possibilities. The strongest class imbalance in a reported pair does establish that the two labels need separate examination. An aggregate ranking identifies a pair for the next experiment, while the class scores show what is being traded off when one pair outranks another.

The best local pair and the best shared pair serve different purposes

The corpus-specific encoder results show why the aggregation step matters. On HATEVAL the strongest encoder setting pairs polite with toxic. It reaches 61.52 non-hate F1 and 58.05 hate F1, accompanying the reported 59.78 macro-F1. The strongest encoder setting on HateXplain uses that same pair with a different encoder. Its non-hate F1 is 24.36 and its hate F1 is 86.23, with 55.30 macro-F1. The same two words can be associated with a fairly balanced result in one setting and a large imbalance in another. Both the corpus and the encoder change between those observations, so the comparison describes variation across setups instead of isolating the effect of either change.

MLMA is a striking example of what a winning encoder entry can conceal. The best encoder setting in that comparison has 93.53 hate F1 and 12.32 non-hate F1, producing 52.93 macro-F1. HSHP has a different class balance in its best encoder entry. With RoBERTa BASE and positive against hateful, it gives 73.79 non-hate F1 and 54.64 hate F1, with macro-F1 of 64.21. A reader interested in whether a detector can reject false alarms on a particular benchmark needs the class-specific figures as well as the headline score. The top score within a search describes the best combined result, even when one side of the decision remains weak.

In the best-per-dataset entries, positive and polite are frequent choices for the non-hate side, while hateful and toxic often represent hate. The aggregated result favors respectful with toxic. This difference is expected given the two selection procedures. A local selection can take advantage of a wording that fits one corpus and one checkpoint especially well. A shared selection rewards a pair that keeps working across the range of cases in the average. The paper uses that second objective for deciding which words will be carried forward into the instruction experiments.

How far the instruction comparison goes

Using a single pair in the follow-up establishes that respectful–toxic can work in a direct classification request. Performance often improves when that request is given to FLAN-T5 or mT0, and FLAN-T5 is especially strong in the comparison. The authors suggest that its previous training on toxic language may help explain its lead. The connection is plausible because the requested label is closely related to the earlier task and the answer vocabulary names toxicity directly. The experiment contains no matched pair of FLAN-T5 checkpoints trained with and without that experience, so it cannot assign a share of the improvement to toxicity training.

The comparisons likewise combine several changes when moving from encoders to instruction-trained systems. The earlier training changes, the system architecture changes, and the instructions ask for an answer explicitly instead of presenting a blank to fill. The measured gain belongs to that practical combination. Nor do the multilingual results isolate the effect of using English as the instruction language. They hold English wording fixed and show that it can elicit useful predictions across the tested languages. A comparison with prompts written in Spanish or Italian would address a separate question about how the instruction language affects those results.

Limitations

Limits the authors identify

The authors leave the search for the best instruction verbalizers open. The broad search is done with encoders, and the pair chosen in that search is transferred to mT0 and FLAN-T5. The paper attributes this decision to computational cost and the purpose of the study. Some of the same words could perform differently in an instruction because the expression is presented as a named category rather than as the continuation of a sentence. The reported results establish what the selected pair can do in that setup. An instruction-specific search would be needed to establish the preferred pair under that different criterion.

The authors also qualify the coverage of the benchmarks. They chose widely used and varied datasets, and the selection still represents only part of the heterogeneity of hate speech data. Several corpora draw on particular platforms or collection criteria, and DYNABENCH enters the study precisely because its examples were designed to challenge detection. Similarly, the multilingual choice follows an earlier comparison. That gives the authors an established supervised result and limits the test to the settings that comparison makes available. Whether the same prompt works with other languages and with other annotation schemes remains an empirical question.

Another stated limit is the choice of systems. The authors use publicly accessible checkpoints to make the work easier to reproduce and leave the GPT family outside the experiments because of concerns about openness and reproducibility. Their comparison therefore characterizes the checkpoints they evaluated. It leaves open how other systems would respond to these templates and verbalizers. The authors also identify bias and robustness, including in multilingual settings, as topics for further work. They recognize in their ethics discussion that prior training can carry bias into a detector. They use existing public benchmarks and report that they collected no new personal or sensitive information.

Limits visible in the experimental design

The benchmark labels are operational definitions. HateXplain and DAVIDSON bring offensive language into the positive class, while GHC brings together its violence and human-dignity categories. MHS starts with a graded score and specifies labels through strict cutoffs. A correct prediction in one corpus therefore means agreement with its own binary construction. Cross-corpus consistency in performance can show that the approach is useful under several definitions. It leaves open how the procedure would behave when the same input must be assessed by multiple definitions or when a deployment needs distinct responses to offense, hate and threats.

Disagreement among human annotators affects the interpretation of a correct or incorrect answer. Majority vote produces a reference category for MLMA, for instance, and the paper’s agreement scores show that annotators often approached the judgment differently. Agreement with the final category measures fidelity to that aggregation procedure. It gives only a partial view of whether the detector handles ambiguity well. A detector might produce different answers for equally plausible readings, and a single benchmark label cannot show which reading it followed. The aggregate scores also provide no systematic account of whether errors fall differently across communities or target groups. This limits what the results establish about bias, fairness and safety.

The search over answer words uses benchmark results as evidence. As a consequence, the study’s broad encoder ranking establishes that respectful–toxic works well on the benchmarks used to compare the pairs. The experiment transfers those words to other systems and to the multilingual setting, but the ranking itself is obtained from the evaluated collection. The performance a researcher would see upon selecting that pair in advance for a genuinely unfamiliar corpus is a separate generalization question. The results show zero-shot prediction under the paper’s definition, with no labeled demonstrations in the prompt, alongside prompt selection informed by labeled evaluation.

Prior training is especially important to the scope of the zero-shot claim. FLAN-T5 has experience with detecting toxic language, and the authors treat that as a potential reason for its success. Its scores show what can be transferred to target datasets when this related training has already happened. The study has no controlled condition separating that experience from general instruction following, scale or architecture. It cannot establish the performance that would be obtained by a system with no prior training on related detection tasks. This distinction matters when the motivation is a shortage of labels. A shortage of labels for a target language or dataset is the problem the authors address, even though earlier supervision may contribute to the proposed solution.

The multilingual comparison mixes language with corpus design. English and Spanish draw on HatEval, while the Italian setting combines corpora from separate tasks. The availability and character of the supervised comparison also influence the interpretation of the results. FLAN-T5 gives the highest prompted score in each language, yet that pattern alone cannot determine how much a change of input language affects the detector on equivalent content. The experiment supports the portability of the English prompt to those settings. It leaves open the effect of translating the prompt, using local expressions for the classes, or comparing the same content with equivalent labeling in several languages.

Finally, macro-F1 establishes benchmark performance at the level reported. It cannot specify the reliability of individual answers or the detector’s behavior when the text comes from a different collection process. The study’s figures tell readers how frequently the procedures align with particular reference annotations, with equal weight applied to the hate and non-hate F1 scores. They offer less information about what cues drive a decision, how stable a prediction is under broader paraphrasing or how a particular kind of error would affect a person whose post is being judged. These questions become distinct from benchmark comparison when the system is used beyond the evaluated data.

What came after

From classification wording to implicit meaning

Chen and colleagues’ Pragmatic Inference Chain work takes up authentic implicit toxic language and frames the task as improving the reasoning used to recognize it. That shifts attention from which label words to offer to what a detector must infer about the input before it can choose a label. In the earlier study, the text and prompt are enough to produce a binary answer, and performance measures agreement with a labeled corpus. An implicit case raises a question that such a score cannot answer on its own. The text may carry a derogatory implication even where its wording gives little direct indication of hostility. The connection to the earlier paper is a shared concern with how the task is elicited, now focused on reasoning about what the text implies. Pragmatic Inference Chain

Wiegand and colleagues examine the relevance of value systems to offensive language detection. Their focus connects to the earlier paper’s account of why labeling is difficult. A person’s judgment about offensive or hateful language can depend on social norms and beliefs, and a benchmark stores the outcome of a particular annotation process. The respectful–toxic approach expresses that outcome through ordinary words whose connotations may vary among readers and settings. The later work brings the values underlying the judgment into view. This extends a question that arises in interpreting the original results. When a detector agrees or disagrees with an annotation, its answer is being evaluated against a judgment made from a particular social perspective. The Relevance of Value Systems

From assigning a label to judging reliability

Piot and colleagues revisit reliability in hate speech detection by asking whether a system can evaluate material that it has difficulty annotating. That question distinguishes two roles that can look similar in an experiment. Assigning a label produces an annotation. Acting as an evaluator requires deciding whether a judgment or output should be accepted. In Respectful or Toxic?, the benchmark supplies the reference and the prompted detector supplies the prediction. Piot and colleagues bring the evaluator’s reliability into the subject of investigation. Their framing makes it important to examine the competence needed for each role before treating a system’s evaluation as evidence about another system’s ability. Can LLMs Evaluate What They Cannot Annotate?

The original results already illustrate why this distinction matters. FLAN-T5 leads the prompted comparisons across the studied languages, but the size of its advantage and its standing relative to supervision vary. A system’s accuracy as an annotator therefore depends partly on the corpus and the task wording used to test it. Asking that system to judge another annotation introduces an additional task, with its own instructions and criteria for success. The connection between the two studies is the question of how much reliability can be inferred from a detector’s performance in one role when the proposed use asks it to take another.

Transfer across languages and research settings

The Aatman shared-task work studies transfer learning for multilingual polarization detection. It shares the earlier paper’s interest in getting a detector to work across languages when the target setting may have limited labeled material. The task and the transfer procedure differ. The original experiment applies English wording and a previously selected answer pair to posts in different languages. Aatman’s stated focus is transfer learning for polarization, which defines a different classification target from hate speech. This makes it a related test of the broader resource problem. Knowledge gained under one set of training conditions must be useful for a new linguistic setting and for the particular phenomenon the benchmark defines. Aatman at SemEval-2026

TONY is an open-source toolkit for applying natural language processing in psychology. It represents a different kind of follow-on work. A toolkit brings language-processing methods into a setting where researchers use text to study substantive questions. The connection to Respectful or Toxic? is the interpretation of labels produced by those methods. The hate speech experiment illustrates how the answer vocabulary, data collection and annotation rules can affect the measurements a detector returns. Those details are relevant when a classification output becomes an input to another investigation. The toolkit’s stated purpose places the citation in that broader applied setting. TONY

The citations establish links to these later lines of work. They leave the extent of direct method reuse unspecified. Implicit toxicity and value systems concern evidence and judgment behind a label. Reliability in evaluation concerns the role assigned to the detector. Multilingual polarization carries the problem of transfer to a neighboring task, and TONY brings language processing into a different research setting. These are distinct questions raised by the original comparison, whose evidence remains the measured behavior of particular prompts, checkpoints and benchmarks.

Cite

Cite as Flor Miriam Plaza-del-arco, Debora Nozza and Dirk Hovy. 2023. Respectful or Toxic? Using Zero-Shot Learning with Language Models to Detect Hate Speech. 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.6

@inproceedings{plazadelarco2023respectful,
  title = {{Respectful or Toxic? Using Zero-Shot Learning with Language Models to Detect Hate Speech}},
  author = {Flor Miriam Plaza-del-arco, Debora Nozza and Dirk Hovy},
  booktitle = {The 7th Workshop on Online Abuse and Harms (WOAH)},
  year = {2023},
  doi = {10.18653/v1/2023.woah-1.6},
  url = {https://doi.org/10.18653/v1/2023.woah-1.6}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/arco-2023-respectful-or-toxic-zero-shot/