[MASK]ED -Language Modeling for Explainable
Classification and Disentangling of Socially
Unacceptable Discourse

Dimitra Niaouri, Mohamed Rayane Ghilene, Michele Linardi, Julien Longhi

► To cite this version:

Dimitra Niaouri, Mohamed Rayane Ghilene, Michele Linardi, Julien Longhi. [MASK]ED -Language Modeling for Explainable Classification and Disentangling of Socially Unacceptable Discourse. Findings of the Association for Computational Linguistics: EMNLP 2025, Nov 2025, Suzhou, France. pp.14870-14883, 10.18653/v1/2025.findings-emnlp.803. hal-05362837

HAL Id: hal-05362837

https://hal.science/hal-05362837v1

Submitted on 13 Nov 2025

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# [MASK]ED - Language Modeling for Explainable Classification and Disentangling of Socially Unacceptable Discourse.

Dimitra Niaouri¹*, Mohamed Rayane Ghilene²*, Michele Linardi¹, Julien Longhi²

¹ETIS UMR-8051, CY Cergy Paris University, ²AGORA, CY Cergy Paris University

Correspondence: dimitra.niaouri@cyu.fr, mohamed-rayane.ghilene@cyu.fr, michele.linardi@cyu.fr, julien.longhi@cyu.fr

## Abstract

Analyzing Socially Unacceptable Discourse (SUD) online is a critical challenge for regulators and platforms amidst growing concerns over harmful content. While Pre-trained Masked Language Models (PMLMs) have proven effective for many NLP tasks, their performance often degrades in multi-label SUD classification due to overlapping linguistic cues across categories. In this work, we propose an artifact-guided pre-training strategy that rejects statistically salient linguistic features, referred to as artifacts, into the masked language modeling objective. By leveraging context-sensitive tokens, we guide an importance-weighted masking scheme during pre-training to enhance generalization across discourse types. We further use these artifact signals to inform a lightweight dataset curation procedure that highlights noisy or ambiguous instances. This supports targeted relabeling and filtering, enabling more explainable and consistent annotation with minimal changes to the original data. Our approach provides consistent improvements in 10 datasets extensively used in SUD classification benchmarks.

Disclaimer: This article contains some extracts of unacceptable and upsetting language.

## 1 Introduction

In an era defined by global crises, rising inequality, and the proliferation of extreme online content, regulators at different levels pressingly need to adopt effective Machine Learning (ML) solutions to detect Socially Unacceptable Discourse (SUD). The ever-changing and evolving nature of social discourse not only presents significant challenges to understanding it but also limits the capabilities of the available discourse analysis tools. Analyzing SUD on the other hand is an even more challenging task that requires context-aware models capable of understanding its subtleties and nuances.

Pre-trained Masked Language Models (PMLMs) have proven effective in different NLP tasks, including accurate classification of inadequate content (Swamy et al., 2019a; Markov and Daelemans, 2021a; Fortuna et al., 2021; Yin and Zubiaga, 2021; Toraman et al., 2022; Antypas and Camacho-Collados, 2023; Yigezu et al., 2023; Carneiro et al., 2023; Niaouri et al., 2025). These models however, face multiple challenges when used for online discourse analysis (Carneiro et al., 2023; Ghilene et al., 2024; Niaouri et al., 2025), where they require to learn from noisy data containing multiple distributions annotated with shallow categories (Niaouri et al., 2024). In this scenario, counting on inaccurate content labelling can in turn lead to severe (or too weak) censorships that may disadvantage content creators or contributing to information gaps (Draper and Neschke, 2023). We also notice that PMLMs under-perform when required to generalize over different label distributions (multi-class) and thus have to specialize over different types of speech that hereafter we refer to as SUD (Vehovar et al., 2020; de Maiti and Fišer, 2021; Carneiro et al., 2023).

Masked Language Models (MLMs) are often trained with a random masking schema over a generic corpus, where a model learns to predict randomly masked (and/or replaced) tokens considering their surrounding context (Devlin et al., 2019).

Intuitively, we can expect that the same linguistic pattern or keywords can appear in different types of discourse, breaking the assumption that a given class has a unique structure and vocabulary. In such a case, the language model ability to recognize and disentangle a given language feature depends on the model's understanding of the context around recent textual fragments that statistically represent a given class. To discover such patterns, an MLM must learn the heterogeneous contexts surrounding the pivotal textual feature. This begs the question:

<footnote>*These authors contributed equally.</footnote>
*Could we improve the performance of MLMs by selectively focusing on more representative SUD tokens/features during the pre-training?*

Recent research efforts (Ramponi and Tonelli, 2022; Levine et al., 2020; Moon et al., 2020) have highlighted the advantage of leveraging relevant textual features to enhance the language model generalization benefits to downstream task such as SUD classification.

We thus study the possibility of injecting statistical knowledge of SUD features at the MLMs pre-training stage. Furthermore, such a strategy permits us to obtain interpretable cues over the model decision space that we can also leverage to estimate noisy labels and perform data curation over the analyzed corpora. We notice that such a strategy is so-far overlooked in the automatic SUD analysis literature.

**Contribution:** In this work we propose a new SUD classification framework that selectively focuses on and ranks informative tokens related to SUD categories. In turn, it leverages such a knowledge to train unsupervised and supervised MLMs. The proposed approach uses the contextual significance of tokens, to weight the training loss and to estimate noisy labels. We extensively evaluate our contribution in building a SUD classification benchmark with 13 different datasets.

## 2 Related Work

**SUD classification** Recent works have advanced various techniques for detecting hate speech, which represent important components of SUD analysis. These methods range from traditional machine learning classifiers to modern transformer-based language models.

A wide range of annotated datasets has been developed to support this task (Davidson et al., 2017; Gao and Huang, 2017; Founta et al., 2018; Van Aken et al., 2018; Kumar et al., 2018; De Gibert et al., 2018; Qian et al., 2019; Basile et al., 2019; Zampieri et al., 2019; Mandl et al., 2019, 2020; Grimminger and Klinger, 2021; Kocon et al., 2021; Yuan and Rizoiu, 2022; Hartvigsen et al., 2022; Mollas et al., 2022), with *hatespeechdata<fnref n="1" />* serving as a centralized resource for such datasets. Increasing attention has been also devoted to cross-dataset and cross-domain generalization (Karan and Šnajder, 2018; Swamy et al., 2019b; Pamungkas and Patti, 2019; Salminen et al., 2020; Markov and

Daelemans, 2021b; Fortuna et al., 2021; Yin and Zubiaga, 2021; Toraman et al., 2022; Antypas and Camacho-Collados, 2023; Malik et al., 2024), multilingual detection (Pamungkas and Patti, 2019; Toraman et al., 2022; Malik et al., 2024), and multi-class or multi-label classification targeting fine-grained categories and underrepresented populations (Toraman et al., 2022; Antypas and Camacho-Collados, 2023; Yigezu et al., 2023; Gandhi et al., 2024).

In this context, Carneiro et al. (2023) and Niaouri et al. (2025) introduced a novel corpus combining texts from diverse platforms (social media, forums, news comments) and annotation schemes. Building on this resource, Niaouri et al. (2025) conducted a comprehensive benchmark of state-of-the-art methods, exposing inconsistencies in existing datasets, such as divergent contextual interpretations of the same labels, and highlighting annotation biases, showing that models trained on single-domain data can experience performance drops of up to 28% in cross-domain evaluations.

**Explainable Hate Speech detection** Several explainable hate speech detection efforts have focused on developing frameworks that combine detection accuracy with interpretable reasoning.

Hartvigsen et al. (2022) introduce explainable models that leverage narrative structures to capture subtle, implicit hateful expressions and adversarial language, while also releasing ToxiGen, a large-scale machine-generated dataset for implicit hate speech detection. The HARE framework (Yang et al., 2023b) complements this by using Large Language Models (LLMs) with chain-of-thought prompting to generate detailed rationales that improve detection accuracy and explanation quality. By addressing logical inconsistencies across human-annotated datasets, HARE achieves both improved detection performance (3.8% F1 increase over baselines) and enhanced generalizability.

A complementary direction of work enriches explanations with external knowledge and toxicity attributes. For example, Sridhar and Yang (2022) present a knowledge-informed encoder-decoder framework that integrates multiple sources of external knowledge to generate nuanced explanations of stereotypes in biased language, outperforming prior state-of-the-art approaches. Similarly, Ya-dav et al. (2024) propose Tox-BART, a generative model that leverages explicit toxicity attributes to interpret implicit hate speech.

<footnote n="1">¹https://hatespeechdata.com/</footnote>
Benchmark corpora have been critical in advancing this line of research. The Social Bias Frames dataset (SBIC) (Sap et al., 2020) emphasizes reasoning about the pragmatic frames in which social biases and stereotypes are projected, while the LatentHatred dataset (ElSherief et al., 2021) provides fine-grained annotations of implicit hate speech based on a six-class taxonomy, supporting evaluation of models on subtle and indirect forms of toxicity. Likewise, the HateXplain dataset (Mathew et al., 2022) incorporates word- and phrase-level human rationales across 20K posts, enabling simultaneous assessment of classification accuracy and explanation faithfulness, and revealing that high-performing models often diverge from human reasoning.

