Calibrate a Moderation Classifier for Rare Harm Categories

Last updated: November 29, 2026

Quick Overview

A content moderation classifier scores prompts for several harm categories, and one category appears in about 0.1 percent of traffic. The scores are used both to block content above a threshold and to report estimated prevalence. Explain how to evaluate, calibrate, and set thresholds for this rare class.

OpenAI
Machine Learning
Machine Learning Engineer
OpenAI
November 29, 2026
Machine Learning Engineer
Technical Screen
Machine Learning
Medium

0

0

0 solved


A content moderation classifier scores prompts for several harm categories, and one category appears in about 0.1 percent of traffic. The scores are used both to block content above a threshold and to report estimated prevalence. Explain how to evaluate, calibrate, and set thresholds for this rare class.

OpenAI runs moderation models over enormous traffic where most categories are rare and the cost of false positives (blocking legitimate users) and false negatives (missed abuse) differs sharply. The interviewer checks imbalanced metrics, calibration, and how resampling during training distorts probabilities.

What the Interviewer Expects
  • Rejects accuracy and ROC AUC alone in favor of precision, recall, and PR AUC
  • Explains how class rebalancing shifts predicted probabilities
  • Calibrates on held-out data with the true class prior
  • Chooses thresholds from explicit costs or a precision target
  • Separates thresholding for action from estimating prevalence
Key Topics to Cover
class imbalance
calibration
precision recall
threshold selection
prior shift
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you calibrate when the label prior drifts after a new jailbreak trend?
  • How do you get enough positive labels to measure recall reliably?
  • Would you use one threshold for all languages?
  • How would you estimate prevalence without trusting the classifier's calibration?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Two uses: a decision (block or flag for review) and a measurement (what fraction of traffic is harmful this week). They need different things: the decision needs a good ranking and a threshold; the me...

Approach
  • Evaluate with PR AUC and recall at a fixed precision. At 0.1 percent prevalence, a model with 99.9 percent accuracy can be useless, and ROC AUC hides how many false positives you pay per true po...

Submit Your Answer
Markdown supported