Adapting Large Language Models for Content Moderation: Pitfalls in Data Engineering and Supervised Fine-tuning

Huan Ma, Changqing Zhang, Huazhu Fu, Peilin Zhao, Bingzhe Wu · Submission to ICLR 2024 · Withdrawn

TL;DR

Deploying privately hosted Large Language Models (LLMs) for content moderation avoids the privacy, latency, and compliance issues of commercial APIs, but fine-tuning them as simple text classifiers causes severe overfitting. This paper demonstrates that distilling step-by-step auditing reasoning (Chain-of-Thought) from cloud LLMs into open-source models—and using human "golden labels" as weak supervision to filter or rectify teacher hallucinations—yields compact models that match or exceed GPT-3.5 while maintaining out-of-distribution robustness.

What Problem Does This Paper Address?

Modern automated moderation faces difficult trade-offs:

  1. Commercial APIs (e.g., GPT-4): Provide interpretable, reasoning-backed moderation decisions, but sending sensitive user data to third-party endpoints triggers regulatory hurdles, high costs, and latency bottlenecks.
  2. Standard Supervised Fine-Tuning (SFT): Fine-tuning smaller, privately deployed open-source models directly on input-label pairs $(x, y)$ causes catastrophic overfitting. Models latch onto surface patterns (e.g., flagging benign sentences that simply mention race, gender, or relationships) and collapse on out-of-distribution (OOD) real-world data.

The authors explore how to practically build and fine-tune private, open-source moderation models that output interpretable audit chains without suffering from data leakage, catastrophic overfitting, or teacher hallucinations.

Methods

The authors develop a pipeline to augment human-labeled data with structured audit processes distilled from powerful cloud models (GPT-3.5 and GPT-4):

Input x ──► Cloud LLM (Blind to y) ──► Reasoning r̂ + Pred ŷ
                                              │
                       Compare with Ground Truth y
                                              │
                      ┌───────────────────────┴───────────────────────┐
                      ▼                                               ▼
              If ŷ == y: Keep                                 If ŷ != y:
                                              ┌───────────────────────┴───────────────────────┐
                                              ▼                                               ▼
                                      Reject (Setting B)                             Recheck (Setting C)
                                      (Discard sample)                               (Re-prompt LLM to self-correct)
                                                                                              │
                                                                               Combine: Reject if still wrong
                                                                                         (Setting D)
  • Reasoning-Augmented Formatting: Instead of outputting only a label, the model is prompted to produce three fields: (1) Analysis process, (2) Harmful information, and (3) Classification results.
  • Weak Supervision & Hallucination Defense: If a cloud teacher is fed the ground-truth label upfront, it often hallucinates rationalizations. Instead, the teacher analyzes the sample blind. Human-annotated labels are only used downstream to evaluate the teacher:
  • Setting A (Unsupervised): Keep all teacher generations as-is.
  • Setting B (Reject): Discard teacher predictions where $\hat{y} \neq y$.
  • Setting C (Recheck): Provide the incorrect prediction back to the teacher to reflect and rectify its reasoning.
  • Setting D (Recheck + Reject): Recheck once; if the teacher still fails, discard the sample.
  • Data Deduplication: Sentence embeddings and clustering isolate 145 distinct, diverse seed instances ("golden set") from real-world data to prevent redundant reasoning.
  • Model Training: Parameter-Efficient Fine-Tuning (PEFT) on open-source Chinese models: ChatGLM2-6B (via P-tuning-V2) and Baichuan-13B-Chat (via LoRA).

Datasets

  • In-Distribution Dataset: Real-world Chinese industry moderation data classified across five categories: Pornography, Violence, Discrimination/Insult (Offensive), Gambling, and Harmless.
  • Out-of-Distribution (OOD) Benchmarks:
  • COLD: Chinese Offensive Language Dataset (5,323 test samples covering attacking individuals, attacking groups, and anti-bias).
  • CInsult: 7,137 Chinese abusive comments, tested using an adversarial word-segmented variant.

Key Insights and Ideas

  • Classification SFT is a trap: Training models directly on inputs and labels $(x \rightarrow y)$ causes severe overfitting. The models memorize sensitive keywords, plummeting OOD recall on benign sentences (e.g., falsely classifying discussions of Malaysian multi-lingual abilities or swimming competitions as offensive).
  • Teacher validation is crucial: Unsupervised distillation (Setting A) passes the teacher's hallucinations into the fine-tuning set. Filtering or reflecting with human labels (Settings B, C, and D) dramatically boosts student F1 score.
  • Synthetic input expansion offers diminishing returns: Prompting LLMs to generate hundreds of new input variations ($x$) tripled the dataset size and training time but failed to improve downstream moderation performance compared to a tightly curated, diverse golden set.
  • Capacity mismatch limits teacher distillation: GPT-4 generates richer, longer rationales than GPT-3.5. While the 13B model easily absorbed GPT-4's complex reasoning (raising its micro F1 from 71.2% to 83.9%), the 6B model struggled to minimize training loss on GPT-4 rationales, achieving only marginal gains over GPT-3.5 rationales.

Key Results

  • OOD Robustness: Without Chain-of-Thought (w/o CoT), models experienced massive recall collapse on negative/benign OOD samples—ChatGLM's recall dropped to 14.1% on COLD and Baichuan dropped to 12.6% on CInsult. Incorporating reasoning restored balanced performance across both datasets.
  • Matching/Beating GPT-3.5: Fine-tuned private models rivaled cloud APIs. GPT-3.5 achieved an average in-distribution F1 of 80.3%. With Setting D (Recheck + Reject), ChatGLM2-6B reached 83.4% F1, and Baichuan-13B reached 81.5% F1 (rising to 87.1% with GPT-4 reasoning under Setting C).
  • Reduced False Positives: Fine-tuned models substantially outperformed GPT-3.5 in the Harmless category (e.g., Baichuan F1 of 88.8% vs. GPT-3.5's 72.5%), avoiding excessive over-censorship.

Limitations and Future Work

  • Language Scope: Experiments focused exclusively on Chinese benchmarks and Chinese-adapted base models.
  • Single-Turn Rechecking: The reflection loop was constrained to a single iteration; multi-round debates or verification mechanisms were not tested.
  • Synthetic Data Generation: While LLM reasoning distillation was highly effective, automated expansion of training inputs ($x$) failed, leaving open the question of how to synthesize diverse adversarial moderation prompts automatically.

Summary updated

BibTeX
@misc{ma2023adapting,
  author = {Huan Ma and Changqing Zhang and Huazhu Fu and Peilin Zhao and Bingzhe Wu},
  title = {{Adapting Large Language Models for Content Moderation: Pitfalls in Data Engineering and Supervised Fine-tuning}},
  year = {2023},
  eprint = {2310.03400},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.03400},
}
Figure