Text Classification
Safetensors
unsloth
qwen3_5
guardrails
safety
prompt-injection
jailbreak
decision-model
lora
qwen3.5
Eval Results (legacy)
Instructions to use AurelPx/SnapGuard-0.8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Desktop
Head-to-head with Llama Guard: AUPRC, latency, parameters
Browse files53 unmodified lines545556575859606162636439 unmodified lines10410510610710810911011111211311411511611711811912012112212312412512612712812953 unmodified linesHighlights:- **Beats Llama Guard 7B on ToxicChat** with ~8× fewer parameters: AUPRC **0.668** vs 0.626.- **8× faster than Llama Guard 2-8B, 1.8× faster than Llama Guard 3-1B** on the same laptop, with a higher AUPRC: one forward pass, 71 ms median.- **A real probability**: calibrated after training, so you choose how strict to be.- **Multilingual**: trained on English, French, German, Spanish and Italian messages.- **Easy to retrain**: about 3 h on a MacBook, with no NVIDIA GPU.## 📄 Model details39 unmodified lines## 📈 Performance[ToxicChat](https://huggingface.co/datasets/lmsys/toxic-chat) (`toxicchat0124`, test split): 5 083 real user prompts, 362 of them toxic. Prompt classification, threshold-free AUPRC.| Model | Parameters | AUPRC ||---|---:|---:|| **SnapGuard-0.8B** | 0.88 B | **0.668** || Llama Guard | 7 B | 0.626 || OpenAI Moderation API | – | 0.588 || Perspective API | – | 0.532 |Reference numbers are from the [Llama Guard paper](https://arxiv.org/abs/2312.06674) (Table 2).### Faster and better than Llama Guard, on the same laptop| Model (same MacBook Pro M4 Pro) | Parameters | AUPRC* | Latency p50 | ||---|---:|---:|---:|---|| **SnapGuard-0.8B** | 0.88 B | **0.757** | **71 ms** | one forward pass || Llama Guard 3-1B (bf16) | 1 B | 0.370 | 130 ms | **1.8× slower** || Llama Guard 2-8B (8-bit) | 8 B | 0.546 | 565 ms | **7.9× slower** |\* Same 1 000 ToxicChat test prompts for every model (random sample, seed 0); SnapGuard scores 0.668 on the full test set. Batch size 1, warm models, MLX. Latency is the time to a usable verdict: one forward pass for SnapGuard, generating `safe` / `unsafe` for Llama Guard (median over 200 prompts). SnapGuard reads at most 512 tokens. Reproduce with [`compare_guards.py`](https://github.com/Aurelien7877/llm2decider/blob/main/compare_guards.py).## ⚠️ Limitations53 unmodified lines54555657585960616263646539 unmodified lines10510610710810911011111211311411511611711811912012112212312412553 unmodified linesHighlights:- 🎯 **2.0× the ToxicChat AUPRC of Llama Guard 3-1B**, and higher than Llama Guard 2-8B (0.757 vs 0.546).- ⚡ **7.9× faster than Llama Guard 2-8B** on the same laptop: one forward pass, **71 ms** per message.- 🪶 **9× fewer parameters than Llama Guard 2-8B** (0.88 B vs 8.03 B).- 📊 **A real probability**, calibrated after training, so you choose how strict to be.- 🌍 **Multilingual**: trained on English, French, German, Spanish and Italian messages.- 🍏 **Easy to retrain**: about 3 h on a MacBook, with no NVIDIA GPU.## 📄 Model details39 unmodified lines## 📈 Performance**SnapGuard-0.8B vs Llama Guard**, head to head on the same laptop:- 🎯 **2.0× the AUPRC of Llama Guard 3-1B** (0.757 vs 0.370), and **+0.21 over Llama Guard 2-8B**- ⚡ **7.9× faster than Llama Guard 2-8B**, 1.8× faster than Llama Guard 3-1B: **71 ms** per message- 🪶 **9× fewer parameters than Llama Guard 2-8B**, 1.7× fewer than Llama Guard 3-1B| Model | Parameters | ToxicChat AUPRC | Latency (p50) ||---|---:|---:|---:|| **SnapGuard-0.8B** | **0.88 B** | **0.757** | **71 ms** || Llama Guard 3-1B | 1.50 B (1.7× larger) | 0.370 (2.0× lower) | 130 ms (1.8× slower) || Llama Guard 2-8B | 8.03 B (9.1× larger) | 0.546 | 565 ms (7.9× slower) |[ToxicChat](https://huggingface.co/datasets/lmsys/toxic-chat) (`toxicchat0124` test): real user prompts, ~7 % toxic. The three models see the same 1 000 prompts (random sample, seed 0), on the same MacBook Pro M4 Pro (MLX, batch size 1, warm models). Latency is the time to a usable verdict: one forward pass for SnapGuard, generating `safe` / `unsafe` for Llama Guard (median over 200 prompts). Llama Guard 3-1B runs in bf16 like SnapGuard, Llama Guard 2-8B in 8-bit. On the full test set (5 083 prompts) SnapGuard scores 0.668, vs 0.626 published for Llama Guard 7B.Reproduce with [`compare_guards.py`](https://github.com/Aurelien7877/llm2decider/blob/main/compare_guards.py).## ⚠️ Limitations
README.md+17-21