Towards Safer Social Media Platforms: Scalable and Performant Few-Shot Harmful Content Moderation Using Large Language Models

Akash Bonagiri, Lucen Li, Rajvardhan Oak, Zeerak Babar, Magdalena Wojcieszak, Anshuman Chhabra · OpenReview

Abstract

The prevalence of harmful content on social media platforms poses significant risks to users and society, necessitating more effective and scalable content moderation strategies. Current approaches rely on human moderators, supervised classifiers, and large volumes of training data, and often struggle with scalability, subjectivity, and the dynamic nature of harmful content. To bridge these gaps, we utilize Large Language Models (LLMs) to undertake few-shot dynamic content moderation via in-context learning. Through extensive experiments on multiple LLMs, we demonstrate that our few-shot approaches can outperform existing proprietary baselines (Perspective and OpenAI Moderation) as well as prior state-of-the-art few-shot learning methods, in identifying harm. We also incorporate visual information (video thumbnails) and assess if different multimodal techniques improve model performance. Our results underscore the significant benefits of employing LLM based methods for scalable and dynamic harmful content moderation online.

Introduction: The Challenge of Dynamic Content Moderation

Content moderation is a "dynamic temporal problem." New harmful trends, slang, and conspiracies emerge daily, making traditional supervised Machine Learning (ML) models obsolete almost as soon as they are trained. These traditional models require massive, human-annotated datasets and struggle with linguistic nuances like sarcasm.

Human moderation, while more nuanced, is impossible to scale to the billions of posts generated daily and takes a heavy psychological toll on workers. This research seeks a "middle ground": a system that is highly scalable (requires minimal human labeling) and highly effective (matches or nears human-level accuracy) while remaining flexible enough to adapt to new types of harm without retraining.

Methods and Strategies

The researchers explored three primary strategies using both open-source (Mistral-7B, Llama2-13B) and closed-source (GPT-3.5-Turbo, GPT-4o-Mini) models. These strategies range from text-only analysis to multimodal approaches that incorporate visual data from video thumbnails.

Overview of the three moderation strategies: Few-Shot ICL (text-only), Caption Generation (multimodal via text), and Direct Image Input (multimodal via vision-language models).
  1. Zero-Shot Learning (ZSL): Asking the LLM to classify content based only on a task description, relying on the model's internal understanding of harm.
  2. Few-Shot In-Context Learning (FS-ICL): Providing the model with 8–14 labeled examples (exemplars) within the prompt. To ensure high quality, the study used coverage-based selection (e.g., BERTScore Recall, Cosine similarity, and BM25) to find the most relevant examples for a specific post.
  3. Multimodal Moderation: Incorporating visual data through:
  4. Caption Generation (CG): Using a model like BLIP to describe the image in text, which is then fed to a text-only LLM.
  5. Direct Image Input (DII): Feeding the image directly into Vision-Language Models (VLMs) like GPT-4o-Mini.

The study utilized three diverse datasets: the YouTube Harms Dataset (~19,000 videos), the Jigsaw Toxicity Dataset (Wikipedia comments), and the Measuring Hate Speech (D-Lab) dataset.

Key Results and Insights

The experiments revealed that LLMs are remarkably "harm-aware" out of the box. Even in zero-shot configurations, LLMs outperformed specialized industry tools like Google’s Perspective API and OpenAI’s Moderation API, which typically hovered between 50% and 56% accuracy.

Comparison of LLM accuracy across different selection methods (BM25, Cosine, BSR) against industry baselines and human expert performance.
  • The Power of Few-Shot: Moving to a 14-shot setup pushed accuracy to 78.57% for text-only moderation. Using BERTScore Recall (BSR) to select examples that "cover" the salient aspects of the target post provided a consistent performance boost.
  • Multimodal Peak: The best-performing configuration was GPT-4o-Mini using Direct Image Input (DII), which reached 80% accuracy.
  • Expert Alignment: These LLM-based approaches moved significantly closer to the "Domain Expert" baseline of 90.97% than previous automated methods.

Discussion and Future Directions

While promising, several hurdles remain for real-world deployment. Multimodal processing is significantly more expensive and slower (10–30 seconds per sample) than text-only processing, complicating real-time moderation. Furthermore, there is a notable performance gap between proprietary models (like GPT-4o) and open-source alternatives (like LLaVA) in multimodal tasks. Future work will also need to address potential language biases, as this study focused primarily on English-language content.

Summary updated

BibTeX
@misc{bonagiri2025towards,
  author = {Akash Bonagiri and Lucen Li and Rajvardhan Oak and Zeerak Babar and Magdalena Wojcieszak and Anshuman Chhabra},
  title = {{Towards Safer Social Media Platforms: Scalable and Performant Few-Shot Harmful Content Moderation Using Large Language Models}},
  year = {2025},
  eprint = {2501.13976},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.13976},
}
Figure