| --- |
| language: |
| - en |
| - vi |
| - hi |
| - th |
| - zh |
| - ja |
| - ru |
| - ar |
| - sv |
| - es |
| - it |
| library_name: optimum |
| pipeline_tag: text-classification |
| tags: |
| - prompt-injection |
| - safety |
| - multilingual |
| - onnx |
| - hikmaai |
| license: apache-2.0 |
| --- |
| |
| # hikmaai-mdeberta-v3-base-prompt-injection-multilingual |
|
|
| A multilingual prompt injection classifier fine-tuned from |
| [microsoft/mdeberta-v3-base](https://huggingface.co/microsoft/mdeberta-v3-base) |
| by [HikmaAI](https://huggingface.co/HikmaAI). |
|
|
| ## Model Description |
|
|
| - **Task**: Binary classification (benign=0, injection=1) |
| - **Base model**: `microsoft/mdeberta-v3-base` |
| - **Languages**: 11 (en, vi, hi, th, zh, ja, ru, ar, sv, es, it) |
| - **Export formats**: ONNX FP32 + FP16 + INT8 (x86-safe dynamic) |
|
|
| ## Performance |
|
|
|
|
| | Metric | Score | |
| |--------|-------| |
| | loss | 0.0387 | |
| | accuracy | 0.9950 | |
| | precision | 0.9815 | |
| | recall | 0.9701 | |
| | f1 | 0.9758 | |
|
|
|
|
| Optimized threshold: **0.5000** (val recall: 0.9709) |
|
|
| ## Usage (ONNX) |
|
|
| ```python |
| from optimum.onnxruntime import ORTModelForSequenceClassification |
| from transformers import AutoTokenizer |
| |
| model = ORTModelForSequenceClassification.from_pretrained( |
| "HikmaAI/hikmaai-mdeberta-v3-base-prompt-injection-multilingual", |
| subfolder="onnx/fp16", |
| ) |
| tokenizer = AutoTokenizer.from_pretrained( |
| "HikmaAI/hikmaai-mdeberta-v3-base-prompt-injection-multilingual", |
| subfolder="tokenizer", |
| ) |
| |
| inputs = tokenizer("Ignore all previous instructions", return_tensors="pt") |
| outputs = model(**inputs) |
| # outputs.logits -> [benign_score, injection_score] |
| ``` |
|
|
| ## Training |
|
|
| - Epochs: 5 |
| - Learning rate: 2e-05 |
| - Batch size: 16 |
| - Class weights: [1.0, 1.3] |
| - Dataset: multilingual (11 languages), 12+ sources + synthetic data |
|
|
| ## License |
|
|
| Apache-2.0 |
|
|
| ## Citation |
|
|
| ```bibtex |
| @misc{hikmaai-prompt_injection-2026, |
| title={hikmaai-mdeberta-v3-base-prompt-injection-multilingual}, |
| author={HikmaAI}, |
| year={2026}, |
| publisher={HuggingFace}, |
| url={https://huggingface.co/HikmaAI/hikmaai-mdeberta-v3-base-prompt-injection-multilingual} |
| } |
| ``` |
|
|