DAO LUA V1
lightweight CPU-friendly prompt injection and scam detector
3 min readupdated
A compact 140M-parameter multi-task classification model trained by the Dark Lag team on top of SupersonicLabs/Julia-1 (an mmBERT-small architecture with a multi-choice head). It simultaneously handles three safety tasks: detecting scam messages in Vietnamese, extracting 5 explaining scam features (OTP requests, urgency, impersonation, payment, links/apps), and catching prompt injection attempts (hidden instructions and system prompt jailbreaks) to protect RAG systems and AI agents. Unlike heavier detectors like ProtectAI DeBERTa-v3-v2, the model is optimized for fast inference on a standard 2-core CPU via ONNX Runtime without requiring PyTorch. It is useful for chatbot developers, fintech services, and agentic pipelines as a fast first-tier filter.
Key features
- Fast CPU performance: the
ONNX FP32version (~579 MB) runs in 149.6 ms on 2 CPU cores (OMP_NUM_THREADS=2), outperforming the ProtectAI DeBERTa-v3-v2 baseline (546.7 ms). - Prompt injection protection in EN and VI: on the BIPIA benchmark (EN), the model achieves an AUC of
0.9879and an F1 of0.944, and on InjecAgent OOD (EN), an AUC of0.7842and an F1 of0.734. - Scam detection with explainability: alongside the verdict (
safe/uncertain/scam), it outputs probabilities for 5 specific manipulation signals with AUCs ranging from0.925to0.990. - Two weight formats: the repository provides a ready-to-use
model_fp32.onnxfor production andmodel.safetensors(~577 MB) for fine-tuning in PyTorch.
What you can do
- Protect RAG and AI agents: deploy the model as a primary filter before the main LLM to intercept hidden instructions, rule-override attempts, and system prompt extractions in English or Vietnamese.
- Build a two-stage AI router: combine local DAO LUA V1 runs with a sliding window (
280/220) and secondary verification of ambiguous cases by a larger model—in the authors' tests, pairing it withgemini-decision-1achieved 100% Recall on complex attacks. - Filter phishing and scam messages: embed the ONNX model into an anti-spam pipeline for Vietnamese traffic with highlighted trigger reasons (such as a suspicious link or OTP theft).
Example
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="VozenhDesWillfort/daolua-v1",
local_dir="ckpt_v10_5_pi2",
ignore_patterns=["model.safetensors"],
)
Read more
DetailsMetrics: BIPIA Test (400, EN) — AUC 0.9879 / F1 0.944; InjecAgent OOD (600, EN) — AUC 0.7842 / F1 0.734; VI Indirect Fintech (120) — AUC 0.9764 / F1 0.906; scam on testAIL (401, VI) — ROC-AUC 0.858.
Hardware and size: 140M parameters, ONNX FP32 weighs ~579 MB (entire release with tokenizer ~613 MB), response time 149.6 ms on 2 CPU cores.
Limitations: scam detection and the 5 signals are trained exclusively for the Vietnamese language; the tokenizer requires
transformers>=5.0,<5.1.









Comments