Beyond dataset-driven advances, explainable detection has also leveraged deep learning architectures in conjunction with post-hoc interpretability methods, such as attention and attribution analyses, which provide insights into model behavior (Murad et al., 2024).

In contrast to these approaches, our work focuses on mitigating bias and improving cross-domain generalization (without requiring additional annotations), offering interpretable cues tied to model confidence in large-scale, heterogeneous settings where label noise is prevalent.

## 3 Proposed Approach

This section outlines our methodology for enhancing SUD classification. In Figure 1, we show the overall architecture of our SUD classification framework composed by three novel blocks: I) Token Scoring, II) Pre-training strategy based on weighted loss according important tokens (a.k.a. artifacts), III) Post classification Token Diagnostic that supports Label Noise detection and Dataset Relabelling.

In the following parts, we provide a linguistically grounded definition of SUD describing the details of each architecture building block.

### 3.1 Socially Unacceptable Discourse (SUD)

**Definition** Socially Unacceptable Discourse (SUD) encompasses a spectrum of harmful communicative acts characterized by offensive, inciting, or derogatory language. This includes both explicit and implicit threats, negative stereotyping, obscene expressions, and aggressive or dehumanizing rhetoric (Vehovar et al., 2020; de Maiti and

Fišer, 2021). From a linguistic standpoint, SUD often parallels hate speech and extremist narratives, exhibiting features such as objectifying nominalizations, third-person plural pronouns that reinforce in-group/out-group dynamics, present-tense constructions that create immediacy, and imperative verbs that encourage harmful behavior (Okulska and Kołos, 2024).

**SUD Classification** Given a text item, namely a sequence of T tokens $X = (x_1, x_2, \dots, x_T)$, SUD classification assigns to X one of K predefined categories $C = \{c_1, c_2, \dots, c_K\}$, each corresponding to a distinct type of harmful or inappropriate discourse labelled in the corpus.

A fundamental challenge in SUD classification lies in its context-dependence: the same lexical items may function differently across discourse types generating noisy labels in widely used datasets that solely dispose of context-insensitive annotations. To address this, we propose a context-aware artifact extraction (Figure 1(a)) that selectively emphasizes semantically informative tokens used during bi-directional transformer model pre-training (Figure 1(b)). Extracting and scoring language artifacts will first permit us to weigh their importance, raising the focus on statistically relevant contexts that, in turn, we leverage to define an explainable methodology and estimate label noise in SUD annotated corpora.

We observe that not every token in a text sequence contributes equally to semantic richness or contextual understanding. In this sense, model training by random token masking (Meng et al., 2024), while widely adopted, can result in suboptimal representation learning by overemphasizing frequent but uninformative tokens. In the following part, we describe our artifact scoring and extraction method.

### 3.2 Token Scoring

**PMI Importance Score** To estimate token salience across SUD categories, we adopt a variant of Pointwise Mutual Information (PMI) (Fano, 1963), a well-established measure of word-class association. Following Gururangan et al. (2018) and Ramponi and Tonelli (2022), we compute:

$$PMI(x_t, c) = \log_2 \left( \frac{P(x_t|c)}{P(x_t) \cdot P(c)} \right) \quad (1)$$

where $P(x_t|c)$ is the conditional probability of token $x_t$ given its context class c, $P(x_t)$ its marginal
<figure><img src="image_2.png" /><figcaption>Figure 1: SUD Classification Framework. (a) Token Scoring and ranking for each instance in the corpus. (b) SUD Artifact-weighted pretraining of a Bi-directional transformer at the core of the SUD classifier (Feed Forward Neural Network - FFNN + Softmax Layer). (c) Post-classification Token diagnostic and Noise-Driven score computation for data curation.</figcaption></figure>

probability in the overall corpus, and $P(c)$ the prior probability of class $c$. To improve comparability and mitigate sensitivity to low-frequency tokens, we normalize PMI using the normalized PMI score (NPMI), and further rescale it to the range [0, 1] using min-max normalization. When a token appears across multiple classes, we compute its overall importance score as the average of its scaled NPMI scores across all associated classes.

**BERTopic (BT) importance Score** Our second extraction strategy employs BERTopic (Grootendorst, 2022), a transformer-based topic modeling framework that clusters semantically similar texts using Sentence-BERT embeddings<fnref n="2" /> (Reimers, 2019). We identify salient tokens within each topic using class Term Frequency - Inverse Document Frequency (cTF-IDF) (Joachims et al., 1997). This metric reflects a token's frequency within a topic relative to its frequency across the corpus:

$$cTF-IDF(t, T_i) = P(t | T_i) \cdot \log \left( \frac{N}{|D_t|} \right) \quad (2)$$

where $P(t | T_i)$ is the normalized frequency of token $t$ in its topic $T_i \in \mathbb{N}$, $N$ is the total number of documents, and $|D_t|$ is the number of documents containing $t$. In our work, we consider that a token is assigned to one or multiple topics in an unsupervised manner using a clustering algorithm (Grootendorst, 2022). Hence, $T_i$ represents a cluster index. A global importance score is then obtained by averaging each token's normalized relevance across all topics in which it appears.

## 3.3 Artifact-Guided Pre-training

Extracting and scoring tokens permits us to incorporate an importance score into the MLM pretraining objective. This integration biases the loss function, assigning a weight to the selected tokens. In this section, we present the masking strategy we adopt and the details of the aforementioned loss function.

**Token Masking Strategies** To investigate the effect of artifact-guided masking, we consider four masking strategies: (1) **Random Masking**, in which tokens are masked uniformly at random, and the standard MLM loss is applied (Devlin et al., 2019). (2) **Top-k Masking**, where only the $k$ percentage tokens, with the highest importance scores are masked during training. (3) **Random Masking with Weighted Loss**, where tokens are randomly masked, while the loss is scaled by token-level importance weights. (4) **Top-k Masking with Weighted Loss**, extends the Top-k Masking approach by applying an importance-weighted loss to the masked tokens.

**Weighted MLM Objective** As depicted in Figure 2, given a corpus $\mathcal{D} = \{X_1, \dots, X_N\}$, where each text item is composed by a set of tokens, namely $X_i = (x_1, \dots, x_T)$, a subset $M \subseteq \{1, \dots, T\}$ is selected for masking. Tokens at these positions are replaced with the [MASK] string placeholder. The model is trained to predict each masked token $x_t$ from the corrupted sequence $\tilde{X}_i$, minimizing the standard negative log-likelihood:

$$\ell_t = - \log (p_{\theta}(x_t | \tilde{X}_t)) \quad (3)$$

To emphasize semantically salient tokens, each $\ell_t$ is scaled by an importance score $w_t$, derived from our artifact extraction methods presented in Section

<footnote n="2">²We use the paraphrase-MiniLM-L3-v2 model to generate sentence embeddings.</footnote>
<figure><img src="image_3.png" /><figcaption>Figure 2: Masked language model pre-training. Tokens are passed through a bidirectional encoder model (Devlin et al., 2019). The token prediction loss is then weighted using the pre-computed importance scores.</figcaption></figure>

3.2 and a binary mask indicator ($a_t = 1[t \in \mathbf{M}]$):

$$ \ell_t^{\text{Weighted}} = \ell_t \cdot w_t \cdot a_t \quad (4) $$

The final objective averages the weighted loss across all masked positions:

$$ \mathcal{L}_{\text{MLM}}^{\text{Weighted}} = \frac{\sum_{t=1}^{T} \ell_t^{\text{Weighted}}}{\sum_{t=1}^{T} a_t} \quad (5) $$

This formulation biases training toward artifact-relevant tokens while maintaining stable optimization across variable-length sequences.

**Framework Architecture** Figure 2 illustrates with an example the artifact-guided masked language model pre-training. Masked tokens are processed through a stack of bidirectional transformer layers, yielding contextualized representations $h_t^L$. These hidden states are projected into the vocabulary space using a learned output matrix $E$, producing logits $u_t = h_t^L E^\top$, which are then transformed into output probabilities via a softmax function:

$$ y_t = \mathrm{softmax}(u_t) \quad (6) $$

These probabilities are used to compute the artifact-weighted loss defined in Equation 5, where each token's contribution is scaled by its corresponding importance score.

## 3.4 Dataset Curation via Token Diagnostics

After the classification task, to evaluate Artifact-Guided pretraining, we analyze token-level reconstruction loss (Figure 1(c)). Our assumption is to have the possibility to identify statistically important tokens that are difficult-to-reconstruct at MLM training stage as they can reflect distributional noise or semantic ambiguities that impair downstream performance. To that extent, we introduce a token scoring function based on label noise estimation, that aims to quantify token relationship with noise.

