hikmaai-xlm-roberta-large-toxicity
A multilingual toxicity text classifier fine-tuned from xlm-roberta-large by HikmaAI.
Model Description
- Task: Binary classification (benign=0, toxic=1)
- Version: 3.0.0
- Base model:
xlm-roberta-large - Languages: 11 (en, vi, hi, th, zh, ja, ru, ar, sv, es, it)
- Export formats: ONNX FP32 + FP16 + INT8 (x86-safe dynamic)
Beyond declarative toxicity (slurs, hate speech, threats in the words), the classifier is trained to flag politely-phrased harmful requests: harm solicitation, doxxing/privacy requests, solicited discrimination, atrocity denial, and illicit-capability questions.
Performance
| Metric | Score |
|---|---|
| loss | 0.1001 |
| accuracy | 0.9834 |
| precision | 0.9507 |
| recall | 0.8914 |
| f1 | 0.9201 |
Optimized threshold: 0.6600 (val recall: 0.8854)
Usage (ONNX)
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer
model = ORTModelForSequenceClassification.from_pretrained(
"HikmaAI/hikmaai-xlm-roberta-large-toxicity",
subfolder="onnx/fp16",
)
tokenizer = AutoTokenizer.from_pretrained(
"HikmaAI/hikmaai-xlm-roberta-large-toxicity",
subfolder="tokenizer",
)
inputs = tokenizer("You are worthless and everyone hates you", return_tensors="pt")
outputs = model(**inputs)
# outputs.logits -> [benign_score, toxic_score]
Training
- Epochs: 5
- Learning rate: 2e-05
- Batch size: 32
- Class weights: [1.0, 1.0]
- Dataset: multilingual (11 languages), ~90/10 benign/toxic, 12+ sources + targeted synthetic data (request-style harm cells in all 11 languages)
License
Apache-2.0
Citation
@misc{hikmaai-toxicity-2026,
title={hikmaai-xlm-roberta-large-toxicity},
author={HikmaAI},
year={2026},
publisher={HuggingFace},
url={https://huggingface.co/HikmaAI/hikmaai-xlm-roberta-large-toxicity}
}
- Downloads last month
- 7