Views
No views yet
Qwen/Qwen3Guard-Gen-0.6B
Teacher: Qwen/Qwen3Guard-Gen-8B
KD method: MINILLM
Scenario: OOB (out-of-box — neither teacher nor student was fine-tuned on DIA-GUARD before KD)| Metric | Value |
|---|---|
| Accuracy | 0.6049 |
| Precision | 0.7517 |
| Recall | 0.6352 |
| F1 | 0.5662 |
| Test samples | 181,874 |
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| safe | 0.5369 | 0.9884 | 0.6958 | 83,140 |
| unsafe | 0.9665 | 0.2820 | 0.4366 | 98,734 |
| Predicted safe | Predicted unsafe | |
|---|---|---|
| Actual safe | TN=82,174 | FP=966 |
| Actual unsafe | FN=70,888 | TP=27,846 |
| Method | MINILLM |
| Teacher | Qwen/Qwen3Guard-Gen-8B |
| Student base | Qwen/Qwen3Guard-Gen-0.6B |
| Train data | 50,000 dialect-stratified DIA-GUARD samples |
| Epochs | 1 |
| Framework | HuggingFace transformers + accelerate |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2tokenizer = AutoTokenizer.from_pretrained("jsl5710/Shield-Qwen3Guard-Gen-0.6B-KD-MINILLM-Qwen3Guard-Gen-8B-OOB")
3model = AutoModelForCausalLM.from_pretrained("jsl5710/Shield-Qwen3Guard-Gen-0.6B-KD-MINILLM-Qwen3Guard-Gen-8B-OOB", torch_dtype="bfloat16")
4
5prompt = "Classify the following text as safe or unsafe.\n\nText: Hello\n\nAnswer:"
6inputs = tokenizer(prompt, return_tensors="pt")
7out = model.generate(**inputs, max_new_tokens=8)
8print(tokenizer.decode(out[0], skip_special_tokens=True))