Downloads · 30 days
36
34% of all-time downloads
hiepphambk/lab22-dpo-vn
lab22-dpo-vn is a text generation model from hiepphambk. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Vietnamese-aligned model produced by VinUniversity AICB Day-22 lab (Track 3 — DPO/ORPO Alignment).
Downloads · 30 days
36
34% of all-time downloads
All-time downloads
105
Public
Repo size
2.1 GB
Likes
0
Public
Click a slice to open those files.
.gguf1.9 GB · 93%
From the Hugging Face model README
Vietnamese-aligned model produced by VinUniversity AICB Day-22 lab (Track 3 — DPO/ORPO Alignment).
Pipeline: SFT (1k VN Alpaca) → DPO (2k UltraFeedback, β=0.1, lr=5e-7) on top of unsloth/Qwen2.5-3B-bnb-4bit.
adapter_config.json + adapter_model.safetensors — DPO LoRA (rank=16, α=32). Stack on top of the base + SFT-mini adapter.lab22-dpo-Q4_K_M.gguf — merged + quantized GGUF for llama.cpp / llama-cpp-python deployment (~1.9 GB).from llama_cpp import Llama
llm = Llama(model_path="lab22-dpo-Q4_K_M.gguf", n_ctx=512)
print(llm.create_chat_completion(messages=[{"role": "user", "content": "Giải thích quicksort."}])
["choices"][0]["message"]["content"])
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B")
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B", torch_dtype="bfloat16", device_map="cuda")
model = PeftModel.from_pretrained(base, "hiepphambk/lab22-dpo-vn") # this DPO adapter
| Hyperparameter | Value |
|---|---|
| Base | unsloth/Qwen2.5-3B-bnb-4bit (4-bit NF4) |
| LoRA rank · α | 16 · 32 |
| LoRA target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| DPO β | 0.1 |
| Learning rate | 5e-7 |
| Optimizer | adamw_8bit |
| Effective batch | 1 × 8 grad-accum = 8 |
| Epochs | 1 |
| Max seq length | 512 |
| Compute | RTX 5070 12 GB (Blackwell sm_120, CUDA 12.8) |
| Metric | SFT-only | SFT+DPO |
|---|---|---|
| Reward gap (chosen − rejected, end of training) | n/a | +0.114 |
| Final DPO loss | n/a | 0.798 |
| AlpacaEval-lite (50 prompts, gpt-4o-mini judge) | 0.50 | 0.47 |
| Manual eval (8 VN prompts, judge gpt-4o-mini) | 2/8 wins | 5/8 wins (62.5%) |
See full report (incl. reward curves analysis, alignment-tax interpretation, and W&B run link) in the lab repo.
Trained by Phạm Hữu Hoàng Hiệp (MSSV 2A202600415).