A Federated Approach to Few-Shot Hate Speech Detection for Marginalized Communities (2025)

Abstract: Despite substantial efforts, detecting and preventing hate speech online remains an understudied task for marginalized communities, particularly in the Global South, which includes developing societies with increasing internet penetration. In this paper, we aim to provide marginalized communities in societies where the dominant language is low-resource with a privacy-preserving tool to protect themselves from online hate speech by filtering offensive content in their native languages. Our contributions are twofold: 1) we release REACT (REsponsive hate speech datasets Across ConTexts), a collection of high-quality, culturespecific hate speech detection datasets comprising multiple target groups and low-resource languages, curated by experienced data collectors; 2) we propose a few-shot hate speech detection approach based on federated learning (FL), a privacy-preserving method for collaboratively training a central model that exhibits robustness when tackling different target groups and languages. By keeping training local to user devices, we ensure data privacy while leveraging the collective learning benefits of FL. We experiment with both multilingual and monolingual pre-trained representation spaces as backbones to examine the interaction between FL and different model representations. Furthermore, we explore personalized client models tailored to specific target groups and evaluate their performance. Our findings indicate the overall effectiveness of FL across different target groups, and point to personalization as a promising direction.

## introduction combating online hate is a crucial aspect of content moderation, with prevailing solutions often relying on machine learning models trained on large-scale datasets @xcite @xcite . however, these efforts and the resources required are largely limited to a few high-resource languages, such as english and german. while multilingual hate speech datasets have been developed @xcite , a significant portion of the world's low-resource languages and their users remain unprotected from online abuse. a key challenge in hate speech detection lies in its inherently subjective and context-dependent nature, which varies not only at the individual level but also across cultures and regions. the issue is exacerbated by the lack of expertise of annotators on marginalized target groups, as many studies rely on crowdsourcing for data collection, often resulting in a disconnect between those labeling the data and those directly affected by hate speech @xcite . additionally, both language and hate speech constantly evolve, with new expressions and terminology regularly emerging. to address these challenges, we develop highquality, culturally relevant datasets that reflect the experiences of marginalized communities. this is achieved through a prompt-based data collection procedure, carried out by data collectors proficient in the target languages and familiar with the nuances of hate speech directed at marginalized groups within their respective contexts. the result is react, a set of localized, context-aware datasets containing positive, neutral, and hateful sentences across various low-resource languages. we release react under cc by-sa 4.0. foot_0 one key limitation of current hate speech filtering solutions is their reliance on centralized, server-side processing. in such setups, user data must be transmitted to remote servers for analysis, restricting individual control over the content being filtered. moreover, centralized models are less adaptable to highly specific targets, particularly in low-resource language settings. to overcome this, we propose the use of federated learning (fl) @xcite , a decentralized machine learning paradigm where multiple users collaboratively train a central model without sharing raw data. fl operates in two iterative stages: first, client devices receive the current server model and train it locally on private data; then, updates are sent back to the server, aggregated, and used to improve the server model. this decentralized approach not only preserves user privacy but also enables rapid adaptation to culturally specific hate speech patterns. our work aims to tackle the following research questions. rq1: can zero-shot or few-shot learning effectively detect hate speech in low-resource languages? rq2: if not, can fl bridge this performance gap? rq3: given the specificity of hate speech, does client personalization improve over zero-or few-shot learning in low-resource settings? ## react dataset we release a localized hate speech detection dataset for several marginalized groups in regions where low-resource languages are predominantly used. we name this dataset react (responsive hate speech datasets across contexts). to construct the dataset, we recruit data collectors who are either native or highly proficient in the target language and have deep familiarity with the sociocultural nuances and contexts of hate speech in the respective countries. react comprises data on six target groups-black people, lgbtq, russians, russophone ukrainians, ukrainian war victims, and women-across four languages: afrikaans, korean, russian, and ukrainian. each dataset is organized into six categories based on the sentiment polarity (positive, neutral, hateful) and the presence or absence of profanity, which includes vulgar or obscene language such as swear words. we collect data both with and without profanity within each polarity category to minimize the association of profanity with hateful content. for each of the six categories, data collectors receive a prompt formatted as follows: provide [polarity] text in [target language] about the [target group] [using/without using] profanity. to prepare the data collectors, we first show minimal pair examples illustrating the distinction between profane and non-profane usages with the same polarity. data collection is conducted using structured google sheets, foot_1 with one sub-sheet per category. the corresponding prompt is displayed at the top of each sub-sheet, and data collectors are instructed to record one sentence per row. in addition to the sentence itself, optional fields allow collectors to provide information such as an english translation and notes explaining culturally specific terms or contexts. further details on the data collection procedure are provided in §a. data source. data is collected predominantly from social media platforms like facebook foot_2 and x (formerly twitter), foot_3 as well as local online forums, news articles, and comment sections. additional sources include books and text corpora, such as common crawl. 5 in some cases, data collec- ## hate speech detection experiments to implement federated learning (fl) using our collected data, we use the flower framework, foot_6 chosen for its simplicity and flexibility. fl at scale typically involves a central server connected with multiple client nodes, each operating on a user's device. flower supports the simulation of this setup by enabling the creation of virtual clients on a single machine, allowing us to conduct controlled fl experiments without relying on real user devices. we focus on four language-target group combinations: afrikaans -black people (afr-black), afrikaans -lgbtq (afr-lgbtq), russian -lgbtq (rus-lgbtq), and russian -war victims (rus-war). ## analysis perspective api since our data includes samples both with and without profanity, we expect the two chosen thresholds to influence the classification behavior of perspective api. we observe performance drops across all target groups when the threshold is raised from 0.7 to 0.9. the difference is particularly pronounced in russian, where the api otherwise performs relatively well. increasing the threshold to 0.9 makes the api more conservative, reducing its sensitivity to hate. while hateful sentences containing repeated profanity or highly offensive language are correctly identified under both thresholds, more subtle ones with little or no profanity are often missed at the higher threshold. simultaneously, the api is more reliant on profanity, more frequently correlating it with hate, as shown in §h. conversely, due to increased insensitivity to profanity, slightly profane yet positive sentences toward target groups, which are previously misclassified as hate, are correctly identified as non-hateful at the 0.9 threshold. in addition to its threshold sensitivity, we find that perspective api fails to detect culturally sensitive expressions, regardless of the threshold used. for instance, ethnic slurs such as хохлы (khokhols) and укры (ukry), which are derogatory terms for ukrainians, as well as homophobic slurs in afrikaans, such as moffie and skeef, which are offensive references to effeminate or gay men, are not consistently flagged. this is an indication that while perspective api is effective for generalpurpose hate speech detection, it lacks the cultural and linguistic nuance necessary for adaptation to specific cultural or ethnic contexts. ## conclusion this work makes two key contributions. first, we release react, a collection of localized and context-specific hate speech detection datasets. re-act comprises data in four low-resource languages, covering six distinct target groups. the datasets are curated by data collectors who are not only proficient in the target languages but also deeply familiar with the cultural nuances and con-texts of hate speech in the respective countries. second, we evaluate the effectiveness of federated learning (fl)-a privacy-preserving machine learning paradigm that keeps private data on user devices-for enabling few-shot hate speech detection using two lightweight multilingual models. these models are suitable for deployment even on devices with limited computational resources. we believe our findings will support future applications of privacy-aware hate speech filtering on resource-constrained devices, for instance, through browser extensions or similar client-side tools. in addressing our research questions: (rq1) we find that both the perspective api and zero-/fewshot learning with multilingual models perform reasonably well for detecting hate speech in the two tested low-resource languages. (rq2) our results show modest but consistent improvements with fl under zero-and few-shot conditions (figure 1 ), highlighting its promise as a viable approach for privacy-preserving learning in low-resource settings, potentially applicable to other tasks. (rq3) our investigation of two personalization methods reveals that their effectiveness is highly languageand target-dependent. however, personalization offers a clear privacy advantage without significant performance loss. we therefore see personalization as a promising direction, particularly in more resource-rich or heterogeneous environments.