JHC04567 commited on
Commit
4122640
·
verified ·
1 Parent(s): 0c1cadd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -1
README.md CHANGED
@@ -43,6 +43,11 @@ model-index:
43
 
44
  # SPID: Split-based Prompt Injection Detector
45
 
 
 
 
 
 
46
  **SPID** is a lightweight (184M, ~1.5GB) pre-filter that blocks common prompt injection attacks before they reach expensive LLM APIs. By catching obvious attacks locally—even on CPU—SPID reduces API costs while large LLMs handle legitimate traffic.
47
 
48
  The key innovation is **fragment-based detection**: SPID splits input into fragments and classifies each independently, catching compound attacks where a malicious instruction hides behind a benign prefix.
@@ -55,7 +60,7 @@ The key innovation is **fragment-based detection**: SPID splits input into fragm
55
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
56
  import torch
57
 
58
- model_id = "your-username/spid-deberta-base"
59
  tokenizer = AutoTokenizer.from_pretrained(model_id)
60
  model = AutoModelForSequenceClassification.from_pretrained(model_id)
61
 
 
43
 
44
  # SPID: Split-based Prompt Injection Detector
45
 
46
+ <p align="center">
47
+ <img src="spid_architecture.png" width="85%">
48
+ </p>
49
+
50
+
51
  **SPID** is a lightweight (184M, ~1.5GB) pre-filter that blocks common prompt injection attacks before they reach expensive LLM APIs. By catching obvious attacks locally—even on CPU—SPID reduces API costs while large LLMs handle legitimate traffic.
52
 
53
  The key innovation is **fragment-based detection**: SPID splits input into fragments and classifies each independently, catching compound attacks where a malicious instruction hides behind a benign prefix.
 
60
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
61
  import torch
62
 
63
+ model_id = "JHC04567/spid-deberta-base"
64
  tokenizer = AutoTokenizer.from_pretrained(model_id)
65
  model = AutoModelForSequenceClassification.from_pretrained(model_id)
66