Views
No views yet
Qwen/Qwen1.5-0.5B-Chat, trained with Direct Preference Optimization (DPO) and QLoRA as a resource-efficient alternative to standard RLHF.Qwen/Qwen1.5-0.5B-Chattrl's DPOTrainer, with a LoRA adapter (r=64, alpha=128) over the attention and MLP projection layers, trained in 4-bit (QLoRA, via bitsandbytes)Anthropic/hh-rlhf, Intel/orca_dpo_pairs, and Dahoas/full-hh-rlhf; the DPO run itself trained on a 1,224-example subsample (307 held out for evaluation), given the compute budgetQwen/Qwen2.5-3B-Instruct, chain-of-thought reasoning) on the held-out test set:| Metric | Base model | DPO + QLoRA fine-tuned | Δ |
|---|---|---|---|
| Safe rate | 86.64% | 87.95% | +1.31 pp |
| Over-refusal rate | 13.96% | 11.70% | −2.26 pp (lower is better) |
| Helpfulness rate | 84.91% | 87.17% | +2.26 pp |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "kevinchen70632/Qwen1.5-0.5B-Chat-fine-tuned"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
6
7messages = [{"role": "user", "content": "How do I safely store household chemicals?"}]
8inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
9output = model.generate(inputs, max_new_tokens=256)
10print(tokenizer.decode(output[0], skip_special_tokens=True))Qwen/Qwen1.5-0.5B-Chat.