jkazdan commited on
Commit
dc524ba
·
verified ·
1 Parent(s): 643206f

Model save

Browse files
README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: jkazdan/llama3-8b-stage-2
3
+ library_name: transformers
4
+ model_name: llama-8b-dpo-full-1
5
+ tags:
6
+ - generated_from_trainer
7
+ - trl
8
+ - dpo
9
+ licence: license
10
+ ---
11
+
12
+ # Model Card for llama-8b-dpo-full-1
13
+
14
+ This model is a fine-tuned version of [jkazdan/llama3-8b-stage-2](https://huggingface.co/jkazdan/llama3-8b-stage-2).
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="jkazdan/llama-8b-dpo-full-1", 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
+
33
+ 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).
34
+
35
+ ### Framework versions
36
+
37
+ - TRL: 0.15.2
38
+ - Transformers: 4.49.0
39
+ - Pytorch: 2.6.0
40
+ - Datasets: 3.3.2
41
+ - Tokenizers: 0.21.0
42
+
43
+ ## Citations
44
+
45
+ Cite DPO as:
46
+
47
+ ```bibtex
48
+ @inproceedings{rafailov2023direct,
49
+ title = {{Direct Preference Optimization: Your Language Model is Secretly a Reward Model}},
50
+ author = {Rafael Rafailov and Archit Sharma and Eric Mitchell and Christopher D. Manning and Stefano Ermon and Chelsea Finn},
51
+ year = 2023,
52
+ 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},
53
+ url = {http://papers.nips.cc/paper_files/paper/2023/hash/a85b405ed65c6477a4fe8302b5e06ce7-Abstract-Conference.html},
54
+ editor = {Alice Oh and Tristan Naumann and Amir Globerson and Kate Saenko and Moritz Hardt and Sergey Levine},
55
+ }
56
+ ```
57
+
58
+ Cite TRL as:
59
+
60
+ ```bibtex
61
+ @misc{vonwerra2022trl,
62
+ title = {{TRL: Transformer Reinforcement Learning}},
63
+ 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},
64
+ year = 2020,
65
+ journal = {GitHub repository},
66
+ publisher = {GitHub},
67
+ howpublished = {\url{https://github.com/huggingface/trl}}
68
+ }
69
+ ```
all_results.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 1.0,
3
+ "total_flos": 0.0,
4
+ "train_loss": 0.685900236430921,
5
+ "train_runtime": 550.0055,
6
+ "train_samples": 4840,
7
+ "train_samples_per_second": 8.8,
8
+ "train_steps_per_second": 0.069
9
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 128000,
3
+ "do_sample": true,
4
+ "eos_token_id": 128001,
5
+ "max_length": 4096,
6
+ "temperature": 0.6,
7
+ "top_p": 0.9,
8
+ "transformers_version": "4.49.0"
9
+ }
train_results.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 1.0,
3
+ "total_flos": 0.0,
4
+ "train_loss": 0.685900236430921,
5
+ "train_runtime": 550.0055,
6
+ "train_samples": 4840,
7
+ "train_samples_per_second": 8.8,
8
+ "train_steps_per_second": 0.069
9
+ }
trainer_state.json ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 1.0,
5
+ "eval_steps": 100,
6
+ "global_step": 38,
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.02631578947368421,
13
+ "grad_norm": 2.592954402820238,
14
+ "learning_rate": 1.25e-07,
15
+ "logits/chosen": 0.4306640625,
16
+ "logits/rejected": 0.537109375,
17
+ "logps/chosen": -237.5,
18
+ "logps/rejected": -228.0,
19
+ "loss": 0.6914,
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.2631578947368421,
28
+ "grad_norm": 2.5257972591559534,
29
+ "learning_rate": 4.6255428393240354e-07,
30
+ "logits/chosen": 0.4337022602558136,
31
+ "logits/rejected": 0.4523654580116272,
32
+ "logps/chosen": -243.11111450195312,
33
+ "logps/rejected": -236.94444274902344,
34
+ "loss": 0.6919,
35
+ "rewards/accuracies": 0.28125,
36
+ "rewards/chosen": 0.004753430839627981,
37
+ "rewards/margins": 0.0010722478618845344,
38
+ "rewards/rejected": 0.0036805470008403063,
39
+ "step": 10
40
+ },
41
+ {
42
+ "epoch": 0.5263157894736842,
43
+ "grad_norm": 2.555743613102717,
44
+ "learning_rate": 2.730670898658255e-07,
45
+ "logits/chosen": 0.36152344942092896,
46
+ "logits/rejected": 0.45283204317092896,
47
+ "logps/chosen": -243.5,
48
+ "logps/rejected": -237.3000030517578,
49
+ "loss": 0.6873,
50
+ "rewards/accuracies": 0.54296875,
51
+ "rewards/chosen": 0.03550415113568306,
52
+ "rewards/margins": 0.011375045403838158,
53
+ "rewards/rejected": 0.02410888671875,
54
+ "step": 20
55
+ },
56
+ {
57
+ "epoch": 0.7894736842105263,
58
+ "grad_norm": 2.6433738154085615,
59
+ "learning_rate": 6.524777069483525e-08,
60
+ "logits/chosen": 0.35273438692092896,
61
+ "logits/rejected": 0.47441405057907104,
62
+ "logps/chosen": -243.14999389648438,
63
+ "logps/rejected": -235.14999389648438,
64
+ "loss": 0.6832,
65
+ "rewards/accuracies": 0.594531238079071,
66
+ "rewards/chosen": 0.06180419772863388,
67
+ "rewards/margins": 0.02066650427877903,
68
+ "rewards/rejected": 0.04110107570886612,
69
+ "step": 30
70
+ },
71
+ {
72
+ "epoch": 1.0,
73
+ "step": 38,
74
+ "total_flos": 0.0,
75
+ "train_loss": 0.685900236430921,
76
+ "train_runtime": 550.0055,
77
+ "train_samples_per_second": 8.8,
78
+ "train_steps_per_second": 0.069
79
+ }
80
+ ],
81
+ "logging_steps": 10,
82
+ "max_steps": 38,
83
+ "num_input_tokens_seen": 0,
84
+ "num_train_epochs": 1,
85
+ "save_steps": 100,
86
+ "stateful_callbacks": {
87
+ "TrainerControl": {
88
+ "args": {
89
+ "should_epoch_stop": false,
90
+ "should_evaluate": false,
91
+ "should_log": false,
92
+ "should_save": true,
93
+ "should_training_stop": true
94
+ },
95
+ "attributes": {}
96
+ }
97
+ },
98
+ "total_flos": 0.0,
99
+ "train_batch_size": 8,
100
+ "trial_name": null,
101
+ "trial_params": null
102
+ }