Downloads · 30 days
0
angwindy/lab21-2A202601756-qwen35-triage-vi
lab21-2A202601756-qwen35-triage-vi is a machine learning model from angwindy. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
Adapter LoRA fine-tuned trên unsloth/Qwen3.5-4B cho bài toán phân loại ticket CSKH tiếng Việt → JSON 4 khoá (intent, urgency, product, sentiment).
Downloads · 30 days
0
Access
Public
Updated Aug 21, 2026
Repo size
150 MB
Likes
0
Public
Click a slice to open those files.
.safetensors130 MB · 87%
From the Hugging Face model README
Adapter LoRA fine-tuned trên unsloth/Qwen3.5-4B cho bài toán phân loại
ticket CSKH tiếng Việt → JSON 4 khoá (intent, urgency, product,
sentiment).
Repo này là deliverable phụ (B5 — HuggingFace Hub, +2 điểm thưởng). Code, results, report đầy đủ đặt ở GitHub: https://github.com/angWindy/lab21-2A202601756
unsloth/Qwen3.5-4B (4B parameters, ChatML, có <think> scaffold)text-linear (text projection), adapter correct| Dataset | 250 ticket CSKH tiếng Việt → JSON triage (split seed 42) |
| Train / val | 225 / 25 (seed 42) |
max_length | 1024 (p95 thực = 98 token; 1024 để chừa headroom cho <think> trace dài) |
MASK_MODE | assistant-only — supervise cả block <think> lẫn JSON phía sau |
| Epochs / max_steps | 2 epochs / 30 optimizer steps |
| Optimizer / LR | AdamW, 1e-4 (chuẩn LoRA) |
| Run | target | regression | format | latency (ms) |
|---|---|---|---|---|
| (a) base + naive prompt | 0.000 | 0.758 | 0.000 | 3223.8 |
| (b) base + optimized prompt | 0.765 | 0.758 | 1.000 | 1016.5 |
| (c) LoRA fine-tune | 0.970 | 0.344 | 1.000 | 1443.4 |
Cổng bốn nhóm (target, regression, format, latency):
valid_trace_rate = 0.0 — sau khi train, model bỏ luôn block <think>
(dấu hiệu overfitting cục bộ).
Khuyến nghị từ deck §14.3: trộn 1–5 % dữ liệu replay
(data/eval_regression.jsonl) để giữ regression trong tolerance
trước khi deploy.
| Run | vị trí | r | trainable | LR | train loss | target | s | VRAM GB |
|---|---|---|---|---|---|---|---|---|
correct | text-linear | 16 | 32,464,896 | 1e-4 | 0.6259 | 0.97 | 955 | 12.01 |
attn_only | q,v | 283 (matched budget) | 32,456,704 | 1e-4 | 0.538 | 0.97 | 809 | 12.02 |
wrong_lr | text-linear | 16 | 32,464,896 | 1e-5 | 1.5704 | 0.00 | 949 | 12.01 |
qlora | text-linear | 16 | 32,464,896 | 1e-4 | 0.7058 | 0.94 | 1020 | 7.09 |
Bài học:
attn_only thắng train-loss nhưng
bằng correct trên target. Memorize ≠ generalize.6/50 ca eval target FT-thua (i ∈ {3, 5, 12, 39, 41, 46}) đều thua đúng
một trường: urgency, và thua theo cùng một cách — nhãn đúng là thap
nhưng model dự đoán trung_binh. Tất cả 6 ticket chứa cụm
"Khi nào tiện" ở cuối câu — đây là perfect predictor trong train
(35/250 mẫu, 100 % nhãn thap) nhưng model vẫn không học được quy tắc
này ở eval. Bias thống kê của SFT ít mẫu: model học prior
("chọn trung_binh khi không chắc") thay vì quy tắc cụ thể.
adapters/correct/ ← PEFT adapter (LoRA) — load bằng PeftModel.from_pretrained
├── adapter_model.safetensors (124 MB)
├── adapter_config.json
├── tokenizer.json / tokenizer_config.json
└── chat_template.jinja
results/ ← 8 file JSON + runs.csv (đầy đủ metrics)
submission/REPORT.md ← Report đầy đủ (tóm tắt ở trên)
README.md ← File này (model card)
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained(
"unsloth/Qwen3.5-4B",
torch_dtype="auto",
device_map="auto",
)
tok = AutoTokenizer.from_pretrained("angwindy/lab21-2A202601756-qwen35-triage-vi")
model = PeftModel.from_pretrained(
base,
"angwindy/lab21-2A202601756-qwen35-triage-vi",
subfolder="adapters/correct",
)
Adapter này không nên deploy ở trạng thái hiện tại. Target 0.97 là cải thiện có ý nghĩa, nhưng regression 0.34 là "thảm hoạ deployment" — model sẽ trả JSON sai schema khi khách hàng hỏi câu kiến thức phổ thông. Đòn bẩy thật sự là chất lượng dữ liệu (thêm replay 1–5 %), không phải vị trí adapter hay learning rate.
MSSV: 2A202601756 · Ngày nộp: 2026-08-22 · Tier: T4