Evaluation of Hate Speech Detection Using Large Language Models and Geographical Contextualization

Anwar Hossain Zahid, Monoshi Kumar Roy, Swarna DasarXiv 2025 · DOI

Introduction

Hate speech detection remains a critical challenge for online safety, particularly as it evolves through cultural, linguistic, and regional nuances. Traditional models often struggle with "implicit" hate speech—such as sarcasm or region-specific grievances—and the increasing sophistication of adversarial content. This study evaluates the performance of state-of-the-art Large Language Models (LLMs) in a "three-dimensional" framework: binary classification, geographical contextualization, and adversarial robustness.

Methodology

The evaluation focused on three primary models: Llama2 (13b), Codellama (7b), and DeepSeekCoder (6.7b). The researchers utilized a curated dataset of 10,000 multilingual comments spanning languages like Arabic, Bengali, Hindi, Chinese, and Russian, representing diverse regions including the Arab world, India, and China.

A systematic pipeline was established involving:

  • Prompt Engineering: Structured in-context learning with specific tags (e.g., [ANSWER], [LOCATION]) to extract precise predictions.
  • Translation-First Pipeline: Multilingual content was translated into English using Google Translate and LLM-based translators (GPT-3.5 and Codellama-34b) to assess sentiment preservation.
  • Adversarial Testing: GPT-4 generated synthetic adversarial samples to test if models would "flip" labels when hateful intent was paraphrased.

Results and Performance Analysis

The study revealed significant variations in model performance across standard metrics. Codellama (7b) demonstrated the highest recall at 70.60%, though its lower accuracy (35.30%) suggests a "trigger-happy" bias toward labeling content as hate speech.

Comparison of model performance across Accuracy, F1 Score, Recall, and Precision.

Geographical Sensitivity

A key finding was the difficulty models face in identifying the geographical origin of a comment based on its content. While Codellama excelled in detection recall, it struggled with localization. DeepSeekCoder (6.7b) emerged as the most geographically sensitive model, correctly identifying 63 locations, significantly outperforming its peers despite having a lower overall detection recall than Codellama.

Comparison of True Positives in hate speech detection versus Correct Location identification across models.

Adversarial Robustness and Translation

Robustness testing highlighted a critical vulnerability in Llama2 (13b), which failed in 62.5% of adversarial cases, flipping its prediction from "Hate" to "Non-Hate" when intent was slightly obscured. In contrast, DeepSeekCoder and Codellama remained relatively stable, with only 1-2 misclassifications each. Furthermore, the study found that advanced LLM-based translation did not significantly outperform standard Google Translate for this task, indicating a persistent "translation bottleneck" in multilingual moderation.

Conclusion and Future Work

The results underscore that while LLMs show promise in hate speech detection, they remain fragile to adversarial manipulation and lack deep geographical awareness. The authors suggest that targeted fine-tuning on the full 10,000-sample multilingual dataset is a necessary next step to improve both accuracy and geographical sensitivity. Future work should also address the limitations of synthetic adversarial samples to better reflect real-world human-generated "dog whistles."

Summary updated

BibTeX
@misc{zahid2025evaluation,
  author = {Anwar Hossain Zahid and Monoshi Kumar Roy and Swarna Das},
  title = {{Evaluation of Hate Speech Detection Using Large Language Models and Geographical Contextualization}},
  year = {2025},
  eprint = {2502.19612},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.19612},
}
Figure