Accuknoxtechnologies/PII-Qwen3.5-2B-v8
Qwen PII Guard (merged)
Fine-tuned from Qwen/Qwen3.5-2B to detect personally-identifiable information in user prompts and emit a single JSON object listing the values found in each of 15 categories.
Output schema:
{"is_valid": true,
"category": {"Name": ["John Doe"], "Email": ["john@example.com"]}}is_valid is false and category is {} when the prompt contains no PII.
Categories
name, email, phonenumber, address, date, nationalid, passportnumber, driverslicense, taxid, cardnumber, bankaccount, credentials, ipaddress, username
Evaluation (transformers reference path)
- test rows: 200 (held-out, from
test_dataset_pii.csv) is_validaccuracy: 1.0000- category key-set accuracy: 0.9350
- category value-set accuracy: 0.8300
- binary F1 (
is_valid): 1.0000 (P=1.000 R=1.000) - macro F1 over categories (key-presence): 0.9791
- macro F1 over categories (value-set): 0.9529
- parse errors: 0/200
Binary confusion matrix (positive = "contains PII"):
Per-category KEY-presence (did the model emit this category at all?):
Per-category VALUE-set (did the exact strings match within the category?):
Latency (transformers, single-prompt, greedy decoding):
Quick start
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Accuknoxtechnologies/PII-Qwen3.5-2B-v8")
model = AutoModelForCausalLM.from_pretrained("Accuknoxtechnologies/PII-Qwen3.5-2B-v8", torch_dtype="auto", device_map="auto")
prompt = "Please contact me at jane@example.com or +1 415 555 0100."
msgs = [
{"role": "system", "content": "<see SYSTEM_MSG in train_qwen_pii.py>"},
{"role": "user", "content": prompt},
]
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
out = model.generate(**tok(text, return_tensors="pt").to(model.device),
max_new_tokens=512, do_sample=False, pad_token_id=tok.pad_token_id)
print(tok.decode(out[0], skip_special_tokens=True))Evaluation — vLLM serving (merged model, text-only)
Same 200 held-out prompts, served through vLLM `0.21.0` instead of the transformers .generate() loop. Greedy decoding, dtype bf16, enable_prefix_caching=True, enable_chunked_prefill=True. This reflects production serving accuracy + latency.
- JSON parse errors:
0/200(0.0%)
Accuracy (vLLM)
Confusion matrix — binary is_valid (vLLM)
Per-category key-presence (vLLM)
vLLM inference latency (single-stream, batch = 1)
vLLM throughput (single batched submit)
- Prompts/sec: 27.73
- Output tokens/sec: 1569.0
- Input tokens/sec: 35596.5
- Batched wall time for all 200 prompts: 7.21 s
Card generated at 2026-05-31 07:39 UTC. Adapter weights: `Accuknoxtechnologies/PII-Qwen3.5-2B-v8`.
