第二輪 LoRA 微調的對照組,使用教學組以 GPT-4o 抽取的 traffic_law_mar_gpt4o_train/val
資料集(2026 年 3 月版),對
yentinglin/Llama-3-Taiwan-8B-Instruct-rc2
進行微調。輸出為較長的 JSON 格式,適用法條範圍較廣(未經過濾)、核心爭議為
自由生成的句子(無封閉標籤)。
yentinglin/Llama-3-Taiwan-8B-Instruct-rc2traffic_law_mar_gpt4o_train / traffic_law_mar_gpt4o_vallora_target=all, rank=16, alpha=32, dropout=0.05| 指標 | 數值 |
|---|---|
| 責任類型 accuracy | 1.0 |
| 適用法條 F1 | 0.701 (precision 0.753 / recall 0.694) |
核心爭議為自由生成句子,無封閉 ground truth,因此不計算 F1。
詳細逐案分析見 repo 內 report.md 第八章與 eval/eval_summary.json。
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "yentinglin/Llama-3-Taiwan-8B-Instruct-rc2"
adapter_id = "traffic-legal-lm/round2-gpt4o-baseline-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)
更完整的處理流程、資料集與評估說明請見專案 repo: Traffic_Legal_LM
第二輪 LoRA 微調的對照組,使用教學組以 GPT-4o 抽取的 traffic_law_mar_gpt4o_train/val
資料集(2026 年 3 月版),對
yentinglin/Llama-3-Taiwan-8B-Instruct-rc2
進行微調。輸出為較長的 JSON 格式,適用法條範圍較廣(未經過濾)、核心爭議為
自由生成的句子(無封閉標籤)。
yentinglin/Llama-3-Taiwan-8B-Instruct-rc2traffic_law_mar_gpt4o_train / traffic_law_mar_gpt4o_vallora_target=all, rank=16, alpha=32, dropout=0.05| 指標 | 數值 |
|---|---|
| 責任類型 accuracy | 1.0 |
| 適用法條 F1 | 0.701 (precision 0.753 / recall 0.694) |
核心爭議為自由生成句子,無封閉 ground truth,因此不計算 F1。
詳細逐案分析見 repo 內 report.md 第八章與 eval/eval_summary.json。
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "yentinglin/Llama-3-Taiwan-8B-Instruct-rc2"
adapter_id = "traffic-legal-lm/round2-gpt4o-baseline-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)
更完整的處理流程、資料集與評估說明請見專案 repo: Traffic_Legal_LM