Manuscript Offprint

arXiv:2608.25605

From Specialization to Generalization: Instruction-tuned LLMs for Robust Harmful Content Mitigation

Lukas Edman, Daryna Dementieva, Alexander Fraser

Abstract

Large language models (LLMs) demonstrate impressive performance across a wide range of general NLP tasks; however, their effectiveness in sensitive domains, such as hate speech detection, remains less clear. Prior studies comparing prompted LLMs with state-of-the-art encoder-based models (e.g., BERT variants (Roy et al., 2023; Dönmez et al., 2024)) have shown only marginal gains, suggesting that LLMs may not excel in hate speech detection or mitigation. In this work, we revisit this question through the lens of instruction tuning. By thoroughly unifying 36 English hate speech datasets spanning multiple labeling schemes, we fine-tune a generalist LLM, based on Qwen3 (Qwen Team, 2025), specifically for hate speech mitigation. Our results demonstrate not only state-of-the-art performance on in-domain benchmarks but also substantial improvements in cross-domain and cross-lingual generalization—areas where encoder-based specialist classifiers often struggle.

1 Introduction

Hate speech detection has been heavily studied, leading to the release of numerous datasets covering a wide spectrum of tasks, domains, languages, and annotation schemes (Mathew et al., 2021; Mandl et al., 2019; Cjadams et al., 2017) (see Table 1). Despite this diversity, progress in building generalizable hate speech models, which can cover a large variety of tasks related to hate speech as well as perform well on unseen domains, has been limited. Existing research largely treats each dataset or subtask in isolation, and little effort has been made to unify many available heterogeneous datasets to develop task-agnostic models with more robust performance across varied hate speech scenarios.

Consequently, task-specific encoder-based models (e.g., BERT variants) remain the dominant approach (Wang et al., 2020; Sai and Sharma, 2020),

Figure

Figure 1: In this work, we would like to close the gap in understanding if instruction-tuned general-purpose LLMs (i.e., HIPPO, right) are more robust and precise detectors of hate speech than specially-tuned LMs (i.e., BERT and Llama, left).

as prompting large language models (LLMs) has not consistently yielded significantly superior results (Roy et al., 2023; Dönmez et al., 2024). At the same time, instruction tuning, one of the most promising methods for aligning LLMs to specialized domains, has not yet been systematically explored for hate speech mitigation.

To close this gap, firstly, we consolidate 36 heterogeneous datasets in English into a single, instruction-formatted corpus spanning over 600k examples and 61 subtasks. Using this unified training dataset, we instruction-tune an LLM and name the resulting model HIPPO (Harmful Input, Positive and Productive Output, see Figure 1). We evaluate HIPPO across in-domain, out-of-domain, and cross-lingual settings. Our study aims to answer the following research questions:

RQ1: How does our instruction-tuned LLM perform compared to strong task-specific baselines for hate speech tasks in English?

RQ2: Does our instruction-tuned LLM outperform zero- or few-shot LLMs prompting for hate speech tasks?

RQ3: Can our instruction-tuned LLM generalize to previously unseen hate speech domains and labels?

RQ4: To what extent can our English-only instruction-tuning dataset support cross-lingual generalization in LLMs?

Our results show that the instruction-tuned model achieves competitive, and often better, performance compared to best-performing encoder-based systems, while also exhibiting cross-task generalization. With a smaller version of the dataset to prime the model, we also see potentially higher cross-lingual performance, especially for generative tasks.

We release our code used for fine-tuning and the best-performing models online for public use. 1^{1}

References (36)