**Noise-Driven Token (ND) Score** We introduce a token-level scoring scheme based on annotation uncertainty. Following principles from confident learning (Northcutt et al., 2022), we identify frequent tokens in samples flagged as likely mislabeled, namely those having high discrepancies between predicted labels and class-conditional noise expectations. We extract these candidates using the Cleanlab toolkit (Northcutt et al., 2022), employing a confusion score that quantifies semantically contextually ambiguous tokens with the following score:

$$ S_t = \frac{f_t}{\max_{t'} f_{t'}} \quad (7) $$

where $f_t$ is the frequency of token $t$ in potentially misannotated instances, normalized by the maximum token frequency among all such instances. To focus on informative textual features, we exclude stop words and retain only the top 25% most frequent tokens within this error subset.

**Noise Removal Algorithm** For each masked token, we compute reconstruction loss during pre-training and pair it with the computed importance score, aiming to curate dataset label by flagging text instances that contain high-scoring tokens.

Such a methodology allows human-in-the-loop intervention and exploratory analysis of candidate tokens that the user can iterate in (ranking) order to investigate and curate label noise prior to perform SUD classification model fine-tuning (Figure 1(c)).

Our intuition relies on the fact that frequent tokens likely belong to patterns recognized and learned by the model to generalize over SUD classes. In this manner, we propose to consider such token-level statistics across the relative model reconstruction capabilities at pretraining stage. To correct noisy instances in a given corpus, we propose two strategies:

(1) **Relabeling** that replaces a label of an instance $X$, if this latter is different from the instance label in which the token with the highest score (in $X$) occurs globally more often.
**Example 1** Given a corpus *C* and a text instances *X* = {"abc"} ∈ *C* assigned with label 0. Let us consider that "b" would be the token with the highest score that occurs more often in instances assigned with label 1 ∈ *C*, the label of *X* changes to 1.

(2) **Filtering**, that removes from the corpus an instance X if this latter is assigned with a label different from the instance label in which the token with the highest score (in X) occurs globally more often.

**Example 2** Given a corpus *C'* and a text instances *Y* = {"cde"} ∈ *C'* assigned with label 1. Let us consider that "d" would be the token with the highest score that occurs more often in instances assigned with label 0 ∈ *C'*, *Y* is removed from *C'*.

**Downstream Task** For the evaluation of our methods we fine-tune our models on a multi-class classification task targeting Socially Unacceptable Discourse (SUD), as defined in Section 3.1.

The model architecture comprises a pretrained encoder that produces contextualized token representations, which are aggregated and passed to a lightweight classification head, a linear projection followed by a softmax activation, to yield a probability distribution over the target classes. Training is conducted using the standard cross-entropy loss between predicted distributions and ground-truth labels (Devlin et al., 2019; Clark et al., 2020; Zhang et al., 2023; Yang et al., 2023a; Moon et al., 2020; Sun et al., 2019).

# 4 Experimental Setup

In this section, we present the experimental framework employed to evaluate our artifact-aware pretraining approach, detailing the datasets and model configurations. Model training and evaluation were carried out using key libraries such as transformers, datasets, PyTorch, and TensorFlow. Comprehensive information on package versions and the computational environment is available in our repository to facilitate reproducibility: https://github.com/rayaneghilene/MLM \_Pretraining.

## 4.1 Datasets

We utilize the *G*<sup>SUD</sup> dataset introduced by Carneiro et al. (2023), which aggregates 13 publicly available English-language datasets spanning up to 12 SUD classes (see Table 4 in the appendix).

The full corpus comprises approximately 500K instances, with a significant imbalance across classes. The *neither* class accounts for over 70% of the samples, while individual SUD categories vary in frequency. By combining sources that differ in both discourse and annotation practices, *G*<sup>SUD</sup> captures substantial variation in the definition and expression of categories across contexts, providing a demanding benchmark for multi-domain learning. All datasets are publicly available and released under permissive licenses. Our use of these datasets is consistent with their original purpose, which was primarily classification and moderation of hate speech-related content. More details on the *G*<sup>SUD</sup> dataset are found in the work of Carneiro et al. (2023).

## 4.2 Models and Training Setup

We experiment with four transformer-based models from the Hugging Face library: bert-base-uncased (110M parameters), bert-large-uncased (340M), roberta-base (125M), and roberta-large (355M). All experiments were conducted on an infrastructure equipped with NVIDIA A100 GPUs (80 GB memory) and 2 TB main memory, equipped with 2 AMD Milan EPYC 7543 processors (32 cores at 2.80 GHz).

**MLM Pretraining** Pretraining is conducted on the *G*<sup>SUD</sup> corpus (~155K samples), to which we apply stratified under-sampling of the dominant *neither* class (10% retention).<sup>3</sup> Hyperparameters are tuned empirically. The final setup includes a learning rate of 1 × 10<sup>-5</sup>, weight decay of 0.001, batch size of 128, and 5 training epochs.<sup>4</sup>

**Downstream Classification Task** Following pre-training, models are fine-tuned on each single dataset composing *G*<sup>SUD</sup> for multi-class text classification. We split data using the following ratio: 80% training, 10% validation, and 10% test using stratified sampling. We employ the Hugging Face AutoModelForSequenceClassification wrapper, to attach a fully connected classification head

<footnote n="3"><sup>3</sup>A secondary configuration was also evaluated consisting of a focused subset containing only SUD-labeled instances (~120K samples), emphasizing domain-specific language. However, as this configuration did not yield any noticeable differences we omit to report the relative results.</footnote>

<footnote n="4"><sup>4</sup>The hyperparameter search space included the following configurations: learning rate ∈ {5 × 10<sup>-5</sup>, 2 × 10<sup>-5</sup>, 1 × 10<sup>-5</sup>}, weight decay ∈ {0.1, 0.01, 0.001}, batch size ∈ {64, 128}, and number of epochs ∈ {3, 5}.</footnote>
<figure><img src="image_4.png" /><figcaption>Figure 3: Aggregated F1 Score Performance Across Pretraining Paradigms and Experimental Conditions for BERT-Base, RoBERTa-Base, BERT-Large, and RoBERTa-Large.</figcaption></figure>

to the pretrained encoder. Input sequences are tokenized using the corresponding AutoTokenizer for each model. Fine-tuning is conducted for three epochs with a batch size of 16, a learning rate of $2 \times 10^{-5}$, and weight decay of 0.01. Each model is fine-tuned and evaluated across 10 runs with different seeds. Model performance is reported as the mean and standard deviation of the macro-averaged F1-score on the held-out test set.

# 5 Results

In this section we present and discuss the results of the proposed SUD classification framework.

## 5.1 Artifact-based Pretraining

**Pretraining Strategy Evaluation** Our first research objective is to evaluate the effectiveness of the different pretraining strategies discussed and proposed in the paper. Figure 3 shows the mean F1 score of SUD classification conducted with the baseline models and different pretraining strategies (**Random Masking + Weighted Loss**, **Top-k Masking + Weighted Loss**, **Random Masking**, **Top-k Masking**) leveraging the proposed artifacts scores (PMI Figure 3(top) and BERTopic Figure 3(bottom)). Here, we report the global mean of the classification performed in all the dataset reported in Table 4 across all masking proportions (Top-k = 5%, 10%, 15%, 25%, 35%). Our results indicate that pretraining strategies incorporate

<figure><img src="image_5.png" /><figcaption>Figure 4: F1 Score Performance of BERT-Base Across Different Masking Percentages</figcaption></figure>

Weighted Loss exhibit the best performance across all the settings, confirming the hypothesis that models reinforce their generalizability when reconstructed loss is weighted according to the context importance.

**Masking Percentage Optimization** Figure 4 presents the F1 scores of BERT-Base across different masking percentages under Pretraining with PMI and BERTopic artifact masking. Again, weighted Loss strategies consistently outperform their non-weighted counterparts, yielding optimal performances at the 25% masking level. In general we note that BERT-Base has performance either on par, or superior than the other models. Hence, in the following part of the evaluation, we solely consider BERT-Base.

## 5.2 Dataset Curation via Token Diagnostics

To analyze the errors and individuate the effectiveness of artifact-guided pretraining in learning meaningful token representations, we analyse the correlation between token-level statistical score and reconstruction difficulty (model loss) in the whole $G^{SUD}$ using the BERT-Base model. Figure 5 visualizes mean token reconstruction loss as a function of artifact extraction score (log scale), limited to the top 25% of tokens per method. Each dot represents a single token. To quantify these relationships, we compute Pearson correlation ($r$) between reconstruction loss and the log-transformed artifact scores. For the Noise-Driven score, we observe a strong negative correlation ($r = -0.64$), indicating that tokens with higher importance scores tend to be reconstructed more accurately in our framework. This suggests that tokens frequently associated with noisy labels are well reconstructed by the MLM reflecting the model's ability to encode patterns that are informative for reconstructing these artifacts. In contrast, BERTopic ($r = 0.01$) and PMI ($r = 0.03$) show no correlations with reconstruction loss, indicating a weaker association between
<figure><img src="image_6.png" /><figcaption>Figure 5: Mean token reconstruction loss vs. artifact extraction score (log scale). Each dot represents a single artifact from the top 25% of scores.</figcaption></figure>

