Text Classification
PEFT
Safetensors
Vietnamese
soft-prompt
prompt-tuning
hallucination-detection
vietnamese
ViHallu
Instructions to use Laplaces-Red-Devils/vihallu-qwen3-4b-softprompt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Laplaces-Red-Devils/vihallu-qwen3-4b-softprompt with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "Laplaces-Red-Devils/vihallu-qwen3-4b-softprompt") - Notebooks
- Google Colab
- Kaggle
File size: 1,067 Bytes
ed7dc41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ---
base_model: Qwen/Qwen3-4B-Instruct-2507
library_name: peft
pipeline_tag: text-classification
language: [vi]
tags: [soft-prompt, prompt-tuning, peft, hallucination-detection, vietnamese, ViHallu]
---
# ViHallu — Qwen3-4B + Soft Prompt (Prompt Tuning)
Phát hiện hallucination tiếng Việt (ViHallu). **Prompt Tuning**: chèn 32 virtual token học được
vào trước input, đóng băng toàn bộ base model — chỉ train **81,920 tham số (0.002%)**.
Model 2 để so sánh với bản LoRA. DS319 Lab 6 · Lương Đắc Nguyên (23521041).
## Kết quả (test = 2000)
| Accuracy | Precision | Recall | Macro-F1 | Sai format |
|---|---|---|---|---|
| 0.8135 | 0.8149 | 0.8106 | 0.8098 | 0/2000 |

So với LoRA (Acc 0.911): soft-prompt yếu hơn ~10 điểm nhưng chỉ dùng 81,920 tham số.
## Tham số
| | |
|---|---|
| Method | Prompt Tuning (PEFT), 32 virtual tokens |
| Epochs / lr | 5 / 5e-3 |
| max_seq_length | 2048 |
| Base | Qwen/Qwen3-4B-Instruct-2507 |
|