Content moderation scores text, images or audio against categories such as hate, sexual content, self-harm, violence and illegal activity, then blocks, flags or routes it for review. It applies to user input and to model output.
Category scores and thresholds
Dedicated classifiers do the scoring. Examples are OpenAI's Moderation endpoint, Meta's Llama Guard and Azure AI Content Safety. Each returns a score per category that estimates how likely the content belongs to it.
- Send the content to the classifier.
- Receive category scores.
- Compare each score with the threshold you set for that category.
- Block, flag or route to a human reviewer.
- Log the decision.
On a social platform, a comment that scores above the hate-speech threshold is blocked. One that lands just under it goes to human review. Multimodal moderation applies the same flow to images and audio, so a borderline image can reach a reviewer instead of being blocked outright.
Thresholds are a product decision
A spam filter or antivirus scanner in the request path is the nearest software analogue, but harm depends on context and culture. A phrase that is acceptable in a medical setting may be wrong in a children's app. Choosing a threshold therefore means knowing the audience and the policy, and it is a product decision as much as a technical one. A single global threshold over-blocks in some places and under-blocks in others.
A separate layer versus the model's built-in refusals
Relying on the base model's own refusals gives inconsistent results. You cannot tune them, and they leave nothing in your logs. A separate moderation layer gives per-category control, lets you change thresholds without touching prompts or the model, and produces an audit trail of moderation actions. That trail is what you need to justify a decision to a user or a regulator, and to handle appeals.
Where to apply moderation by deployment type
- User-generated content platforms and open chat: apply strict moderation to both input and output.
- Internal tools and closed environments: lighter moderation, mainly on output.
- Any deployment: tune thresholds to your risk profile and demographic.
Example scenario: too many comments flagged
Example scenario: the system flags 30% of user comments, but manual review finds only 10% are harmful. A high false positive rate like this suggests the model is keying on specific words or phrases, possibly because its training data under-represented the variety of content users post.
- Compare the distribution of flagged categories with the manual review results.
- Look for under-represented categories or contexts in the training data.
- Check precision and recall to see where over-flagging concentrates.
The fix is to retrain the moderation model on a more balanced set of benign and harmful examples, which takes extra data collection and annotation. Monitor the false positive rate after deployment against a target you set.