their frequency and model uncertainty during pre-training.

**Dataset-Specific Curation** We begin by evaluating our curation strategy within each dataset independently, leveraging the proposed scores vs. loss diagnostics. Specifically, we curate our dataset by flagging sentences containing high-scoring tokens selected by the following thresholds (depicted in Figure 5): **PMI** ≥ 0.4, **BERTTopic** ≥ 0.6, and **Noise-Driven Score** ≥ 0.2 or ≥ 0.4. These values were selected to retain only the most salient tokens based on distributional breakpoints and qualitative review. Thresholds are reported here in raw form, while log-transformed values are used for visualization in plots. We then apply the token-level diagnostics described in Section 3.4 to curate the datasets with the two types of intervention: (1) **Relabeling**, and (2) **Filtering** prior to perform SUD classification.

Table 1 presents the performance impact of each method across 13 datasets. We observe that curation strategies yield mixed results: in datasets such as **Founta**, **Gab**, and **Hateval**, both relabeling and filtering significantly improve performance, suggesting that model errors were at least partly driven by annotation inconsistencies or label noise. Conversely, for datasets such as **Davidson** and **Olid**, the gains are modest or neutral, and aggressive filtering thresholds can even lead to degradation. Importantly, we found that certain datasets exhibited unexpected performance drops under these interventions, particularly **Fox** and **Grimminger**.

**Large Scale Curation** We extend our analysis considering SUD classification in the complete ($G^{SUD}$) corpus. Such scenario is challenging, as it introduces further annotation noise due to heterogeneous labeling criteria of different sources. We apply the same token-level relabeling and filtering methods described in the previous experiment. Table 2 (left) shows the absolute F1 scores for each

<figure><img src="image_7.png" /><figcaption>Figure 6: Percentage Frequency of Selected Tokens by Noise-Driven Method across Datasets</figcaption></figure>

method on the $G^{SUD}$ corpus (~155K samples) (we apply stratified under-sampling of the dominant *neither* class (10% retention) as suggested in (Carneiro et al., 2023)). Relabeling with noise-driven diagnostics at a 0.2 threshold performs best, achieving an F1 score of 66.9. Table 2 (right) reports the relative differences from the baseline. The same method yields the highest gain (+11.2), followed by BERTopic (+8.1). Filtering methods show smaller but consistent improvements. These results indicate that our token-based techniques are effective not only for individual datasets but also when applied to a large scale scenario, better resolving cross-dataset inconsistencies.

We also conducted a manual verification SUD Instance relabelling in the Appendix

## 5.3 Human-Guided Explainable Approach

While applying automatic relabeling and filtering strategies by automatically filtering noisy instances, we observe that even limited interventions could lead to notable drops in performance on certain datasets, such as **Grimminger** and **Fox** as shown in Table 1. To understand this, we analyze token distributions depicted in Figure 6, which displays the normalized frequency of selected tokens in each
<table><caption>Table 1: Performance comparison of our relabeling and filtering methods at a dataset level. Scores are averages of 10 runs with different seeds, while subscripts indicate standard deviation. We depict scores above the baseline in bold.</caption><thead><tr><th rowspan="2">Dataset</th><th rowspan="2">Baseline</th><th colspan="4">Relabeling</th><th colspan="4">Filtering</th></tr><tr><th>Noise-Driven ≥ 0.2</th><th>Noise-Driven ≥ 0.4</th><th>BERTTopic ≥ 0.6</th><th>PMI ≥ 0.4</th><th>Noise-Driven ≥ 0.2</th><th>Noise-Driven ≥ 0.4</th><th>BERTTopic ≥ 0.6</th><th>PMI ≥ 0.4</th></tr></thead><tbody><tr><td>Davidson</td><td>76.3<sub>1.2</sub></td><td>73.3<sub>2.2</sub></td><td>75.8<sub>2.3</sub></td><td>75.5<sub>1.6</sub></td><td>76.3<sub>1.2</sub></td><td>72.2<sub>3.7</sub></td><td>75.8<sub>1.5</sub></td><td>76.5<sub>1.7</sub></td><td>76.3<sub>1.0</sub></td></tr><tr><td>Founta</td><td>76.3<sub>0.7</sub></td><td>79.9<sub>1.5</sub></td><td>78.6<sub>0.9</sub></td><td>76.7<sub>0.6</sub></td><td>76.3<sub>0.7</sub></td><td>79.6<sub>1.6</sub></td><td>78.4<sub>0.9</sub></td><td>75.9<sub>0.7</sub></td><td>76.3<sub>0.7</sub></td></tr><tr><td>Fox</td><td>67.0<sub>2.7</sub></td><td>60.2<sub>1.6</sub></td><td>58.7<sub>3.1</sub></td><td>64.5<sub>0.7</sub></td><td>66.8<sub>2.7</sub></td><td>55.6<sub>6.3</sub></td><td>62.3<sub>4.2</sub></td><td>64.5<sub>4.3</sub></td><td>66.9<sub>2.7</sub></td></tr><tr><td>Gab</td><td>90.0<sub>0.3</sub></td><td>95.2<sub>0.3</sub></td><td>93.2<sub>0.5</sub></td><td>90.4<sub>0.5</sub></td><td>90.3<sub>0.4</sub></td><td>93.1<sub>0.5</sub></td><td>91.8<sub>0.5</sub></td><td>90.4<sub>0.6</sub></td><td>90.0<sub>0.3</sub></td></tr><tr><td>Grimminger</td><td>72.5<sub>2.5</sub></td><td>52.7<sub>4.5</sub></td><td>67.8<sub>5.8</sub></td><td>70.1<sub>0.3</sub></td><td>72.2<sub>2.2</sub></td><td>58.7<sub>3.7</sub></td><td>68.9<sub>5.5</sub></td><td>72.1<sub>3.6</sub></td><td>72.4<sub>2.5</sub></td></tr><tr><td>Hasoc2019</td><td>46.7<sub>1.8</sub></td><td>45.2<sub>3.4</sub></td><td>42.1<sub>2.4</sub></td><td>44.1<sub>3.3</sub></td><td>46.7<sub>1.8</sub></td><td>43.5<sub>3.8</sub></td><td>44.1<sub>2.9</sub></td><td>46.0<sub>1.3</sub></td><td>46.7<sub>1.8</sub></td></tr><tr><td>Hasoc2020</td><td>56.4<sub>2.2</sub></td><td>53.1<sub>3.9</sub></td><td>54.3<sub>2.3</sub></td><td>54.0<sub>2.0</sub></td><td>53.4<sub>2.2</sub></td><td>58.1<sub>3.6</sub></td><td>52.8<sub>2.2</sub></td><td>56.7<sub>2.9</sub></td><td>56.4<sub>2.2</sub></td></tr><tr><td>Hateval</td><td>77.0<sub>1.0</sub></td><td>87.1<sub>0.7</sub></td><td>84.5<sub>0.7</sub></td><td>77.7<sub>1.3</sub></td><td>77.0<sub>1.0</sub></td><td>84.9<sub>1.8</sub></td><td>80.9<sub>1.2</sub></td><td>77.3<sub>0.5</sub></td><td>77.0<sub>1.0</sub></td></tr><tr><td>Jigsaw</td><td>55.1<sub>1.0</sub></td><td>63.6<sub>2.0</sub></td><td>61.3<sub>1.1</sub></td><td>57.9<sub>0.9</sub></td><td>54.6<sub>1.2</sub></td><td>60.1<sub>2.7</sub></td><td>58.2<sub>1.2</sub></td><td>55.4<sub>0.9</sub></td><td>54.7<sub>1.0</sub></td></tr><tr><td>Olid</td><td>78.0<sub>1.0</sub></td><td>79.7<sub>1.5</sub></td><td>78.8<sub>1.0</sub></td><td>77.3<sub>1.1</sub></td><td>77.4<sub>1.0</sub></td><td>80.3<sub>2.2</sub></td><td>77.7<sub>1.3</sub></td><td>77.7<sub>3.6</sub></td><td>77.5<sub>1.0</sub></td></tr><tr><td>Reddit</td><td>84.8<sub>0.9</sub></td><td>82.5<sub>1.5</sub></td><td>86.5<sub>1.2</sub></td><td>84.5<sub>0.6</sub></td><td>84.9<sub>0.7</sub></td><td>83.7<sub>1.8</sub></td><td>86.4<sub>1.3</sub></td><td>85.1<sub>0.8</sub></td><td>84.9<sub>0.8</sub></td></tr><tr><td>Stormfront</td><td>77.9<sub>1.7</sub></td><td>63.6<sub>4.2</sub></td><td>70.9<sub>2.0</sub></td><td>75.9<sub>0.2</sub></td><td>77.8<sub>1.8</sub></td><td>69.1<sub>3.7</sub></td><td>75.2<sub>2.5</sub></td><td>78.1<sub>2.2</sub></td><td>77.9<sub>1.7</sub></td></tr><tr><td>Trac</td><td>74.6<sub>0.6</sub></td><td>80.4<sub>1.4</sub></td><td>78.2<sub>1.2</sub></td><td>74.9<sub>1.3</sub></td><td>74.7<sub>0.5</sub></td><td>79.1<sub>0.9</sub></td><td>77.5<sub>1.3</sub></td><td>75.0<sub>1.4</sub></td><td>74.1<sub>1.3</sub></td></tr></tbody></table>

