RAG and Recall: Multilingual Hate Speech Detection with Semantic Memory (2025)

Abstract: Multilingual hate speech detection presents a challenging task, particularly in limited-resource contexts when performance is affected by cultural nuances and data scarcity. Fine-tuned models are often unable to generalize beyond their training, which limits their efficiency, especially for low-resource languages. In this paper, we introduce HS-RAG, a retrieval-augmented generation (RAG) system that directly leverages knowledge, in English, French, and Arabic, from Hate Speech Superset (publicly available dataset) and Wikipedia to Large Language Models (LLMs). To further enhance robustness, we introduce HS-MemRAG, a memory-augmented extension that integrates a semantic cache. This model reduces redundant retrieval while improving contextual relevance and hate speech detection among the three languages.

## introduction hate speech is one of the most common categories of online abuse and harm. its detection is a vital task in natural language processing (nlp), in order to ensure safe online communication. nevertheless, it remains challenging due to its coded language and cultural nuance @xcite . therefore, detecting this content goes beyond the need for accurate classification to requires cultural and linguistic adaptability. on the other hand, the multilingual aspect of online abuse and harms has gained more awareness as online platforms are progressively serving more global audiences. as a result, recent studies about hate speech have been focusing more on multilingualism @xcite , with growing attention to reducing the english bias in this field of study @xcite . recently, large language models (llms) have revolutionized nlp tasks @xcite . more specifically, they have efficiently contributed to hate speech detection, particularly in multilingual and cross-cultural settings @xcite . however, llms still encounter significant challenges in terms of resource consumption @xcite , computational inefficiency @xcite , hallucination @xcite , and misfollowing instructions @xcite . an efficient alternative approach introduced by @xcite is retrieval-augmented generation (rag), which provides promising solutions to these issues @xcite . by combining the strength of llms with knowledge retrieval techniques, rag enables models to enhance their understanding by adding relevant information from external data sources @xcite , which helps to outperform fine-tuned llms @xcite . nevertheless, rag-based systems often encounter some difficulties, such as high retrieval latency, as they continually query large databases. this redundant retrieval procedure not only slows down inference, but can also degrade the quality of generated outputs, especially in real-time applications @xcite . to address these challenges, different caching mechanisms have been examined @xcite . one of the caching techniques is semantic caching, which enables knowledge reuse based on embedding similarity. this approach is relevant for multilingual nlp tasks, where the same data sample can be represented differently across languages. this explains the tendency to use this caching mechanism in llms same as in gptcache @xcite . in this paper, we present hs-rag and hs-memrag, two novel architectures for multilingual hate speech detection and moderation of online abuse and harms. hs-rag implements a multilingual rag pipeline, incorporating wikipedia and hate speech datasets for context-aware detection. hs-memrag extends this with a semantic cache memory, reducing redundant retrievals and reusing contextual similarity. our models offer robust performance across languages, providing an explainable, lightweight, and adaptable solution for multilingual content moderation especially in low-resource languages. ## experiments and results we present experimental details in appendix a. in appendix b, we describe the positioning of a data sample among the data stored in our chromadb, in order to better understand the retrieval process. our results indicate that while fine-tuning gives the highest overall performance, both hs-rag and hs-memrag propose effective alternatives, especially when considering multilingual generalization. hs-rag enhances over zero-shot hs-base baseline across all three languages, showing that retrieval-augmented data enables bridging knowledge gaps, particularly in fr (+16 f1) and ar (+44 f1). these improvements are mostly important in limited-resource environments, where training data is scarce and computational resources are constrained. they confirm the expected advantage of retrieval based models in using external knowledge to improve detection performance. moreover, hs-memrag demonstrates its most significant effeciency in ar, where it performs the highest f1 score overall (0.91). while the improvements over hs-rag in en and fr are modest, hs-memrag presents clear efficiency usefulness by reducing redundant retrieval on semantically similar inputs, thus enabling faster inference. although neither rag nor memrag surpassed the fine-tuned model in most cases, they did offer strong zero-training performance, and easy deployment in multilingual settings. this makes them attractive options for real-world scenarios where compute, structured data, or time is constrained. while fine-tuned hs-base model gave the highest f1-score in arabic (0.9394), its confusion matrix indicates that it fails to detect hateful samples. it achieves an f1-score of 0.0 for this label, and predicting almost all test samples as non-hate. this result illustrates the impact of class imbalance in inflating performance metrics. nevertheless, both hs-rag and hs-memrag prove their ability to detect hate speech, achieving f1-scores of 0.18 and 0.23 respectively for this minority class. this confirms that, unlike fine-tuning, our models do not collapse into majority class predictions and demonstrate stronger generalization in low-resource, imbalanced settings. overall, we could understand why arabic performance may seem more robust than english in some settings, since metrics can be skewed by model behavior toward the majority class. ## conclusion we proposed hs-rag and hs-memrag, two training-free, multilingual hate speech detection models that can manage moderation systems in a range of online abuse and harms detection tasks. they can be extended to other types of harms (e.g., misinformation, radicalization). our models leverage retrieval augmentation and semantic cache memory, providing robust performance across english, french, and arabic. by incorporating semantic cache, hs-memrag enables faster and more stable predictions, offering a lightweight and explainable solution for multilingual content moderation, especially for under-resourced languages (arabic).