VLegal-Bench: Cognitively Grounded Benchmark for Vietnamese Legal Reasoning of Large Language Models
Paper • 2512.14554 • Published • 1
A Vietnamese Legal SLM fine-tuned from Qwen/Qwen3-1.7B on the VLegal-Bench dataset using QLoRA.
| Metric | Value |
|---|---|
| loss (epoch 1) | 0.7695 |
| runtime (epoch 1) | 379.3660 |
| samples_per_second (epoch 1) | 3.2290 |
| steps_per_second (epoch 1) | 0.8090 |
| loss (epoch 2) | 0.7558 |
| runtime (epoch 2) | 378.9926 |
| samples_per_second (epoch 2) | 3.2320 |
| steps_per_second (epoch 2) | 0.8100 |
| loss (epoch 3) | 0.7640 |
| runtime (epoch 3) | 380.5886 |
| samples_per_second (epoch 3) | 3.2190 |
| steps_per_second (epoch 3) | 0.8070 |
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-1.7B |
| Dataset | legal-combined (11025 train / 1225 eval) |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| Learning rate | 0.0002 |
| Epochs | 3 |
| Batch size | 4 x 4 (effective: 16) |
| Precision | fp16 |
| Max seq length | 2048 |
| Training time | 8h 54m |
| Best epoch | 2 |
| Hardware | Kaggle T4 (16GB VRAM) |
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "datht/viet-legal-1.7B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
messages = [
{"role": "system", "content": "Bạn là một trợ lý pháp luật Việt Nam."},
{"role": "user", "content": "Hành vi trộm cắp tài sản trị giá 5 triệu đồng bị xử lý như thế nào?"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
VLegal-Bench — A cognitively grounded benchmark for Vietnamese legal reasoning, comprising 10,467 samples across 22 tasks organized into 5 categories:
Trained with nlp-trainer using Unsloth + TRL SFTTrainer with QLoRA on Kaggle T4 GPU.
@misc{dong2025vlegalbench,
title={VLegal-Bench: Cognitively Grounded Benchmark for Vietnamese Legal Reasoning of Large Language Models},
author={Nguyen Tien Dong and others},
year={2025},
eprint={2512.14554},
archivePrefix={arXiv},
}