<table><caption>Table 2.1: F1 scores for relabeling and filtering methods.</caption><thead><tr><th>Method</th><th>Relabeling</th><th>Filtering</th></tr></thead><tbody><tr><td>Noise-Driven (≥ 0.2)</td><td>66.9<sub>1.6</sub></td><td>62.2<sub>1.4</sub></td></tr><tr><td>Noise-Driven (≥ 0.4)</td><td>62.8<sub>1.1</sub></td><td>61.4<sub>1.3</sub></td></tr><tr><td>BERTTopic (≥ 0.6)</td><td>65.1<sub>0.5</sub></td><td>60.7<sub>0.6</sub></td></tr><tr><td>PMI (≥ 0.4)</td><td>60.1<sub>0.7</sub></td><td>60.2<sub>0.4</sub></td></tr></tbody></table>

<table><caption>Table 2.2: Relative differences from baseline.</caption><thead><tr><th>Method</th><th>Relabeling</th><th>Filtering</th></tr></thead><tbody><tr><td>Noise-Driven (≥ 0.2)</td><td><strong>+11.1</strong></td><td><strong>+3.3</strong></td></tr><tr><td>Noise-Driven (≥ 0.4)</td><td><strong>+4.3</strong></td><td><strong>+2.0</strong></td></tr><tr><td>BERTTopic (≥ 0.6)</td><td><strong>+8.1</strong></td><td><strong>+0.8</strong></td></tr><tr><td>PMI (≥ 0.4)</td><td>-0.2</td><td>+0.0</td></tr></tbody></table>

<caption>Table 2: Comparison of relabeling and filtering methods (left) on a class-balanced subset of the G<sup>SUD</sup> corpus in F1 scores and their relative differences from baseline (right). Scores are averages of 10 runs with different seeds, while subscripts indicate standard deviation.</caption>

dataset, for which the ND score is greater than or equal to 0.4. We observe that salient tokens potentially related to SUD (e.g., *b*tch, *f*cking) are under-represented in Grimminger and Fox, suggesting that previously repaired instances contain neutral language. Guided by such explanation, we restrict the interventions to tokens with high support and semantic relevance to SUD. In this experiment, we also consider token ranking using BERTTopic-based score. This selective approach leads to more consistent improvements in ten datasets as reflected in Table 3.

We also perform a manual verification of SUD instance relabelling (See section 7 in the appendix).

## 6 Conclusion

The results of this study offer several insights into the role of SUD artifacts in guiding pretraining and improving dataset quality for the task of SUD classification. While standard masked language modeling provides only limited improvements in down-

<table><caption>Table 3: Comparison of F1 scores (mean<sub>std</sub>) across datasets with different noise-handling strategies: baseline (original labels), relabeling using Noise-Driven (ND) and BERTTopic (BT) approaches, and filtering based on noise scores.</caption><thead><tr><th rowspan="2">Dataset</th><th rowspan="2">Baseline</th><th colspan="4">Relabeling</th><th colspan="4">Filtering</th></tr><tr><th>ND ≥ 0.2</th><th>ND ≥ 0.4</th><th>BT ≥ 0.6</th><th>ND ≥ 0.2</th><th>ND ≥ 0.4</th><th>BT ≥ 0.6</th><th>ND ≥ 0.2</th><th>ND ≥ 0.4</th></tr></thead><tbody><tr><td>Davidson</td><td>76.3<sub>1.2</sub></td><td>75.5<sub>1.4</sub></td><td>77.3<sub>2.1</sub></td><td>76.5<sub>1.0</sub></td><td>76.2<sub>1.7</sub></td><td>76.6<sub>1.8</sub></td><td>76.5<sub>1.0</sub></td><td>76.6<sub>1.7</sub></td><td>77.9<sub>0.7</sub></td></tr><tr><td>Founta</td><td>76.3<sub>0.7</sub></td><td>78.4<sub>0.5</sub></td><td>78.2<sub>0.7</sub></td><td>78.1<sub>0.7</sub></td><td>78.2<sub>1.0</sub></td><td>77.8<sub>0.5</sub></td><td>77.8<sub>0.7</sub></td><td>77.7<sub>0.5</sub></td><td>77.9<sub>0.7</sub></td></tr><tr><td>Fox</td><td>67.0<sub>2.7</sub></td><td>67.2<sub>4.1</sub></td><td>70.6<sub>1.6</sub></td><td>70.3<sub>1.4</sub></td><td>65.7<sub>5.2</sub></td><td>70.4<sub>1.6</sub></td><td>70.6<sub>1.6</sub></td><td>70.4<sub>1.6</sub></td><td>70.6<sub>1.6</sub></td></tr><tr><td>Gab</td><td>90.0<sub>0.3</sub></td><td>92.4<sub>0.3</sub></td><td>91.0<sub>0.4</sub></td><td>90.8<sub>0.4</sub></td><td>92.2<sub>0.4</sub></td><td>91.0<sub>0.5</sub></td><td>90.8<sub>0.4</sub></td><td>91.0<sub>0.5</sub></td><td>90.8<sub>0.4</sub></td></tr><tr><td>Grimminger</td><td>72.5<sub>2.5</sub></td><td>68.4<sub>3.3</sub></td><td>72.7<sub>3.2</sub></td><td>72.5<sub>3.0</sub></td><td>71.4<sub>5.2</sub></td><td>72.6<sub>1.1</sub></td><td>72.6<sub>1.1</sub></td><td>72.6<sub>1.1</sub></td><td>72.6<sub>1.1</sub></td></tr><tr><td>Hasoc2019</td><td>46.7<sub>1.8</sub></td><td>48.5<sub>2.5</sub></td><td>46.4<sub>2.0</sub></td><td>46.0<sub>2.0</sub></td><td>47.8<sub>2.4</sub></td><td>45.6<sub>2.0</sub></td><td>46.0<sub>2.0</sub></td><td>45.6<sub>2.0</sub></td><td>46.0<sub>2.0</sub></td></tr><tr><td>Hasoc2020</td><td>56.4<sub>2.2</sub></td><td>58.2<sub>4.3</sub></td><td>56.2<sub>1.7</sub></td><td>56.2<sub>1.7</sub></td><td>56.7<sub>2.7</sub></td><td>56.2<sub>1.7</sub></td><td>56.2<sub>1.7</sub></td><td>56.2<sub>1.7</sub></td><td>56.2<sub>1.7</sub></td></tr><tr><td>Hateval</td><td>77.0<sub>1.0</sub></td><td>82.6<sub>0.9</sub></td><td>82.2<sub>0.9</sub></td><td>81.8<sub>0.9</sub></td><td>83.3<sub>0.7</sub></td><td>82.5<sub>0.9</sub></td><td>81.8<sub>0.9</sub></td><td>82.5<sub>0.9</sub></td><td>81.8<sub>0.9</sub></td></tr><tr><td>Jigsaw</td><td>55.1<sub>1.0</sub></td><td>64.5<sub>1.5</sub></td><td>58.2<sub>0.9</sub></td><td>58.4<sub>0.9</sub></td><td>60.5<sub>0.8</sub></td><td>58.7<sub>1.1</sub></td><td>58.4<sub>0.9</sub></td><td>58.7<sub>1.1</sub></td><td>58.4<sub>0.9</sub></td></tr><tr><td>Olid</td><td>78.0<sub>1.0</sub></td><td>80.1<sub>0.8</sub></td><td>77.7<sub>0.7</sub></td><td>77.6<sub>0.7</sub></td><td>78.6<sub>1.1</sub></td><td>77.7<sub>0.7</sub></td><td>77.6<sub>0.7</sub></td><td>77.7<sub>0.7</sub></td><td>77.6<sub>0.7</sub></td></tr><tr><td>Reddit</td><td>84.8<sub>0.9</sub></td><td>86.7<sub>1.0</sub></td><td>85.7<sub>0.9</sub></td><td>85.9<sub>0.7</sub></td><td>86.4<sub>0.8</sub></td><td>85.1<sub>1.1</sub></td><td>85.9<sub>0.7</sub></td><td>85.1<sub>1.1</sub></td><td>85.9<sub>0.7</sub></td></tr><tr><td>Stormfront</td><td>77.9<sub>1.7</sub></td><td>76.3<sub>2.5</sub></td><td>78.1<sub>1.8</sub></td><td>78.1<sub>1.8</sub></td><td>77.8<sub>2.1</sub></td><td>78.1<sub>1.1</sub></td><td>78.1<sub>1.8</sub></td><td>78.1<sub>1.1</sub></td><td>78.1<sub>1.8</sub></td></tr><tr><td>Trac</td><td>74.6<sub>0.6</sub></td><td>75.2<sub>1.6</sub></td><td>75.1<sub>0.7</sub></td><td>75.1<sub>0.7</sub></td><td>75.4<sub>1.2</sub></td><td>75.2<sub>0.6</sub></td><td>75.2<sub>0.7</sub></td><td>75.2<sub>0.6</sub></td><td>75.2<sub>0.7</sub></td></tr></tbody></table>

