ENHANCING HATE SPEECH DETECTION WITH KNOWLEDGE-BASED PROMPTING FOR LARGE LANGUAGE MODELS
Abstract
The widespread growth of social media has intensified the challenge of identifying and addressing hate speech, largely due to its intricate semantics and varied contextual nuances. This study examines the potential of employing prompting strategies with large language models (LLMs) alongside conventional deep neural networks (DNNs) and pre-trained language models for hate speech detection. The models assessed include DNNs such as Text CNN and GRU, PLMs like BERT, XLM-R, DistilBERT, and PhoBERT, as well as LLMs leveraging prompting techniques, including GPT. Experiments conducted on both Vietnamese and English datasets show that GPT, utilizing the Chain-of-Thought reasoning framework, achieves the best macro F1 scores—particularly when enhanced with a knowledge-based prompting (KBPrompt) approach. In KBPrompt, domain-specific knowledge bases consisting of slang and emoji terms are constructed directly from the training data using prompt-assisted extraction and a frequency-based labeling strategy, which assigns labels based on their empirical distribution across annotated comments. The findings highlight the effectiveness of incorporating external lexical knowledge into LLM prompting pipelines, especially in multilingual and low-resource contexts, to better capture implicit toxicity and culturally embedded hate speech.
