Randomly sampling production traffic starves a moderation classifier: in sampled user prompts, only 0.04% contained self-harm and 0.017% contained violent hate threats. Todor Markov, Lilian Weng, and colleagues at OpenAI show that treating taxonomy design, active learning, and data auditing as first-class model architecture raises rare-harm yield by up to 22.3x and drives up to 10x better performance on scarce categories.

  • Active learning beats random sampling 10.1x to 22.3x: Across three rounds scoring 500,000 production prompts per iteration, active learning triggers at least one violation on 40% of selected examples versus 3.4% under random sampling.
  • Independent heads outperform shared MLPs: Replacing a GPT decoder’s final linear layer with eight independent [d_model, 256, 1] MLP heads cuts cross-category interference while needing fewer parameters.
  • Curated contrastive data lifts hate detection 32%: Adding 69k hand-templated contrastive pairs (such as “black blanket” vs. demographic groups) raises hate AUPRC from 0.417 to 0.551, whereas adding 2x uncurated synthetic data degrades accuracy.
  • Domain adaptation helps cold starts, not data-rich runs: Wasserstein domain adversarial training (WDAT) with 100k unlabeled production texts boosts public-only self-harm AUPRC from 0.063 to 0.281, then saturates once 60k labeled production examples arrive.
Active learning vs. random sampling share of violating examples (higher yield is better)
Moderation CategoryActive Learning · Random · Yield Gain
H2 Hate (threatening)0.67% · 0.03% · 22.3x
V Violence9.92% · 0.48% · 20.7x
SH Self-harm1.85% · 0.09% · 20.6x
H Hateful content3.09% · 0.17% · 18.2x
S Sexual · V2 Graphic violence25.53% / 4.27% · 17.1x
HR Harassment6.41% · 0.55% · 11.7x
S3 Sexual (minors)2.42% · 0.24% · 10.1x

Source: Markov et al. (2023), Section 4.3, Table 4 (bar width encodes yield multiplier vs. random sampling; labels can co-occur).

How It Works

Because academic datasets like tweets differ sharply from long LLM prompts and few-shot completions, the team anchors the entire system around an explicit severity taxonomy and a three-stage active learning loop. Five top-level classes (S, H, V, SH, HR) and three severe subclasses (S3, H2, V2) are paired with non-violating contextual classes (S0 medical or sex education, H0.a neutral identity mentions, H0.b quoted commentary, and V0 contextualized violence) so annotators share clear boundary rules.

In each training round, the pipeline masks PII from 500,000 production prompts, scores them with the current classifier, and selects roughly 2,000 examples across three parallel samplers: random traffic (to track deployment drift), high-score examples above a per-category threshold, and uncertainty samples near probability 0.5. Samples are re-weighted by the square root of metadata counts to preserve diversity before human labeling.

To keep rare-event annotation clean, auditors skip raw agreement accuracy, which stays artificially near 100% when negatives dominate. Instead, they audit 10 positives and 10 high-score (above 50%) candidates per category using ground-truth F1, and run two-fold cross-validation across the training set; whenever more than 30% of sampled model-label disagreements turn out to be errors, all flagged items are relabeled.

Three defenses against cold-start scarcity and spurious shortcuts
WDAT adaptation

Trains a domain critic over 100k unlabeled production texts. Lifts PUB self-harm AUPRC from 0.063 to 0.281 and SYN V2 from 0.093 to 0.507, with diminishing returns on MIX.

Contrastive templates

Pairs identity terms against benign nouns in 69k curated prompts so negative adjectives alone do not trigger hate flags; noisy 2x bulk generation hurts.

Token-drop probing

Greedily deletes tokens until confidence falls below 0.8, shrinking inputs from 722.3 to 15.9 chars. 97% are truly unsafe; 3% expose shortcuts like periods, hashtags, and spaced evasion.

Source: Markov et al. (2023), Sections 3.3 to 3.5 and Table 5.

Key Findings

  • Taxonomy alignment dominates public benchmarks: On OpenAI’s CommonCrawl-plus-synthetic public test set, the classifier beats Jigsaw’s Perspective API across matched categories (0.9703 vs. 0.8709 sexual, 0.7968 vs. 0.6914 hate, 0.7371 vs. 0.5201 violence, 0.6191 vs. 0.3902 harassment). It also leads on out-of-distribution Stormfront (0.9053 vs. 0.8754) and TweetEval Hate (0.6473 vs. 0.5961), while Perspective wins on its home Jigsaw Toxic split (0.9769 vs. 0.9304).
  • Active learning scales across iterations: Starting from 6,000 public examples and testing on 5,500 production samples, three active-learning rounds beat random sampling on AUPRC across every single category.
  • Input reduction catches hidden overfitting: Token probing flagged memorized training strings, hashtag bias from Twitter corpora, over-weighting on punctuation symbols, and fragile handling of spaced slurs like "w h o r e s".

Caveats and Builder Takeaway

Only about 5% of the training corpus (and 4% of the public test set) is non-English, so multilingual precision and tokenization remain unverified. Even after 69k contrastive examples, identity tokens such as "gay" or "her" still skew hate or sexual scores upward, and relying on US-centric definitions and majority-vote labels can flatten marginalized perspectives on borderline speech. Because production traffic cannot be open-sourced, external comparisons rely on public proxies and approximate label mappings.

For engineers building guardrails today, newer policy-tunable LLM classifiers like ShieldGemma, WildGuard, and Llama Guard 3 have largely replaced custom decoder-head training for general safety policies. Yet Markov et al.’s operational playbook stays essential whenever policies drift or harms are rare: define non-violating contextual classes up front, sample production traffic by uncertainty rather than uniformly, audit rare classes with F1 instead of accuracy, and probe triggers before shipping thresholds.