stream performance across model architectures, introducing artifact-weighted loss consistently yields better results. By assigning greater importance to semantically important tokens, the model is encouraged to focus on contextually challenging regions. Beyond model performance, our curation strategy, based on token-level relabeling and filtering, proves valuable for interpretability. With minimal changes to the data, the method reveals annotation inconsistencies, offering a lightweight mechanism for surfacing potential labeling issues. This enables more transparent error analysis and targeted refinement.

## 7 Limitations

While our artifact-guided curation framework demonstrates clear potential, it can further evolve to better support human understanding during annotation. Although our approach effectively surfaces tokens in ambiguous or noisy environments through artifact-based heuristics, it may overlook subtle linguistic inconsistencies or contextual errors that can only be reliably detected by human annotators. As a result, a dedicated annotation
campaign supported by our solution remains necessary to validate and complement our dataset curation methods. Moreover, we plan to extend the human-in-the-loop approach to the *G*<sup>SUD</sup> corpus, increasing our ability to assess the method's effectiveness in this setting, where tailored adaptation and computational challenges need to be addressed. Finally, the token selection thresholds, though informed by distributional patterns and qualitative assessment, remain heuristic. Future work could investigate more principled, data-driven approaches to enhance the robustness and generalizability of the dataset curation framework.

## Acknowledgments

The work presented in this paper is part of the ARENAS project. This project has received funding from the European Union's Horizon Europe research and innovation programme under grant agreement No:101094731.

This work was granted access to the HPC resources of IDRIS under the allocation 2024-AD010615085R1 made by GENCI.

## References

Dimosthenis Antypas and Jose Camacho-Collados. 2023. Robust hate speech detection in social media: A cross-dataset empirical evaluation. In *The 7th Workshop on Online Abuse and Harms (WOAH)*, pages 231–242, Toronto, Canada. Association for Computational Linguistics.

Valerio Basile, Cristina Bosco, Elisabetta Fersini, et al. 2019. Semeval-2019 task 5: Multilingual detection of hate speech against immigrants and women in twitter. In *Proceedings of the 13th international workshop on semantic evaluation*.

Bruno Machado Carneiro, Michele Linardi, and Julien Longhi. 2023. Studying socially unacceptable discourse classification (SUD) through different eyes: "are we on the same page ?". CoRR, abs/2308.04180.

Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020. Electra: Pre-training text encoders as discriminators rather than generators. Preprint, arXiv:2003.10555.

Thomas Davidson, Dana Warmsley, Michael W. Macy, et al. 2017. Automated hate speech detection and the problem of offensive language. In *Proceedings of the Eleventh International Conference on Web and Social Media, ICWSM*. AAAI Press.

Ona De Gibert, Naiara Perez, Aitor García-Pablos, and Montse Cuadros. 2018. Hate speech dataset from a white supremacy forum. arXiv preprint arXiv:1809.04444.

Koustuv de Maiti and Darja Fišer. 2021. Working with socially unacceptable discourse online: Researchers' perspective on distressing data. In *Proceedings of the 8th Conference on CMC and Social Media Corpora for the Humanities (CMC-Corpora 2021)*, pages 78–82.

Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)*.

Danielle Draper and Sabine Neschke. 2023. Social media algorithms: The pros and cons.

Mai ElSherief, Caleb Ziems, David Muchlinski, Vaishnavi Anupindi, Jordyn Seybolt, Munmun De Choudhury, and Diyi Yang. 2021. Latent hatred: A benchmark for understanding implicit hate speech. In *Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing*, pages 345–363, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.

Robert M Fano. 1963. *Transmission of information: a statistical theory of communications*. MIT press.

Paula Fortuna, Juan Soler-Company, and Leo Wanner. 2021. How well do hate speech, toxicity, abusive and offensive language classification models generalize across datasets? *Information Processing & Management*, 58(3):102524.

Antigoni-Maria Founta, Constantinos Djouvas, Despoina Chatzakou, et al. 2018. Large scale crowdsourcing and characterization of twitter abusive behavior. In *Proceedings of the Twelfth International Conference on Web and Social Media, ICWSM*.

Ankita Gandhi, Param Ahir, Kinjal Adhvaryu, Pooja Shah, Ritika Lohiya, Erik Cambria, Soujanya Poria, and Amir Hussain. 2024. Hate speech detection: A comprehensive review of recent works. *Expert Systems*, 41.

Lei Gao and Ruihong Huang. 2017. Detecting online hate speech using context aware models. In *Proceedings of the International Conference Recent Advances in Natural Language Processing, RANLP*.

Rayane Ghilene, Dimitra Niaouri, Michele Linardi, and Julien Longhi. 2024. Analysis of socially unacceptable discourse with zero-shot learning. Preprint, arXiv:2409.13735.

Lara Grimminger and Roman Klinger. 2021. Hate towards the political opponent: A twitter corpus study of the 2020 US elections on the basis of offensive speech and stance detection. In *Proceedings of the Eleventh Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, WASSA@EACL 2021*.
Maarten Grootendorst. 2022. Bertopic: Neural topic modeling with a class-based tf-idf procedure. *arXiv preprint arXiv:2203.05794*.

Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel R Bowman, and Noah A Smith. 2018. Annotation artifacts in natural language inference data. *arXiv preprint arXiv:1803.02324*.

Thomas Hartvigsen, Saadia Gabriel, Hamid Palangi, Maarten Sap, Dipankar Ray, and Ece Kamar. 2022. Toxigen: A large-scale machine-generated dataset for adversarial and implicit hate speech detection. In *Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)*, ACL 2022, Dublin, Ireland, May 22-27, 2022, pages 3309–3326. Association for Computational Linguistics.

Thorsten Joachims et al. 1997. A probabilistic analysis of the rocchio algorithm with tfidf for text categorization. In *ICML*, volume 97, pages 143–151. Citeseer.

Vanja Mladen Karan and Jan Šnajder. 2018. Cross-domain detection of abusive language online. In *Proceedings of the 2nd Workshop on Abusive Language Online (ALW2)*, pages 132–137, Brussels, Belgium. Association for Computational Linguistics.

Jan Kocon, Alicja Figas, Marcin Gruza, et al. 2021. Offensive, aggressive, and hate speech analysis: From data-centric to human-centered approach. *Inf. Process. Manag.*, 58(5).

Ritesh Kumar, Aishwarya N Reganti, Akshit Bhataia, et al. 2018. Aggression-annotated corpus of hindi-english code-mixed data. *arXiv preprint arXiv:1803.09402*.

Yoav Levine, Barak Lenz, Opher Lieber, Omri Abend, Kevin Leyton-Brown, Moshe Tennenholtz, and Yoav Shoham. 2020. Pmi-masking: Principled masking of correlated spans. *Preprint*, arXiv:2010.01825.

Jitendra Singh Malik, Hezhe Qiao, Guansong Pang, and Anton van den Hengel. 2024. Deep learning for hate speech detection: a comparative study. *International Journal of Data Science and Analytics*.

Thomas Mandl, Sandip Modha, Anand Kumar M, et al. 2020. Overview of the hasoc track at fire 2020: Hate speech and offensive language identification in tamil, malayalam, hindi, english and german. In *Proceedings of the 12th annual meeting of the forum for information retrieval evaluation*.

Thomas Mandl, Sandip Modha, Prasenjit Majumder, et al. 2019. Overview of the hasoc track at fire 2019: Hate speech and offensive content identification in indo-european languages. In *Proceedings of the 11th annual meeting of the Forum for Information Retrieval Evaluation*.

Ilia Markov and Walter Daelemans. 2021a. Improving cross-domain hate speech detection by reducing the false positive rate. In *Proceedings of the Fourth Workshop on NLP for Internet Freedom: Censorship, Disinformation, and Propaganda*, pages 17–22.

Ilia Markov and Walter Daelemans. 2021b. Improving cross-domain hate speech detection by reducing the false positive rate. In *Proceedings of the Fourth Workshop on NLP for Internet Freedom: Censorship, Disinformation, and Propaganda*, pages 17–22, Online. Association for Computational Linguistics.

Binny Mathew, Punyajoy Saha, Seid Muhie Yimam, Chris Biemann, Pawan Goyal, and Animesh Mukherjee. 2022. *Hatexplain: A benchmark dataset for explainable hate speech detection*. *Preprint*, arXiv:2012.10289.

Yu Meng, Jitin Krishnan, Sinong Wang, Qifan Wang, Yuning Mao, Han Fang, Marjan Ghazvininejad, Ji-awei Han, and Luke Zettlemoyer. 2024. Representation deficiency in masked language modeling. In *The Twelfth International Conference on Learning Representations, ICLR 2024*, Vienna, Austria, May 7-11, 2024.

