Downloads · 30 days
7
14% of all-time downloads
sxsun1684/dpo-llama3-lora-pairrm
dpo-llama3-lora-pairrm is a text generation model from sxsun1684. Use it when you need the model to write or continue text. It is set up for transformers.
This document summarizes the process and configuration used to fine-tune the LLaMA 3.2 1B model using the PairRM preference dataset through Direct Preference Optimization (DPO) and PEFT (LoRA).
Downloads · 30 days
7
14% of all-time downloads
All-time downloads
49
Public
Parameters
1.2B
9.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.9 GB · 100%
From the Hugging Face model README
sxsun1684/dpo-llama3-lora-pairrmThis document summarizes the process and configuration used to fine-tune the LLaMA 3.2 1B model using the PairRM preference dataset through Direct Preference Optimization (DPO) and PEFT (LoRA).
To improve the model's alignment with human preferences by fine-tuning it on pairwise preference data (chosen vs rejected responses) using DPO, leveraging PairRM-generated labels.
sxsun1684/pairrm-lima50-preferencesprompt: the instruction/querychosen: the preferred responserejected: the less preferred responsemeta-llama/Llama-3.2-1BLoraConfig(
r=8,
lora_alpha=16,
bias="none",
task_type="CAUSAL_LM"
)
DPOConfig(
beta=0.1,
learning_rate=2e-5,
per_device_train_batch_size=1,
gradient_accumulation_steps=8, # effective batch size = 8
num_train_epochs=3,
max_length=512,
save_strategy="epoch",
logging_steps=10,
push_to_hub=False,
report_to="none",
padding_value=tokenizer.pad_token_id
)
prompt, chosen, and rejected was tokenized separately.max_length with EOS as pad tokenDPOTrainer from trl==0.16.1sxsun1684/dpo-llama3-lora-pairrmYou can load and use the model with:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("sxsun1684/dpo-llama3-lora-pairrm")
tokenizer = AutoTokenizer.from_pretrained("sxsun1684/dpo-llama3-lora-pairrm")
SX Sun (sxsun1684)
2025-04