aashish1904
commited on
Commit
•
2fffda3
1
Parent(s):
c2177aa
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
|
4 |
+
base_model: google/gemma-2-9b-it
|
5 |
+
tags:
|
6 |
+
- alignment-handbook
|
7 |
+
- generated_from_trainer
|
8 |
+
datasets:
|
9 |
+
- princeton-nlp/gemma2-ultrafeedback-armorm
|
10 |
+
model-index:
|
11 |
+
- name: princeton-nlp/gemma-2-9b-it-DPO
|
12 |
+
results: []
|
13 |
+
|
14 |
+
---
|
15 |
+
|
16 |
+
![](https://lh7-us.googleusercontent.com/docsz/AD_4nXfrlKyH6elkxeyrKw4el9j8V3IOQLsqTVngg19Akt6se1Eq2xaocCEjOmc1w8mq5ENHeYfpzRWjYB8D4mtmMPsiH7QyX_Ii1kEM7bk8eMzO68y9JEuDcoJxJBgbNDzRbTdVXylN9_zjrEposDwsoN7csKiD?key=xt3VSDoCbmTY7o-cwwOFwQ)
|
17 |
+
|
18 |
+
# QuantFactory/gemma-2-9b-it-DPO-GGUF
|
19 |
+
This is quantized version of [princeton-nlp/gemma-2-9b-it-DPO](https://huggingface.co/princeton-nlp/gemma-2-9b-it-DPO) created using llama.cpp
|
20 |
+
|
21 |
+
# Original Model Card
|
22 |
+
|
23 |
+
|
24 |
+
# gemma-2-9b-it-DPO Model Card
|
25 |
+
|
26 |
+
This model was trained under the same setup as [gemma-2-9b-it-SimPO](https://huggingface.co/princeton-nlp/gemma-2-9b-it-SimPO), with the DPO objective.
|
27 |
+
|
28 |
+
SimPO (Simple Preference Optimization) is an offline preference optimization algorithm designed to enhance the training of large language models (LLMs) with preference optimization datasets. SimPO aligns the reward function with the generation likelihood, eliminating the need for a reference model and incorporating a target reward margin to boost performance. Please refer to our [preprint](https://arxiv.org/pdf/2405.14734) and [github repo](https://github.com/princeton-nlp/SimPO) for more details.
|
29 |
+
|
30 |
+
## Model Details
|
31 |
+
|
32 |
+
### Model Description
|
33 |
+
|
34 |
+
We fine-tuned [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) on [princeton-nlp/gemma2-ultrafeedback-armorm](https://huggingface.co/datasets/princeton-nlp/gemma2-ultrafeedback-armorm) with the DPO objective.
|
35 |
+
|
36 |
+
- **Developed by:** Yu Meng, Mengzhou Xia, Danqi Chen
|
37 |
+
- **Model type:** Causal Language Model
|
38 |
+
- **License:** gemma
|
39 |
+
- **Finetuned from model:** [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it)
|
40 |
+
|
41 |
+
### Model Sources
|
42 |
+
|
43 |
+
<!-- Provide the basic links for the model. -->
|
44 |
+
|
45 |
+
- **Repository:** https://github.com/princeton-nlp/SimPO
|
46 |
+
- **Paper:** https://arxiv.org/pdf/2405.14734
|
47 |
+
|
48 |
+
|
49 |
+
## How to Get Started with the Model
|
50 |
+
```
|
51 |
+
import torch
|
52 |
+
from transformers import pipeline
|
53 |
+
|
54 |
+
model_id = "princeton-nlp/gemma-2-9b-it-DPO"
|
55 |
+
|
56 |
+
generator = pipeline(
|
57 |
+
"text-generation",
|
58 |
+
model=model_id,
|
59 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
60 |
+
device="cuda",
|
61 |
+
)
|
62 |
+
outputs = generator([{"role": "user", "content": "What's the difference between llamas and alpacas?"}], do_sample=False, max_new_tokens=200)
|
63 |
+
print(outputs[0]['generated_text'])
|
64 |
+
```
|
65 |
+
|
66 |
+
## Training Details
|
67 |
+
|
68 |
+
### Training Data
|
69 |
+
|
70 |
+
We use [princeton-nlp/gemma2-ultrafeedback-armorm](https://huggingface.co/datasets/princeton-nlp/gemma2-ultrafeedback-armorm) as the preference optimization dataset.
|
71 |
+
|
72 |
+
#### Training Hyperparameters
|
73 |
+
|
74 |
+
We used the following hyperparameters:
|
75 |
+
- learning rate: 5e-7
|
76 |
+
- batch size: 128
|
77 |
+
- beta: 0.01
|
78 |
+
|
79 |
+
The other hyperparameters are kept the same with our [SimPO recipe](https://github.com/princeton-nlp/SimPO/blob/main/training_configs/gemma-2-9b-it-simpo.yaml).
|
80 |
+
|
81 |
+
#### Speeds, Sizes, Times
|
82 |
+
|
83 |
+
Fine-tuning the [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) on [princeton-nlp/gemma2-ultrafeedback-armorm](https://huggingface.co/datasets/princeton-nlp/gemma2-ultrafeedback-armorm) takes around 150 mins to finish on 8xH100 GPUs.
|
84 |
+
|
85 |
+
## Evaluation Results
|
86 |
+
|
87 |
+
|
88 |
+
| models | AE2 LC | AE2 WR | AE2 Length | AH | AH Length | GSM | GSM Length | MMLU | MMLU Length |
|
89 |
+
|-----------------------------------|:------:|:------:|:----------:|:----:|:---------:|:----:|:----------:|:----:|:-----------:|
|
90 |
+
| [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) | 51.1 | 38.1 | 1571 | 40.8 | 545 | 87.4 | 395 | 72.7 | 515 |
|
91 |
+
| [princeton-nlp/gemma-2-9b-it-DPO](https://huggingface.co/princeton-nlp/gemma-2-9b-it-DPO) | 67.8 | 65.4 | 2016 | 58.9 | 717 | 88.5 | 392 | 72.2 | 624 |
|
92 |
+
| [princeton-nlp/gemma-2-9b-it-SimPO](https://huggingface.co/princeton-nlp/gemma-2-9b-it-SimPO) | 72.4 | 65.9 | 1833 | 59.1 | 693 | 88.0 | 341 | 72.2 | 441 |
|
93 |
+
|
94 |
+
|
95 |
+
## Technical Specifications
|
96 |
+
|
97 |
+
### Model Architecture and Objective
|
98 |
+
|
99 |
+
The model architecture is based on [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it). We use the DPO training objective.
|
100 |
+
|
101 |
+
#### Hardware
|
102 |
+
|
103 |
+
We used 8xH100 GPUs for model training.
|
104 |
+
|
105 |
+
#### Software
|
106 |
+
|
107 |
+
Training was done using the [alignment-handbook](https://github.com/huggingface/alignment-handbook) library.
|
108 |
+
|
109 |
+
## Citation
|
110 |
+
|
111 |
+
gemma model:
|
112 |
+
```
|
113 |
+
@article{gemma_2024,
|
114 |
+
title={Gemma},
|
115 |
+
url={https://www.kaggle.com/m/3301},
|
116 |
+
DOI={10.34740/KAGGLE/M/3301},
|
117 |
+
publisher={Kaggle},
|
118 |
+
author={Gemma Team},
|
119 |
+
year={2024}
|
120 |
+
}
|
121 |
+
```
|
122 |
+
|
123 |
+
DPO paper:
|
124 |
+
```
|
125 |
+
@article{rafailov2024direct,
|
126 |
+
title={Direct Preference Optimization: Your language model is secretly a reward model},
|
127 |
+
author={Rafailov, Rafael and Sharma, Archit and Mitchell, Eric and Manning, Christopher D and Ermon, Stefano and Finn, Chelsea},
|
128 |
+
journal={Advances in Neural Information Processing Systems},
|
129 |
+
volume={36},
|
130 |
+
year={2024}
|
131 |
+
}
|
132 |
+
```
|
133 |
+
|
134 |
+
SimPO paper:
|
135 |
+
```
|
136 |
+
@article{meng2024simpo,
|
137 |
+
title={{SimPO}: Simple preference optimization with a reference-free reward},
|
138 |
+
author={Meng, Yu and Xia, Mengzhou and Chen, Danqi},
|
139 |
+
journal={arXiv preprint arXiv:2405.14734},
|
140 |
+
year={2024}
|
141 |
+
}
|
142 |
+
```
|
143 |
+
|
144 |
+
UltraFeedback paper:
|
145 |
+
```
|
146 |
+
@article{cui2023ultrafeedback,
|
147 |
+
title={{UltraFeedback}: Boosting language models with high-quality feedback},
|
148 |
+
author={Cui, Ganqu and Yuan, Lifan and Ding, Ning and Yao, Guanming and Zhu, Wei and Ni, Yuan and Xie, Guotong and Liu, Zhiyuan and Sun, Maosong},
|
149 |
+
journal={arXiv preprint arXiv:2310.01377},
|
150 |
+
year={2023}
|
151 |
+
}
|
152 |
+
```
|
153 |
+
|
154 |
+
ArmoRM paper:
|
155 |
+
```
|
156 |
+
@article{wang2024interpretable,
|
157 |
+
title={Interpretable Preferences via Multi-Objective Reward Modeling and Mixture-of-Experts},
|
158 |
+
author={Wang, Haoxiang and Xiong, Wei and Xie, Tengyang and Zhao, Han and Zhang, Tong},
|
159 |
+
journal={arXiv preprint arXiv:2406.12845},
|
160 |
+
year={2024}
|
161 |
+
}
|
162 |
+
```
|