--- license: apache-2.0 library_name: transformers base_model: jhu-clsp/mmBERT-base base_model_relation: finetune pipeline_tag: text-classification language: - multilingual - en - ar - am - cs - de - es - fr - he - hi - id - it - ja - ko - nl - pl - pt - ru - sv - tt - uk - zh datasets: - google/civil_comments - Horizon-Labs/civil-comments-multilingual - afrihate/afrihate - HuggingFaceFW/fineweb-2 - allenai/real-toxicity-prompts - ToxicityPrompts/PolygloToxicityPrompts - HPLT/HPLT2.0_cleaned metrics: - roc_auc - f1 tags: - abacusai - toxicity - content-moderation - trust-and-safety - perspective-api - hate-speech - multilingual - multi-label-classification - onnx - transformers.js ---
| Task | Seven independent probabilities named after the Perspective API attributes |
| Architecture | ModernBERT encoder: 22 layers, hidden size 768, 12 attention heads, local attention (128 tokens) with global attention every third layer |
| Parameters | 308M (307,535,623) |
| Languages | Trained on English, Civil Comments translated into 30+ languages, natively written Arabic, Amharic and Tatar, and web text in 17 languages plus English prompts that carry the Perspective API's own scores; distilled on its teacher's scores for 374,000 natively written Hebrew, Hinglish, Tatar and Ukrainian web segments; evaluated in 21 languages plus Hinglish |
| Input scored | 256-token windows; the bundled server scores longer texts in overlapping windows |
| Calibration | Per-attribute temperature, folded into the classification head |
| Formats | safetensors (float32); ONNX float32 (exact), 8-bit (CPU default, near-exact) and dynamic int8 (transformers.js) |
| Speed | 22 ms per comment on 4 CPU threads (8-bit ONNX, Apple M5); about 2,200 comments per second on one H100 (bfloat16) |
| Base model | jhu-clsp/mmBERT-base |
| Adaptation | Full finetune, distilled from an XLM-R-large teacher (560M) trained on the same data |
| License | Apache 2.0 |
| Toxicity-Lens 308M | Horizon base 308M | Horizon small 141M | Detoxify multilingual 278M | Detoxify unbiased 125M | |
|---|---|---|---|---|---|
| Civil Comments: mean ROC AUC over 6 attributes | 98.9 | 98.8 | 98.8 | 96.1 | 98.5 |
| Civil Comments: TOXICITY ROC AUC | 97.5 | 97.1 | 97.2 | 96.1 | 96.9 |
| TextDetox: ROC AUC, 15 languages | 89.0 | 85.4 | 83.5 | 67.8 | 58.8 |
| TextDetox: F1 at the 0.5 threshold, 15 languages | 65.2 | 43.3 | 54.7 | 35.2 | 8.6 |
| Toxicity-Lens 308M | Qwen3Guard-Gen-8B 8.2B | Qwen3Guard-Gen-0.6B 0.6B | Horizon guard-base 308M | Vela Shield 307M | |
|---|---|---|---|---|---|
| ROC AUC | 88.4 | 84.6 | 76.9 | 83.7 | 80.4 |
| F1 at 0.5 | 70.4 | 77.5 | 72.2 | 66.7 | 72.0 |
| Clean comments flagged, % (lower is better) | 8.1 | 38.8 | 46.1 | 11.4 | n/a |
| Toxicity-Lens 308M | Horizon base 308M | Horizon small 141M | Detoxify multilingual 278M | Detoxify unbiased 125M | |
|---|---|---|---|---|---|
| Rank agreement with Perspective's scores (Spearman) | |||||
| English, RealToxicityPrompts (held-out): TOXICITY | 93.3 | 87.7 | 86.8 | 81.9 | 84.7 |
| English, RealToxicityPrompts (held-out): mean of the 7 attributes | 85.9 | 76.2 | 75.1 | n/a | 69.5 |
| 17 languages, PolygloToxicityPrompts: TOXICITY, mean over languages | 95.6 | 85.8 | 83.6 | 62.0 | 40.4 |
| 17 languages: one ranking over all 85,000 texts | 94.1 | 81.6 | 79.3 | 59.1 | 23.9 |
| Swapped in at the same threshold: Perspective's flags kept | |||||
| English at 0.8 | 94.6 | 17.7 | n/a | n/a | n/a |
| 17 languages at 0.5 | 86.6 | 62.9 | 62.8 | 42.7 | 15.9 |
| 17 languages at 0.8 | 85.0 | 14.2 | 15.4 | 33.7 | 12.4 |
| Swapped in at the same threshold: extra flags (lower is better) | |||||
| English at 0.8 | 3.8 | 0.0 | n/a | n/a | n/a |
| 17 languages at 0.5 | 2.6 | 3.6 | 4.8 | 5.2 | 2.3 |
| 17 languages at 0.8 | 12.4 | 2.4 | 2.4 | 12.9 | 4.7 |
| Toxicity-Lens 308M | Horizon base 308M | Horizon small 141M | Detoxify multilingual 278M | Detoxify unbiased 125M | |
|---|---|---|---|---|---|
| Not in the released model's training data | |||||
| GAHD (German, identity attacks) | 81.2 | 78.3 | 77.9 | 62.2 | 56.6 |
| COLD (Chinese, offensive language) | 81.7 | 80.9 | 79.6 | 50.4 | 50.7 |
| HED-COLD (Chinese) | 80.6 | 80.5 | 79.1 | 49.0 | 49.5 |
| SWSR (Chinese, sexism) | 81.6 | 80.3 | 79.3 | 51.2 | 57.7 |
| LLM-jp toxicity (Japanese) | 91.3 | 85.9 | 80.6 | 62.8 | 52.9 |
| TextDetox Tatar, 4,000 rows never trained on (a release gate) | 86.6 | 81.1 | 79.3 | 61.6 | 47.2 |
| Test splits of datasets used in training | |||||
| AfriHate (Amharic, Algerian and Moroccan Arabic) | 88.8 | 73.9 | 67.4 | 57.7 | 62.9 |
| MLMA (Arabic) | 78.3 | 64.0 | 64.7 | 46.9 | 50.7 |
| Identity-group bias | |||||
| CivilComments-WILDS: Jigsaw bias score (higher = less biased) | 93.4 | 92.6 | 92.9 | 91.2 | 93.9 |
| Toxicity-Lens 308M | Horizon base 308M | Horizon small 141M | Detoxify multilingual 278M | |
|---|---|---|---|---|
| Amharic | 84.4 | 71.6 | 63.6 | 54.8 |
| Arabic | 81.9 | 78.7 | 72.1 | 41.4 |
| German | 87.0 | 85.9 | 85.9 | 66.2 |
| English | 99.6 | 99.3 | 99.0 | 99.2 |
| Spanish | 92.2 | 90.7 | 89.9 | 81.9 |
| French | 99.5 | 98.7 | 98.4 | 98.1 |
| Hebrew | 84.0 | 78.8 | 77.8 | 50.3 |
| Hindi | 92.4 | 91.0 | 89.7 | 64.5 |
| Hinglish (romanised Hindi) | 78.9 | 76.5 | 74.9 | 63.0 |
| Italian | 88.1 | 87.5 | 84.0 | 81.8 |
| Japanese | 89.7 | 84.6 | 83.1 | 50.6 |
| Russian | 99.7 | 97.3 | 95.6 | 80.7 |
| Tatar | 85.2 | 81.8 | 80.8 | 62.6 |
| Ukrainian | 91.9 | 80.8 | 80.8 | 68.1 |
| Chinese | 79.9 | 77.4 | 77.1 | 54.7 |
| Your Perspective threshold | 0.5 | 0.7 | 0.8 | 0.9 |
|---|---|---|---|---|
| English (RealToxicityPrompts): Perspective's flags kept | 88% | 92% | 95% | 94% |
| English: extra flags | 3.7% | 3.4% | 3.8% | 4.8% |
| English: threshold that flags as many comments as Perspective | 0.48 | 0.74 | 0.86 | 0.94 |
| 17 languages (PolygloToxicityPrompts): Perspective's flags kept | 87% | 91% | 85% | 80% |
| 17 languages: extra flags | 2.6% | 7.9% | 12.4% | 2.8% |
| 17 languages: threshold that flags as many texts as Perspective | 0.40 | 0.74 | 0.85 | 0.93 |