Ioannis Mollas, Zoe Chrysopoulou, Stamatis Karlos, and Grigorios Tsoumakas. 2022. *Ethos: a multi-label hate speech detection dataset*. *Complex & Intelligent Systems*, 8(6):4663–4678.

Seung Jun Moon, Sangwoo Mo, Kimin Lee, Jaeho Lee, and Jinwoo Shin. 2020. *Masker: Masked keyword regularization for reliable text classification*. In *AAAI Conference on Artificial Intelligence*.

Nafeesa Murad, Mohd Hilmi Hasan, Muhammad Azam, Nadia Yousuf, and Jameel Yalli. 2024. Unraveling the Black Box: A Review of Explainable Deep Learning Healthcare Techniques. *IEEE Access*, PP:1–1.

Dimitra Niaouri, Michele Linardi, and Julien Longhi. 2024. Towards a new contextualized annotation schema for unacceptable and extreme speech (cues) to unleash generalization capability of ml models. *Studii de lingvistică*, 14(2):63–94.

Dimitra Niaouri, Bruno Machado Carneiro, Michele Linardi, and Julien Longhi. 2025. Machine Learning is heading to the SUD (Socially Unacceptable Discourse) analysis: from Shallow Learning to Large Language Models to the rescue, where do we stand? *Digital linguistics*.

Curtis G. Northcutt, Lu Jiang, and Isaac L. Chuang. 2022. *Confident learning: Estimating uncertainty in dataset labels*. *Preprint*, arXiv:1911.00068.

Inez Okulska and Anna Kołos. 2024. *A morphosyntactic analysis of human-moderated hate speech samples from wykop.pl web service*. *Półrocznik Językoznawczy Tertium*, 8:54–71.

Endang Wahyu Pamungkas and Viviana Patti. 2019. Cross-domain and cross-lingual abusive language detection: A hybrid approach with deep learning and a multilingual lexicon. In *Proceedings of the 57th Annual Meeting of the Association for Computational Workshop on NLP for Internet Freedom: Censorship, Disinformation, and Propaganda*, pages 17–22.
*Linguistics: Student Research Workshop*, pages 363–370, Florence, Italy. Association for Computational Linguistics.

Jing Qian, Anna Bethke, Yinyin Liu, Elizabeth Belding, and William Yang Wang. 2019. A benchmark dataset for learning to intervene in online hate speech. In *Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)*, pages 4755–4764, Hong Kong, China. Association for Computational Linguistics.

Alan Ramponi and Sara Tonelli. 2022. Features or spurious artifacts? data-centric baselines for fair and robust hate speech detection. In *Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*, pages 3027–3040, Seattle, United States. Association for Computational Linguistics.

N Reimers. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks. *arXiv preprint arXiv:1908.10084*.

Joni Salminen, Maximilian Hopf, Shammur Chowdhury, Soon-Gyo Jung, Hind Almerekhi, and Jim Jansen. 2020. Developing an online hate classifier for multiple social media platforms. *Human-centric Computing and Information Sciences*, 10:1.

Maarten Sap, Saadia Gabriel, Lianhui Qin, Dan Jurafsky, Noah A. Smith, and Yejin Choi. 2020. Social bias frames: Reasoning about social and power implications of language. *Preprint*, arXiv:1911.03891.

Rohit Sridhar and Diyi Yang. 2022. Explaining toxic text via knowledge enhanced text generation. In *Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*, pages 811–826, Seattle, United States. Association for Computational Linguistics.

Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xin Tian, Danxiang Zhu, Hao Tian, and Hua Wu. 2019. Ernie: Enhanced representation through knowledge integration. *ArXiv*, abs/1904.09223.

Steve Durairaj Swamy, Anupam Jamatia, and Björn Gambäck. 2019a. Studying generalisability across abusive language detection datasets. In *Proceedings of the 23rd conference on computational natural language learning (CoNLL)*, pages 940–950.

Steve Durairaj Swamy, Anupam Jamatia, and Björn Gambäck. 2019b. Studying generalisability across abusive language detection datasets. In *Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)*, pages 940–950, Hong Kong, China. Association for Computational Linguistics.

Cagri Toraman, Furkan Şahinuç, and Eyup Halit Yilmaz. 2022. Large-scale hate speech detection with cross-domain transfer. *arXiv preprint arXiv:2203.01111*.

Betty Van Aken, Julian Risch, Ralf Krestel, et al. 2018. Challenges for toxic comment classification: An in-depth error analysis. *arXiv preprint arXiv:1809.07572*.

Vasja Vehovar, Blaž Povž, Darja Fiser, Nikola Ljubešić, Ajda Šulc, and Dejan Jontes. 2020. Družbeno nesprejemljivi diskurz na facebookovih straneh novičarskih portalov. *Teorija in Praksa*, 57:622–645.

Neemesh Yadav, Sarah Masud, Vikram Goyal, Md Shad Akhtar, and Tanmoy Chakraborty. 2024. Tox-BART: Leveraging toxicity attributes for explanation generation of implicit hate speech. In *Findings of the Association for Computational Linguistics: ACL 2024*, pages 13967–13983, Bangkok, Thailand. Association for Computational Linguistics.

Dongjie Yang, Zhuosheng Zhang, and Hai Zhao. 2023a. Learning better masking for better language model pre-training. *Preprint*, arXiv:2208.10806.

Yongjin Yang, Joonkee Kim, Yujin Kim, Namgyu Ho, James Thorne, and Se-Young Yun. 2023b. HARE: Explainable Hate Speech Detection with Step-by-Step Reasoning. In *Findings of the Association for Computational Linguistics: EMNLP 2023*, pages 5490–5505. Association for Computational Linguistics.

Mesay Gemeda Yigezu, Olga Kolesnikova, Grigori Sidorov, and Alexander F Gelbukh. 2023. Transformer-based hate speech detection for multi-class and multi-label classification. In *IberLEF@SEPLN*.

Wenjie Yin and Arkaitz Zubiaga. 2021. Towards generalisable hate speech detection: a review on obstacles and solutions. *PeerJ Computer Science*, 7:e598.

Lanqin Yuan and Marian-Andrei Rizoiu. 2022. Detect hate speech in unseen domains using multi-task learning: A case study of political public figures. *CoRR*, abs/2208.10598.

Marcos Zampieri, Shervin Malmasi, Preslav Nakov, et al. 2019. Predicting the type and target of offensive posts in social media. In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*.

Linhuan Zhang, Qian Chen, Wen Wang, Chong Deng, Xin Cao, Kongzhang Hao, Yuxin Jiang, and Wei Wang. 2023. Weighted sampling for masked language modeling. In *ICASSP 2023 - 2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)*, pages 1–5.
# Appendix

## Datasets

In Table 4, we report the source and metadata of all datasets used in the empirical evaluation of our solution.

<table><caption>Table 4: Summary of datasets used in this study Carneiro et al. (2023).</caption><thead><tr><th>Dataset</th><th>Source</th><th>Sample Type</th><th># Samples</th><th>Labels</th></tr></thead><tbody><tr><td>Davidson</td><td>Davidson et al. (2017)</td><td>Tweets</td><td>25,000</td><td>hate, offensive, neither</td></tr><tr><td>Founta</td><td>Founta et al. (2018)</td><td>Tweets</td><td>100,000</td><td>abusive, hate, neither</td></tr><tr><td>Fox</td><td>Gao and Huang (2017)</td><td>Threads</td><td>1,528</td><td>hate, neither</td></tr><tr><td>Gab</td><td>Kocon et al. (2021)</td><td>Posts</td><td>34,000</td><td>hate, neither</td></tr><tr><td>Grimminger</td><td>Grimminger and Klinger (2021)</td><td>Tweets</td><td>3,000</td><td>hate, neither</td></tr><tr><td>HASOC2019</td><td>Mandl et al. (2019)</td><td>Facebook, Twitter</td><td>12,000</td><td>hate, offensive, profane, neither</td></tr><tr><td>HASOC2020</td><td>Mandl et al. (2020)</td><td>Facebook posts</td><td>12,000</td><td>hate, offensive, profane, neither</td></tr><tr><td>Hateval</td><td>Basile et al. (2019)</td><td>Tweets</td><td>13,000</td><td>hate, neither</td></tr><tr><td>Jigsaw</td><td>Van Aken et al. (2018)</td><td>Wikipedia talk pages</td><td>220,000</td><td>identity hate, insult, obscene, severe toxic, threat, toxic, neither</td></tr><tr><td>Olid</td><td>Zampieri et al. (2019)</td><td>Tweets</td><td>14,000</td><td>offensive, neither</td></tr><tr><td>Reddit</td><td>Yuan and Rizoiu (2022)</td><td>Posts</td><td>22,000</td><td>hate, neither</td></tr><tr><td>Stormfront</td><td>De Gibert et al. (2018)</td><td>Threads</td><td>10,500</td><td>hate, neither</td></tr><tr><td>Trac</td><td>Kumar et al. (2018)</td><td>Facebook posts</td><td>15,000</td><td>aggressive, neither</td></tr></tbody></table>

