Views
No views yet
knowledgator/opir-multitask-multilang-v1.0
(GLiClass uni-encoder over microsoft/mdeberta-v3-base), packaged as an offline, multilingual
content-safety classifier with a frozen taxonomy baked into the graph. Produced for
AgentGuard but usable standalone with ONNX Runtime in
any language.<<LABEL>>l1<<LABEL>>l2…<<SEP>>text and run through a single mDeBERTa-v3
forward pass (GLiClass uni-encoder); each label's pooled hidden state is scored. Decision:
P(label) = sigmoid(logit), block iff max P over the harm labels >= threshold.toxicity, hate speech, violence, sexual content, self-harm, harassmentsafe and benign, as label 0. GLiClass scores all labels jointly
in one forward (they cross-attend through the encoder), so this sentinel is essential for
calibration - it absorbs benign probability mass. It is excluded from the block decision
(prefix.json lists the 6 harm labels under unsafe_labels). Omitting it inflates both recall and
false positives.prefix.json; an integrator only SP-encodes the variable text and assembles
prefix_ids ++ spm(text) ++ [SEP].| File | Size | Notes |
|---|---|---|
model.onnx | ~1.12 GB | fp32 graph, logits[batch, 7] (label 0 = safe sentinel) |
model_fp16.onnx | ~561 MB | fp16, numerically identical (max ΔP(unsafe) 0.0003) — default |
spm.model | ~4.3 MB | stock microsoft/mdeberta-v3-base SentencePiece (250k multilingual vocab) |
prefix.json | <1 KB | baked labels (7, safe first) + unsafe_labels (6 harm) + precomputed [CLS] <<LABEL>>…<<SEP>> id prefix + special ids |
input_ids (int64), attention_mask (int64). Output: logits ([batch, 7] - the safe
sentinel plus the 6 harm labels). Special ids: [CLS]=1, [SEP]=2, <<LABEL>>=250102, <<SEP>>=250103, pad=0.prefix.json). Per-deployment tunable: the false-positive rate is
somewhat threshold-sensitive on this multilingual model (unlike the English Opir variant), e.g.
Hindi toxicity moves from 56% recall / 16% FPR at 0.5 to 36% / 4% at 0.8.textdetox/multilingual_toxicity_dataset across de/es/ru/ar/zh/hi), free and PII-safe.knowledgator/opir-multitask-multilang-v1.0 (Apache-2.0) using Microsoft's
mdeberta-v3-base SentencePiece tokenizer. ONNX export, fp16 conversion, and frozen-taxonomy
packaging by AgentGuard (Apache-2.0). The frozen taxonomy and the int-id prefix are the only
additions; the model weights are unchanged.1@misc{stepanov2026opirefficientmultitasksafety,
2 title={Opir: Efficient Multi-Task Safety Classification for Toxicity, Jailbreaks, Hate Speech, and Harmful Content},
3 author={Ihor Stepanov and Aleksandr Smechov},
4 year={2026},
5 eprint={2605.29659},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/2605.29659},
9}