Downloads · 30 days
7
16% of all-time downloads
DhruvParth/Mistral-7B-Instruct-v0.2-DPO-v0.1
Mistral-7B-Instruct-v0.2-DPO-v0.1 is a text generation model from DhruvParth. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model is a fine-tuned version of the Mistral-7B model, utilizing Direct Preference Optimization (DPO) to better align the model's responses with human preferences, specifically in a causal language modeling context.
Downloads · 30 days
7
16% of all-time downloads
All-time downloads
44
Public
Parameters
7.2B
14.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of the Mistral-7B model, utilizing Direct Preference Optimization (DPO) to better align the model's responses with human preferences, specifically in a causal language modeling context.
This model is tailored for scenarios requiring alignment with human preferences in automated responses, suitable for applications in personalized chatbots, customer support, and other interactive services.
The fine-tuning process and the experiments were documented in a Jupyter Notebook, available here.
LoraConfig(
r=8,
lora_alpha=8,
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM",
target_modules=['k_proj', 'v_proj', 'q_proj', 'dense']
)
BitsAndBytesConfig(
load_in_4bit=True,
llm_int8_threshold=6.0,
llm_int8_has_fp16_weight=False,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
)
device_map = {"": 0}
DPOConfig(
per_device_train_batch_size=2,
gradient_accumulation_steps=4,
gradient_checkpointing=True,
learning_rate=5e-5,
lr_scheduler_type="cosine",
max_steps=50,
save_strategy="no",
logging_steps=1,
output_dir=new_model,
optim="paged_adamw_32bit",
warmup_steps=5,
)
DPOTrainer(
model,
args=training_args,
train_dataset=updated_train_dataset,
tokenizer=tokenizer,
peft_config=peft_config,
beta=0.1,
max_prompt_length=512,
max_length=1024,
)
Details on the model's performance, evaluation protocols, and results will be provided as they become available.
If you use this model or dataset, please cite it as follows:
BibTeX:
@misc{dhruvparth_mistral7b_dpo_2024,
author = {Dhruv Parthasarathy},
title = {Fine-tuning LLMs with Direct Preference Optimization},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://huggingface.co/DhruvParth/Mistral-7B-Instruct-v2.0-PairRM-DPO}
}
APA: Dhruv Parthasarathy. (2024). Fine-tuning LLMs with Direct Preference Optimization. GitHub repository, https://huggingface.co/DhruvParth/Mistral-7B-Instruct-v2.0-PairRM-DPO
For any queries or discussions regarding the project, please open an issue in the GitHub repository, post your comment in the community section, reach out to me via LinkedIn (https://www.linkedin.com/in/parthadhruv/) or contact me directly at [email protected].