## Manual Verification of SUD Instance Relabelling

To qualitatively evaluate the proposed Dataset Curation method (Section 5.2), we conducted a manual review of a representative sample. In Tables 5 and 6 we present the manual verification of instances identified by our token-driven diagnostic algorithms (Noise-Driven and BERTopic Scores). Each row lists the sentence (Instance), the salient Token triggering the flag, the original Ground Truth label, the suggested Relabeling, the Dataset source, and the outcome of Manual verification.

For this inspection, we applied a token-driven extraction strategy, selecting sentences linked to the most salient tokens (Noise-Driven score ≥ 0.4, BERTopic score ≥ 0.6). Our findings indicate that the framework reliably identifies annotation inconsistencies and borderline cases that benefit from closer human scrutiny.

In many instances, the method identifies clear annotation errors that warrant relabeling:

* Table 5 (18): "and this retarded bitch has over k followers" (Neither → Hate)

In other cases, relabeling is suggested where the presence of vulgar language makes the distinction between socially unacceptable and acceptable content ambiguous, requiring human judgment:

* Table 6 (2): "fuck all that bullshit who tf is young crazy ep dropping this april stay tuned" (Neither → Abusive)

Occasionally, the algorithm produces incorrect relabelings showing that even those cases allow us to identify spurious correlations, where tokens typically associated with SUD may in fact occur in a simple vulgar context:

* Table 5 (5): "frustration can be a bitch" (Neither → Offensive)

Overall, these results demonstrate that our method can serve as an effective diagnostic tool, complementing human judgment and aiding annotators in refining datasets with improved precision.
<table><caption>Table 5: Manual verification of instances flagged by our token-driven diagnostic algorithm (Noise-Driven Score). Columns show the sentence (Instance), salient Token, original Ground Truth, suggested Relabeling, Dataset, and Manual verification outcome (green = correct, red = incorrect).</caption><thead><tr><th>Instance</th><th>Token</th><th>Ground Truth</th><th>Relabeling</th><th>Dataset</th><th>Manual verification</th></tr></thead><tbody><tr><td>1. all of kate uptons leaked nudes today amp more bitch lo</td><td>bitch</td><td>Neither</td><td>Offensive</td><td>Davidson</td><td>Correct</td></tr><tr><td>2. mouth fucking for two bitches</td><td>fucking</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Correct</td></tr><tr><td>3. my favorite episode of friends is the one where blacks mysteriously vanish and unemployed white people find affordable ho</td><td>people</td><td>Neither</td><td>Offensive</td><td>Davidson</td><td>Correct</td></tr><tr><td>4. it is u and sickular mind people</td><td>people</td><td>Neither</td><td>Aggressive</td><td>Trac</td><td>Correct</td></tr><tr><td>5. frustration can be a bitch</td><td>bitch</td><td>Neither</td><td>Offensive</td><td>Davidson</td><td>Incorrect</td></tr><tr><td>6. you do and so does sb its about forced deviance without that no sense would be possible</td><td>would</td><td>Hate</td><td>Neither</td><td>Fox</td><td>Correct</td></tr><tr><td>7. so and his wife get a payout that was intended for small business but individuals dont get monetary relief</td><td>get</td><td>Hate</td><td>Neither</td><td>Grimminger</td><td>Correct</td></tr><tr><td>8. that would suck</td><td>would</td><td>Profane</td><td>Neither</td><td>Hasoc2020</td><td>Correct</td></tr><tr><td>9. look like merkel just want to get laid</td><td>like</td><td>Hate</td><td>Neither</td><td>Fox</td><td>Incorrect</td></tr><tr><td>10. im not doing this goddamn</td><td>im</td><td>Insult</td><td>Neither</td><td>Jigsaw</td><td>Correct</td></tr><tr><td>11. we know the real too and america cant survive four more years</td><td>know</td><td>Offensive</td><td>Neither</td><td>Hasoc2019</td><td>Correct</td></tr><tr><td>12. whoever the last bitch you was fucking with tell her its over</td><td>fucking</td><td>Neither</td><td>Hate</td><td>Hateval</td><td>Correct</td></tr><tr><td>13. he is hu and no one has checked on him</td><td>one</td><td>Offensive</td><td>Neither</td><td>Olid</td><td>Correct</td></tr><tr><td>14. if u acted like a hoe after we broke up im not wrong for thinking u were a hoe all along</td><td>like</td><td>Neither</td><td>Offensive</td><td>Davidson</td><td>Correct</td></tr><tr><td>15. im with you too what</td><td>im</td><td>Hate</td><td>Neither</td><td>Reddit</td><td>Correct</td></tr><tr><td>16. hell to have a teacher like this</td><td>like</td><td>Hate</td><td>Neither</td><td>Stormfront</td><td>Correct</td></tr><tr><td>17. laughing my fucking ass off beechehouse of cards is collapsing</td><td>fucking</td><td>Neither</td><td>Hate</td><td>Grimminger</td><td>Incorrect</td></tr><tr><td>18. and this retarded bitch has over k followers</td><td>bitch</td><td>Neither</td><td>Hate</td><td>Gab</td><td>Correct</td></tr><tr><td>19. im ready are you vs</td><td>im</td><td>Hate</td><td>Neither</td><td>Grimminger</td><td>Correct</td></tr><tr><td>20. i m not sure you should assume im not corrupt joe biden</td><td>im</td><td>Hate</td><td>Neither</td><td>Grimminger</td><td>Correct</td></tr><tr><td>21. this bitch thincc she dress coding me</td><td>bitch</td><td>Neither</td><td>Offensive</td><td>Davidson</td><td>Correct</td></tr></tbody></table>

<table><caption>Table 6: Manual verification of instances flagged by our token-driven diagnostic algorithm (BERTopic Score). Columns show the sentence (Instance), salient Token, original Ground Truth, suggested Relabeling, Dataset, and Manual verification outcome (green = correct, red = incorrect).</caption><thead><tr><th>Instance</th><th>Token</th><th>Ground Truth</th><th>Relabeling</th><th>Dataset</th><th>Manual verification</th></tr></thead><tbody><tr><td>1. miserable mahas pathetic pattys amp bullshit beckys</td><td>bullshit</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Correct</td></tr><tr><td>2. fuck all that bullshit who tf is young crazy ep dropping this april stay tuned</td><td>bullshit</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Correct</td></tr><tr><td>3. im so mad that it was allowed for him to be railroaded out on bullshit but brian williams is still out there</td><td>bullshit</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Correct</td></tr><tr><td>4. one pathetic piggy could barely hit before he creamed his pants try harder bitches this is just pathetic</td><td>piggy</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Correct</td></tr><tr><td>5. but yall make the mutual decision to have sex on the first date but shes trash what kind of math</td><td>math</td><td>Neither</td><td>Offensive</td><td>Davidson</td><td>Correct</td></tr><tr><td>6. leabian gets butt fucked and pussy eaten</td><td>butt</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Correct</td></tr><tr><td>7. the soviets managed to accomplish total usurpation criminalization radicalization and grabbed under kgbists total mob monopolization</td><td>criminal</td><td>Hate</td><td>Neither</td><td>Founta</td><td>Correct</td></tr><tr><td>8. all pakistani people are again in electronic indian journal its prove that they dont like their country rather merge with original country and stop killing both sides of army rather do on original criminal british people</td><td>criminal</td><td>Neither</td><td>Aggressive</td><td>Trac</td><td>Correct</td></tr><tr><td>9. by being a spoiled entitled ghetto head that really screams feminist</td><td>ghetto</td><td>Neither</td><td>Offensive</td><td>Olid</td><td>Correct</td></tr><tr><td>10. speech is like boring song where you go out and visit wash room</td><td>boring</td><td>Neither</td><td>Aggressive</td><td>Trac</td><td>Incorrect</td></tr><tr><td>11. as i commented a few days ago on this thread massive race or ethnic mixing tends to preceed massive race or ethnic war</td><td>thread</td><td>Hate</td><td>Neither</td><td>Stormfront</td><td>Correct</td></tr><tr><td>12. vip highdef bignipples gt gt gt</td><td>nipples</td><td>Abusive</td><td>Neither</td><td>Founta</td><td>Incorrect</td></tr><tr><td>13. r u fucking kidding me</td><td>kidding</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Incorrect</td></tr><tr><td>14. go eat some more burgers butthead</td><td>butthead</td><td>Neither</td><td>Offensive</td><td>Olid</td><td>Correct</td></tr><tr><td>15. nasty little butt slut nicole moore</td><td>butt</td><td>Neither</td><td>Abusive</td><td>Founta</td><td>Correct</td></tr><tr><td>16. niggas dont be savages they just be broke niggas with anger problems</td><td>niggas</td><td>Neither</td><td>Hate</td><td>Founta</td><td>Correct</td></tr><tr><td>17. what issssss that anger its not a conclusion to be right</td><td>anger</td><td>Aggressive</td><td>Neither</td><td>Trac</td><td>Correct</td></tr></tbody></table>