Downloads · 30 days
14
13% of all-time downloads
flamehydra/lab21-2A202601156-qwen35-triage-vi
lab21-2A202601156-qwen35-triage-vi is a text classification model from flamehydra. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as apache-2.0.
Nguyễn Ngọc Hiệp · 2A202601156 — AICB-P2T3 Ngày 21 · Track 3. Báo cáo đầy đủ: submission/REPORT.md · mã nguồn: <https://github.com/nguyengochiep/K4-Track3-DAY21-2A202601156-NguyenNgocHiep
Downloads · 30 days
14
13% of all-time downloads
All-time downloads
108
Public
Repo size
43.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors43.3 MB · 100%
From the Hugging Face model README
Nguyễn Ngọc Hiệp · 2A202601156 — AICB-P2T3 Ngày 21 · Track 3.
Báo cáo đầy đủ: submission/REPORT.md · mã nguồn:
https://github.com/nguyengochiep/K4-Track3-DAY21-2A202601156-NguyenNgocHiep
LoRA adapter fine-tune Qwen/Qwen3.5-0.8B (tier CPU của lab, không phải 4B mặc định —
huấn luyện trên RTX 3050 Ti Laptop 4 GB) cho tác vụ: ticket CSKH tiếng Việt → JSON triage 4 trường
intent · urgency · product · sentiment.
Đo trên 50 mẫu target / 15 mẫu regression, greedy decode, baseline đóng băng trước khi train.
| target | regression | format | latency | |
|---|---|---|---|---|
| (a) base + prompt ngây thơ | 0.000 | 0.667 | 0.000 | 2058 ms |
| (b) base + prompt tối ưu | 0.495 | 0.667 | 1.000 | 585 ms |
| (c) adapter này | 0.985 | 0.033 | 1.000 | 753 ms |
Adapter thắng áp đảo ở tác vụ đích (target Δ +0.490, không thua mẫu nào trong 50) nhưng quên
thảm hoạ: năng lực phổ thông sụp từ 0.667 xuống 0.033, vượt 31 lần ngưỡng 0.020 của cổng hồi quy.
Hỏi nó viết một câu chúc sinh nhật, nó trả về {"intent": "hoi_thong_tin", ...}.
Đừng deploy adapter này cho lưu lượng hỗn hợp. Nguyên nhân nằm ở dữ liệu, không phải siêu tham
số: corpus chỉ có ticket trần → JSON, không có mẫu replay, nên model học rằng mọi input đều
nghĩa là "phát ra JSON triage". Khắc phục theo deck §14.3: trộn 1–5% dữ liệu phổ thông.
| run | thay đổi | train loss | target |
|---|---|---|---|
correct (adapter này) | — | 0.3956 | 0.985 |
attn_only | chỉ q,v, r=271 khớp ngân sách | 0.4333 | 0.935 |
qlora | 4-bit | 0.4247 | 0.930 |
wrong_lr | LR 1e-5 thay vì 1e-4 | 1.5418 | 0.330 |
Xếp hạng đòn bẩy: learning rate (−0.655) ≫ vị trí adapter (−0.050) ≈ lượng tử hoá (−0.055). Rank không có mặt — thiết kế đã cố định ngân sách tham số để loại nó khỏi phương trình.
r=16 · alpha=32 · dropout=0 · target_modules = toàn bộ linear của text decoder ·
lr=1e-4 · cosine · 10% warmup · effective batch 8 · 2 epoch (58 step) · bf16 ·
max_length=512 · mask assistant-only (37/94 token, đã kiểm chứng bằng giải mã ngược).
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
m = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-0.8B", dtype="auto", device_map="auto")
m = PeftModel.from_pretrained(m, "flamehydra/lab21-2A202601156-qwen35-triage-vi")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.5-0.8B")
msgs = [{"role": "system", "content": "Phân loại ticket sau."},
{"role": "user", "content": "Shop ơi, mình đặt bàn phím cơ mã đơn DH123456. Giao hàng chậm."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(m.device)
print(tok.decode(m.generate(ids, max_new_tokens=160, do_sample=False)[0][ids.shape[-1]:],
skip_special_tokens=True))
Prompt lúc suy luận phải khớp lúc huấn luyện: system "Phân loại ticket sau." + ticket trần
trong lượt user. Gửi hình dạng khác thì adapter không chuyển giao được.