Model save
Browse files- README.md +68 -0
- all_results.json +9 -0
- generation_config.json +12 -0
- train_results.json +9 -0
- trainer_state.json +237 -0
README.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: meta-llama/Llama-3.2-3B-Instruct
|
3 |
+
library_name: transformers
|
4 |
+
model_name: Llama-3.2-3B-Instruct-cot-23-11
|
5 |
+
tags:
|
6 |
+
- generated_from_trainer
|
7 |
+
- trl
|
8 |
+
- dpo
|
9 |
+
licence: license
|
10 |
+
---
|
11 |
+
|
12 |
+
# Model Card for Llama-3.2-3B-Instruct-cot-23-11
|
13 |
+
|
14 |
+
This model is a fine-tuned version of [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct).
|
15 |
+
It has been trained using [TRL](https://github.com/huggingface/trl).
|
16 |
+
|
17 |
+
## Quick start
|
18 |
+
|
19 |
+
```python
|
20 |
+
from transformers import pipeline
|
21 |
+
|
22 |
+
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
23 |
+
generator = pipeline("text-generation", model="Rudra-ai/Llama-3.2-3B-Instruct-cot-23-11", device="cuda")
|
24 |
+
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
25 |
+
print(output["generated_text"])
|
26 |
+
```
|
27 |
+
|
28 |
+
## Training procedure
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
|
33 |
+
|
34 |
+
### Framework versions
|
35 |
+
|
36 |
+
- TRL: 0.12.1
|
37 |
+
- Transformers: 4.46.1
|
38 |
+
- Pytorch: 2.4.1+cu124
|
39 |
+
- Datasets: 3.1.0
|
40 |
+
- Tokenizers: 0.20.3
|
41 |
+
|
42 |
+
## Citations
|
43 |
+
|
44 |
+
Cite DPO as:
|
45 |
+
|
46 |
+
```bibtex
|
47 |
+
@inproceedings{rafailov2023direct,
|
48 |
+
title = {{Direct Preference Optimization: Your Language Model is Secretly a Reward Model}},
|
49 |
+
author = {Rafael Rafailov and Archit Sharma and Eric Mitchell and Christopher D. Manning and Stefano Ermon and Chelsea Finn},
|
50 |
+
year = 2023,
|
51 |
+
booktitle = {Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023},
|
52 |
+
url = {http://papers.nips.cc/paper_files/paper/2023/hash/a85b405ed65c6477a4fe8302b5e06ce7-Abstract-Conference.html},
|
53 |
+
editor = {Alice Oh and Tristan Naumann and Amir Globerson and Kate Saenko and Moritz Hardt and Sergey Levine},
|
54 |
+
}
|
55 |
+
```
|
56 |
+
|
57 |
+
Cite TRL as:
|
58 |
+
|
59 |
+
```bibtex
|
60 |
+
@misc{vonwerra2022trl,
|
61 |
+
title = {{TRL: Transformer Reinforcement Learning}},
|
62 |
+
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
|
63 |
+
year = 2020,
|
64 |
+
journal = {GitHub repository},
|
65 |
+
publisher = {GitHub},
|
66 |
+
howpublished = {\url{https://github.com/huggingface/trl}}
|
67 |
+
}
|
68 |
+
```
|
all_results.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 1.0,
|
3 |
+
"total_flos": 0.0,
|
4 |
+
"train_loss": 0.08870122274137147,
|
5 |
+
"train_runtime": 1811.5821,
|
6 |
+
"train_samples": 2000,
|
7 |
+
"train_samples_per_second": 1.104,
|
8 |
+
"train_steps_per_second": 0.069
|
9 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 128000,
|
3 |
+
"do_sample": true,
|
4 |
+
"eos_token_id": [
|
5 |
+
128001,
|
6 |
+
128008,
|
7 |
+
128009
|
8 |
+
],
|
9 |
+
"temperature": 0.6,
|
10 |
+
"top_p": 0.9,
|
11 |
+
"transformers_version": "4.46.1"
|
12 |
+
}
|
train_results.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 1.0,
|
3 |
+
"total_flos": 0.0,
|
4 |
+
"train_loss": 0.08870122274137147,
|
5 |
+
"train_runtime": 1811.5821,
|
6 |
+
"train_samples": 2000,
|
7 |
+
"train_samples_per_second": 1.104,
|
8 |
+
"train_steps_per_second": 0.069
|
9 |
+
}
|
trainer_state.json
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": null,
|
3 |
+
"best_model_checkpoint": null,
|
4 |
+
"epoch": 1.0,
|
5 |
+
"eval_steps": 500,
|
6 |
+
"global_step": 125,
|
7 |
+
"is_hyper_param_search": false,
|
8 |
+
"is_local_process_zero": true,
|
9 |
+
"is_world_process_zero": true,
|
10 |
+
"log_history": [
|
11 |
+
{
|
12 |
+
"epoch": 0.008,
|
13 |
+
"grad_norm": 477.2496337890625,
|
14 |
+
"learning_rate": 7.692307692307694e-07,
|
15 |
+
"logits/chosen": 2.15625,
|
16 |
+
"logits/rejected": 1.4375,
|
17 |
+
"logps/chosen": -146.0,
|
18 |
+
"logps/rejected": -131.0,
|
19 |
+
"loss": 2.7656,
|
20 |
+
"rewards/accuracies": 0.0,
|
21 |
+
"rewards/chosen": 0.0,
|
22 |
+
"rewards/margins": 0.0,
|
23 |
+
"rewards/rejected": 0.0,
|
24 |
+
"step": 1
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.08,
|
28 |
+
"grad_norm": 1.534887996967882e-05,
|
29 |
+
"learning_rate": 7.692307692307694e-06,
|
30 |
+
"logits/chosen": 1.8359375,
|
31 |
+
"logits/rejected": 1.1328125,
|
32 |
+
"logps/chosen": -125.0,
|
33 |
+
"logps/rejected": -187.0,
|
34 |
+
"loss": 0.9163,
|
35 |
+
"rewards/accuracies": 0.8055555820465088,
|
36 |
+
"rewards/chosen": 1.46875,
|
37 |
+
"rewards/margins": 8.3125,
|
38 |
+
"rewards/rejected": -6.84375,
|
39 |
+
"step": 10
|
40 |
+
},
|
41 |
+
{
|
42 |
+
"epoch": 0.16,
|
43 |
+
"grad_norm": 6.47921126473161e-12,
|
44 |
+
"learning_rate": 9.903926402016153e-06,
|
45 |
+
"logits/chosen": 0.3828125,
|
46 |
+
"logits/rejected": 0.357421875,
|
47 |
+
"logps/chosen": -160.0,
|
48 |
+
"logps/rejected": -540.0,
|
49 |
+
"loss": 0.0,
|
50 |
+
"rewards/accuracies": 1.0,
|
51 |
+
"rewards/chosen": -2.921875,
|
52 |
+
"rewards/margins": 39.25,
|
53 |
+
"rewards/rejected": -42.25,
|
54 |
+
"step": 20
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"epoch": 0.24,
|
58 |
+
"grad_norm": 5.994430991895002e-15,
|
59 |
+
"learning_rate": 9.442228179894362e-06,
|
60 |
+
"logits/chosen": -0.060791015625,
|
61 |
+
"logits/rejected": -0.28515625,
|
62 |
+
"logps/chosen": -264.0,
|
63 |
+
"logps/rejected": -728.0,
|
64 |
+
"loss": 0.0075,
|
65 |
+
"rewards/accuracies": 1.0,
|
66 |
+
"rewards/chosen": -13.9375,
|
67 |
+
"rewards/margins": 47.25,
|
68 |
+
"rewards/rejected": -61.25,
|
69 |
+
"step": 30
|
70 |
+
},
|
71 |
+
{
|
72 |
+
"epoch": 0.32,
|
73 |
+
"grad_norm": 5.643975006320093e-14,
|
74 |
+
"learning_rate": 8.633301610170136e-06,
|
75 |
+
"logits/chosen": 1.0703125,
|
76 |
+
"logits/rejected": 0.59375,
|
77 |
+
"logps/chosen": -164.0,
|
78 |
+
"logps/rejected": -740.0,
|
79 |
+
"loss": 0.0,
|
80 |
+
"rewards/accuracies": 1.0,
|
81 |
+
"rewards/chosen": -2.609375,
|
82 |
+
"rewards/margins": 59.25,
|
83 |
+
"rewards/rejected": -62.0,
|
84 |
+
"step": 40
|
85 |
+
},
|
86 |
+
{
|
87 |
+
"epoch": 0.4,
|
88 |
+
"grad_norm": 2.0163520159099946e-11,
|
89 |
+
"learning_rate": 7.540376726232648e-06,
|
90 |
+
"logits/chosen": 1.234375,
|
91 |
+
"logits/rejected": 0.6640625,
|
92 |
+
"logps/chosen": -130.0,
|
93 |
+
"logps/rejected": -636.0,
|
94 |
+
"loss": 0.0,
|
95 |
+
"rewards/accuracies": 1.0,
|
96 |
+
"rewards/chosen": -1.015625,
|
97 |
+
"rewards/margins": 52.0,
|
98 |
+
"rewards/rejected": -53.0,
|
99 |
+
"step": 50
|
100 |
+
},
|
101 |
+
{
|
102 |
+
"epoch": 0.48,
|
103 |
+
"grad_norm": 4.786671276360566e-15,
|
104 |
+
"learning_rate": 6.248882390836135e-06,
|
105 |
+
"logits/chosen": 1.359375,
|
106 |
+
"logits/rejected": 0.78515625,
|
107 |
+
"logps/chosen": -146.0,
|
108 |
+
"logps/rejected": -660.0,
|
109 |
+
"loss": 0.0,
|
110 |
+
"rewards/accuracies": 1.0,
|
111 |
+
"rewards/chosen": -1.71875,
|
112 |
+
"rewards/margins": 52.5,
|
113 |
+
"rewards/rejected": -54.0,
|
114 |
+
"step": 60
|
115 |
+
},
|
116 |
+
{
|
117 |
+
"epoch": 0.56,
|
118 |
+
"grad_norm": 1.9845672956549099e-13,
|
119 |
+
"learning_rate": 4.859768718620656e-06,
|
120 |
+
"logits/chosen": 1.359375,
|
121 |
+
"logits/rejected": 0.83984375,
|
122 |
+
"logps/chosen": -150.0,
|
123 |
+
"logps/rejected": -640.0,
|
124 |
+
"loss": 0.0,
|
125 |
+
"rewards/accuracies": 1.0,
|
126 |
+
"rewards/chosen": -0.58203125,
|
127 |
+
"rewards/margins": 52.0,
|
128 |
+
"rewards/rejected": -52.5,
|
129 |
+
"step": 70
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 0.64,
|
133 |
+
"grad_norm": 3.1451468355701492e-15,
|
134 |
+
"learning_rate": 3.4816162744519266e-06,
|
135 |
+
"logits/chosen": 1.3125,
|
136 |
+
"logits/rejected": 0.73828125,
|
137 |
+
"logps/chosen": -149.0,
|
138 |
+
"logps/rejected": -688.0,
|
139 |
+
"loss": 0.0,
|
140 |
+
"rewards/accuracies": 1.0,
|
141 |
+
"rewards/chosen": -0.97265625,
|
142 |
+
"rewards/margins": 55.75,
|
143 |
+
"rewards/rejected": -56.75,
|
144 |
+
"step": 80
|
145 |
+
},
|
146 |
+
{
|
147 |
+
"epoch": 0.72,
|
148 |
+
"grad_norm": 1.8802392639811344e-13,
|
149 |
+
"learning_rate": 2.2221488349019903e-06,
|
150 |
+
"logits/chosen": 1.3359375,
|
151 |
+
"logits/rejected": 0.79296875,
|
152 |
+
"logps/chosen": -144.0,
|
153 |
+
"logps/rejected": -680.0,
|
154 |
+
"loss": 0.0,
|
155 |
+
"rewards/accuracies": 1.0,
|
156 |
+
"rewards/chosen": -1.796875,
|
157 |
+
"rewards/margins": 54.5,
|
158 |
+
"rewards/rejected": -56.25,
|
159 |
+
"step": 90
|
160 |
+
},
|
161 |
+
{
|
162 |
+
"epoch": 0.8,
|
163 |
+
"grad_norm": 2.8757966674675117e-07,
|
164 |
+
"learning_rate": 1.1798131208919628e-06,
|
165 |
+
"logits/chosen": 1.359375,
|
166 |
+
"logits/rejected": 0.76171875,
|
167 |
+
"logps/chosen": -150.0,
|
168 |
+
"logps/rejected": -632.0,
|
169 |
+
"loss": 0.0,
|
170 |
+
"rewards/accuracies": 1.0,
|
171 |
+
"rewards/chosen": -1.4453125,
|
172 |
+
"rewards/margins": 49.75,
|
173 |
+
"rewards/rejected": -51.25,
|
174 |
+
"step": 100
|
175 |
+
},
|
176 |
+
{
|
177 |
+
"epoch": 0.88,
|
178 |
+
"grad_norm": 1.703149137021777e-14,
|
179 |
+
"learning_rate": 4.3608367469340553e-07,
|
180 |
+
"logits/chosen": 1.34375,
|
181 |
+
"logits/rejected": 0.7734375,
|
182 |
+
"logps/chosen": -153.0,
|
183 |
+
"logps/rejected": -628.0,
|
184 |
+
"loss": 0.0,
|
185 |
+
"rewards/accuracies": 1.0,
|
186 |
+
"rewards/chosen": -2.078125,
|
187 |
+
"rewards/margins": 50.0,
|
188 |
+
"rewards/rejected": -52.0,
|
189 |
+
"step": 110
|
190 |
+
},
|
191 |
+
{
|
192 |
+
"epoch": 0.96,
|
193 |
+
"grad_norm": 7.835807033238558e-16,
|
194 |
+
"learning_rate": 4.909437331777178e-08,
|
195 |
+
"logits/chosen": 1.3515625,
|
196 |
+
"logits/rejected": 0.7734375,
|
197 |
+
"logps/chosen": -144.0,
|
198 |
+
"logps/rejected": -676.0,
|
199 |
+
"loss": 0.0,
|
200 |
+
"rewards/accuracies": 1.0,
|
201 |
+
"rewards/chosen": -1.203125,
|
202 |
+
"rewards/margins": 54.0,
|
203 |
+
"rewards/rejected": -55.25,
|
204 |
+
"step": 120
|
205 |
+
},
|
206 |
+
{
|
207 |
+
"epoch": 1.0,
|
208 |
+
"step": 125,
|
209 |
+
"total_flos": 0.0,
|
210 |
+
"train_loss": 0.08870122274137147,
|
211 |
+
"train_runtime": 1811.5821,
|
212 |
+
"train_samples_per_second": 1.104,
|
213 |
+
"train_steps_per_second": 0.069
|
214 |
+
}
|
215 |
+
],
|
216 |
+
"logging_steps": 10,
|
217 |
+
"max_steps": 125,
|
218 |
+
"num_input_tokens_seen": 0,
|
219 |
+
"num_train_epochs": 1,
|
220 |
+
"save_steps": 200,
|
221 |
+
"stateful_callbacks": {
|
222 |
+
"TrainerControl": {
|
223 |
+
"args": {
|
224 |
+
"should_epoch_stop": false,
|
225 |
+
"should_evaluate": false,
|
226 |
+
"should_log": false,
|
227 |
+
"should_save": true,
|
228 |
+
"should_training_stop": true
|
229 |
+
},
|
230 |
+
"attributes": {}
|
231 |
+
}
|
232 |
+
},
|
233 |
+
"total_flos": 0.0,
|
234 |
+
"train_batch_size": 1,
|
235 |
+
"trial_name": null,
|
236 |
+
"trial_params": null
|
237 |
+
}
|