How would you design YouTube's harmful content detection system?
Written by the mlprep team · Updated
Design the ML system that detects harmful content on YouTube — videos that violate policy (violence, hate speech, CSAM, misinformation). YouTube receives 500 hours of video per minute. Walk me through how you'd detect violations at that scale, how you'd handle the human review pipeline, and how you'd measure whether the system is working.
How to drive the interview#
This is not a single classifier design. It is a risk-routing system. Start by clarifying:
- Which policies are in scope: CSAM, terrorism, graphic violence, hate, harassment, misinformation, spam?
- Are we deciding upload blocking, recommendation eligibility, monetization, age restriction, or removal?
- What is the latency target for severe categories?
- What actions can the system take automatically versus route to review?
- How do appeals feed back into the system?
Then build the design as: ingestion → multimodal signal extraction → policy-specific risk scoring → action bands → human review → appeals → monitoring and adversarial response.
Content moderation at YouTube scale is a triage problem: you're not trying to classify every video perfectly in real-time — you're trying to route videos to the right level of scrutiny. The highest-confidence violations get actioned automatically; the ambiguous cases go to human review; the rest get published.
- Upload → signal extraction (in parallel) visual frames · audio transcript and sounds · metadata and channel history · engagement and report spikes
- Stage 1: hash matching (< 1 s) PhotoDNA / GIFCT exact matches → automatic takedown
- Stage 2: ML risk scores (< 1 min) per-policy scores; > 0.95 auto-remove, 0.6–0.95 hold for review, low → publish and monitor
- Stage 3: human review queue prioritized by severity, confidence, viral velocity, and report rate
- Stage 4: post-publish monitoring user reports, periodic re-scoring, throttled distribution for borderline content
Ingestion and signal extraction#
When a video is uploaded, extract signals in parallel:
- Visual: sample frames at 1 fps, run through an image classifier (fine-tuned Vision Transformer or ResNet). For violent content, detect blood, weapons, fighting. For CSAM, perceptual hashing against known databases (PhotoDNA). Visual signals work for graphic content but miss context — a frame with a gun could be a news clip or a gameplay highlight.
- Audio: transcribe with Whisper or similar ASR model. Run a text classifier on the transcript for hate speech, slurs, threats. Also run audio classification for screams, gunshots (important for violence detection when visual is obscured).
- Metadata: title, description, tags, channel history. A channel that has previously violated policy is higher risk. Titles with certain keyword patterns (not banned words, but statistical patterns learned from policy-violating content) raise the prior.
- Engagement signals: spike in watch time + spike in reports from users is a strong signal. A video going viral with an unusual report rate warrants immediate escalation.
Multi-stage pipeline#
Stage 1 — Instant blockers (< 1 second): Hash-matching against known CSAM databases (PhotoDNA) and known terrorist propaganda (GIFCT hash-sharing database). These are exact or near-exact matches — zero tolerance, automatic takedown, no human review needed.
Stage 2 — ML scoring (< 1 minute): Run all modality classifiers and combine into a policy-specific risk score per violation type. A video gets separate scores for: graphic violence, hate speech, misinformation, spam/scam, CSAM likelihood. High-confidence high-severity (score > 0.95 for graphic violence) → automatic removal. Mid-range (0.6–0.95) → hold and queue for human review. Low score → publish but monitor.
Stage 3 — Human review queue: Prioritize by: severity of violation type (CSAM > terrorist content > hate speech > spam), score confidence, viral velocity (a borderline video getting 10k views/hour needs faster review than one with 10 views), and report rate from users.
Stage 4 — Post-publish monitoring: Published videos continue to be monitored via user reports and periodic re-scoring. Distribution is throttled for borderline content (not shown in search or recommendations, only direct link) until review.
Multi-modal fusion#
Each modality has weaknesses:
- Visual-only misses context (news clips, documentaries)
- Text-only misses coded language and dog whistles
- Metadata-only misses novel channels
A late-fusion model combines all modality scores as features into a final risk classifier. Crucially, it also learns modality reliability per violation type: for CSAM detection, visual dominates; for hate speech, transcript dominates; for scam content, metadata + audio patterns matter most.
The false positive problem#
Precision matters enormously. Wrong removals harm legitimate creators, generate appeals, create PR crises (the "adpocalypse" — when brands pulled ads after their ads ran on extremist content, YouTube over-corrected and demonetized thousands of legitimate educational channels).
Calibrate differently per violation severity:
- CSAM, terrorist content: maximize recall, accept false positives, human review clears them
- Hate speech, misinformation: higher precision threshold, err toward review over removal
- Spam: can tolerate aggressive removal, lower stakes
Adversarial robustness#
Bad actors adapt. Evasion techniques include: mirroring/flipping video, overlaying innocuous content, using coded language, splitting policy-violating content across multiple short videos. The system needs:
- Perceptual hashing (not exact hash) to catch near-duplicate manipulated videos
- Periodic retraining as evasion patterns are identified
- Separate classifiers for known evasion techniques
- Human red-teaming to identify new evasion vectors before bad actors do
Evaluation#
Policy violation recall: of all videos that human reviewers confirmed as violations, what fraction did the ML system flag? Segment by violation type and severity.
False positive rate: of all removals/holds, what fraction were overturned by human review? High overturn rate → too aggressive.
Time-to-action: how long from upload to removal for confirmed violations? For the most severe content (CSAM), this should be seconds. For hate speech, minutes is acceptable.
Appeal rate: creators who appeal and win indicate systematic false positive patterns.
The hardest metric: what you can't measure is the content you missed. You only know about violations that were caught or reported. Estimate miss rate via adversarial red-teaming (upload known test violations and measure detection rate).
Interview red flags#
- Proposing one "harmful content" classifier instead of policy-specific scores with different precision/recall targets by severity.
- Auto-removing everything above a single threshold, with no human review band for ambiguous cases and no appeals path.
- Treating misinformation like graphic violence, as if a model could adjudicate contested factual claims on its own.
- Ignoring adversarial adaptation: creators probe the system and change tactics once they learn what gets caught.
You mentioned misinformation as a violation category — but misinformation is much harder to classify than graphic violence. A video claiming a vaccine causes harm might be false, true, contextually misleading, or legitimate medical debate. How do you build an ML system for something that requires nuanced factual judgment?
What ML can and can't do for misinformation#
An ML model trained on labeled data can learn: does this content resemble known misinformation? It recognizes patterns — specific narratives, source patterns, rhetorical structures associated with previously debunked content. What it can't do is verify factual claims. A model that says "vaccines cause autism" is misinformation has learned from labels, not from verifying immunology literature.
This is fundamental: misinformation detection is a retrieval + verification problem, not a pure classification problem.
The practical architecture#
Claim extraction: run the transcript through an NLP model that identifies specific factual claims ("vaccine X causes condition Y", "election was stolen in state Z"). Not all speech contains verifiable claims — filter to those that do.
Claim matching: match extracted claims against a knowledge base of fact-checked claims — compiled from professional fact-checkers (PolitiFact, Snopes, WHO, CDC), with structured verdicts (true/false/misleading/contested). If the claim matches a known debunked claim with high similarity, flag for action.
Source credibility: who is making the claim? A channel that consistently cites credible sources vs. one that consistently cites fringe sites — this prior affects the threshold for flagging. Build a source credibility graph from citation patterns.
Novelty detection: claims that don't match known fact-checked content but exhibit statistical patterns of viral misinformation (rapid spread, unusual engagement patterns, share-without-view behavior) get routed to human fact-checkers and partner organizations.
Handling contested topics#
Medical and scientific consensus is not always clear:
- COVID-19 in 2020: genuine uncertainty in early weeks; ML systems trained on early "misinformation" labels were wrong as understanding evolved
- Drug safety debates: legitimate scientific controversy vs. fringe claims
YouTube's actual approach: for health and election topics, apply stricter thresholds and route more to human review and authoritative source panels. Don't try to adjudicate contested science with ML — instead surface authoritative information (CDC panel, WHO) alongside the video. The ML system doesn't decide truth; it decides routing and context.
The limits of automation#
For misinformation specifically, ML is best used for:
- Routing (which videos need human or expert review)
- Scale (catching known debunked claims at volume)
- Signals (unusual spread patterns that indicate coordinated inauthentic behavior)
The final call on novel or contested misinformation must involve human judgment and domain experts. This is the honest answer to any interviewer: building a fully automated misinformation classifier that makes final decisions is both technically infeasible and ethically problematic. The system's job is to put the right content in front of the right reviewer, fast.
Design the human review and appeals system. How do reviewers interact with ML, and how do appeal outcomes improve the system?
Review queue design#
The ML system should route cases, not just produce a yes/no label. Queue priority depends on:
- violation severity
- model confidence
- expected reach or viral velocity
- report volume and reporter trust
- channel history
- monetization status
- whether the content is already public
Reviewers should be specialized by policy area and language. Hate speech, medical misinformation, child safety, and violent extremism require different policy expertise.
Reviewer UI#
The reviewer should see model evidence, not just a score:
- flagged transcript spans
- key frames or video segments
- matched hashes or near-duplicate clusters
- policy category and rationale
- channel history
- user reports
- similar prior decisions
This improves consistency and reduces review time, but the UI must avoid over-anchoring reviewers on model predictions.
Appeals#
Appeals are a quality-control loop. Track:
- appeal rate by policy, language, channel type, and model version
- overturn rate
- reviewer disagreement
- time to resolution
- false-positive clusters
Appeal outcomes should not be dumped blindly into training data. They are policy labels under a particular policy version. Store policy version, reviewer confidence, adjudication path, and reason codes.
Senior/staff considerations#
Reviewer labels are not pure ground truth. Policies change, reviewers disagree, and some cases need escalation. A mature system uses gold-standard audits, inter-rater agreement, calibration sessions, and adjudication for ambiguous cases.
Also consider reviewer capacity. If a crisis creates a surge of borderline content, the system must degrade gracefully: throttle distribution, prioritize severe categories, and use temporary stricter review routing rather than silently lowering quality.
How do you handle adversarial creators who adapt once they learn what the system catches?
Adversarial behavior#
Bad actors will mirror videos, alter audio pitch, add borders, use coded phrases, split content into short clips, or coordinate reports and engagement. The system must detect both content and behavior.
Technical defenses#
- Perceptual hashes for images/video/audio to catch near-duplicates.
- Embedding similarity to cluster reuploads and variants.
- Transcript and comment analysis for coded language patterns.
- Graph features for channels, upload sources, shared links, and coordination.
- Velocity anomalies: many new accounts uploading similar content or driving synchronized traffic.
- Red-team datasets that simulate evasion before launch.
Operational loop#
Every major evasion pattern should create:
- detection rule or model patch
- retrospective backfill over recent uploads
- reviewer guidance update
- training data refresh
- metric slice for future monitoring
Senior/staff framing#
Adversarial ML systems are never done. The goal is to shorten adaptation time: detect new abuse patterns, contain distribution, retrain or patch, and measure whether the adversary shifts again. Pure offline accuracy is weak; resilience and response time are core system metrics.
The key takeaway unlocks after you reveal an expert answer.
Key Takeaway
Harmful content design is a policy-routing system, not one classifier: multimodal extraction, policy-specific risk scores, action bands, human review, appeals, post-publish monitoring, and adversarial response. Calibrate precision/recall by severity. For misinformation, ML routes and matches known claims; humans and domain experts handle novel or contested judgments. Reviewer operations, appeals, and evasion response are part of the core ML system.
Follow-up Questions to Test Yourself
Interviewers often pivot here once you cover the core concept.
- How would you design the appeals system — when a creator disputes a removal, how does ML assist the human reviewer, and how do you use appeal outcomes to improve the classifier?
- Coordinated inauthentic behavior (bot networks artificially boosting content) is often harder to detect than the content itself. How would you approach detecting it?
- How do you handle the cold start problem for a brand new channel — you have no history to assess, and bad actors specifically create new channels to avoid history-based signals?
How confident do you feel explaining this?
Track your understanding or flag it to revisit before your next loop.
Related Questions