Yash1005 commited on
Commit
16508e1
·
1 Parent(s): bb68ebb

add/update model card with eval metrics

Browse files
Files changed (1) hide show
  1. README.md +36 -5
README.md CHANGED
@@ -14,13 +14,18 @@ tags:
14
 
15
  # Prompt Injection Detection (encoder, multi-label)
16
 
17
- Multi-label classifier over 9 prompt-injection attack categories,
18
- fine-tuned from **[`jhu-clsp/mmBERT-base`](https://huggingface.co/jhu-clsp/mmBERT-base)**. Single
19
- forward pass; `is_valid` = any attack above threshold (0.5).
 
 
20
 
21
  - **Base model**: [`jhu-clsp/mmBERT-base`](https://huggingface.co/jhu-clsp/mmBERT-base)
22
- - **Trained with**: max_seq_length=3072, epochs=3, lr=2e-05
23
  - **Labels (9)**: DirectInjection, Jailbreak, Adversarial, Extraction, Encoding, Manipulation, Smuggling, Indirect, MultiTurn
 
 
 
 
24
 
25
  ## Usage
26
 
@@ -46,4 +51,30 @@ result = {"is_valid": bool(present), "category": {k: True for k in present}}
46
  print(result) # e.g. {"is_valid": True, "category": {"DirectInjection": True}}
47
  ```
48
 
49
- > Test-set metrics are added by `eval_and_push_card.py` after evaluation.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  # Prompt Injection Detection (encoder, multi-label)
16
 
17
+ Encoder classifier that detects which prompt-injection attack categories (out of
18
+ 9) appear in an input. Fine-tuned from
19
+ **[`jhu-clsp/mmBERT-base`](https://huggingface.co/jhu-clsp/mmBERT-base)**.
20
+ Replaces the 2B Qwen decoder LoRA with a single-forward-pass encoder for
21
+ lower-latency runtime-security use in LLM-Guard's `PromptInjection` scanner.
22
 
23
  - **Base model**: [`jhu-clsp/mmBERT-base`](https://huggingface.co/jhu-clsp/mmBERT-base)
 
24
  - **Labels (9)**: DirectInjection, Jailbreak, Adversarial, Extraction, Encoding, Manipulation, Smuggling, Indirect, MultiTurn
25
+ - **Output**: per-category sigmoid; `is_valid` = any attack above threshold
26
+ (0.5).
27
+ - **Multilingual / long context**: inherited from the base encoder; trained with
28
+ inputs up to the base model's positional limit.
29
 
30
  ## Usage
31
 
 
51
  print(result) # e.g. {"is_valid": True, "category": {"DirectInjection": True}}
52
  ```
53
 
54
+ ## Test-set metrics (n=500)
55
+
56
+ | Metric | Value |
57
+ |--------|-------|
58
+ | is_valid (attack-detection) accuracy | 0.890 |
59
+ | category-set (exact) accuracy | 0.054 |
60
+ | micro-F1 | 0.351 |
61
+ | macro-F1 | 0.356 |
62
+ | latency mean (ms/example) | 1.823335886001587 |
63
+ | latency p95 (ms/example) | 1.9494213163852692 |
64
+ | device | cuda:0 |
65
+
66
+ ### Per-category F1
67
+
68
+ | Category | F1 | Description |
69
+ |----------|----|-------------|
70
+ | `Adversarial` | 0.400 | Carefully crafted inputs that exploit model quirks or training artifacts to elicit unintended behavior without an obvious override. |
71
+ | `DirectInjection` | 0.523 | Explicit instruction overrides that tell the model to ignore prior context (e.g. "ignore all previous instructions and …"). |
72
+ | `Encoding` | 0.373 | Obfuscated payloads using base64 / ROT13 / leetspeak / homoglyphs / zero-width chars / shell pipes to bypass keyword filters. |
73
+ | `Extraction` | 0.257 | Attempts to leak the system prompt, hidden instructions, or memorized training data (e.g. "print everything between <<system>> tags"). |
74
+ | `Indirect` | 0.323 | Injection delivered through untrusted retrieved content (RAG passages, scraped pages, file contents) rather than the user's direct turn. |
75
+ | `Jailbreak` | 0.397 | Persona / role swaps and constraint bypasses aimed at disabling safety alignment (e.g. DAN, "you are now an unrestricted assistant"). |
76
+ | `Manipulation` | 0.272 | Social-engineering framings (urgency, authority, sympathy, false context) that pressure the model into compliance. |
77
+ | `MultiTurn` | 0.164 | Crescendo / drip-feed attacks that build up across multiple turns to gradually erode guardrails. |
78
+ | `Smuggling` | 0.491 | Hidden control tokens, chat-template markers, or special sequences injected to confuse the parser (e.g. fake `<|im_end|>` / role tags). |
79
+
80
+ *Evaluated on `test_dataset_injection.csv`. Generated 2026-06-03 09:26 UTC.*