JinanAzem commited on
Commit
be5c83c
·
verified ·
1 Parent(s): deabf13

Upload folder using huggingface_hub

Browse files
Files changed (43) hide show
  1. .gitattributes +4 -0
  2. adapter/README.md +209 -0
  3. adapter/adapter_config.json +45 -0
  4. adapter/adapter_model.safetensors +3 -0
  5. adapter/chat_template.jinja +109 -0
  6. adapter/ref/adapter_config.json +45 -0
  7. adapter/ref/adapter_model.safetensors +3 -0
  8. adapter/tokenizer.json +3 -0
  9. adapter/tokenizer_config.json +16 -0
  10. dpo_run/README.md +68 -0
  11. dpo_run/checkpoint-100/README.md +209 -0
  12. dpo_run/checkpoint-100/adapter_config.json +45 -0
  13. dpo_run/checkpoint-100/adapter_model.safetensors +3 -0
  14. dpo_run/checkpoint-100/chat_template.jinja +109 -0
  15. dpo_run/checkpoint-100/optimizer.pt +3 -0
  16. dpo_run/checkpoint-100/ref/adapter_config.json +45 -0
  17. dpo_run/checkpoint-100/ref/adapter_model.safetensors +3 -0
  18. dpo_run/checkpoint-100/rng_state.pth +3 -0
  19. dpo_run/checkpoint-100/scheduler.pt +3 -0
  20. dpo_run/checkpoint-100/tokenizer.json +3 -0
  21. dpo_run/checkpoint-100/tokenizer_config.json +16 -0
  22. dpo_run/checkpoint-100/trainer_state.json +252 -0
  23. dpo_run/checkpoint-100/training_args.bin +3 -0
  24. dpo_run/checkpoint-192/README.md +209 -0
  25. dpo_run/checkpoint-192/adapter_config.json +45 -0
  26. dpo_run/checkpoint-192/adapter_model.safetensors +3 -0
  27. dpo_run/checkpoint-192/chat_template.jinja +109 -0
  28. dpo_run/checkpoint-192/optimizer.pt +3 -0
  29. dpo_run/checkpoint-192/ref/adapter_config.json +45 -0
  30. dpo_run/checkpoint-192/ref/adapter_model.safetensors +3 -0
  31. dpo_run/checkpoint-192/rng_state.pth +3 -0
  32. dpo_run/checkpoint-192/scheduler.pt +3 -0
  33. dpo_run/checkpoint-192/tokenizer.json +3 -0
  34. dpo_run/checkpoint-192/tokenizer_config.json +16 -0
  35. dpo_run/checkpoint-192/trainer_state.json +452 -0
  36. dpo_run/checkpoint-192/training_args.bin +3 -0
  37. dpo_run/runs/Jul08_10-32-30_704022de3b85/events.out.tfevents.1783506750.704022de3b85.12455.0 +3 -0
  38. merged/chat_template.jinja +109 -0
  39. merged/config.json +40 -0
  40. merged/generation_config.json +12 -0
  41. merged/model.safetensors +3 -0
  42. merged/tokenizer.json +3 -0
  43. merged/tokenizer_config.json +16 -0
.gitattributes CHANGED
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ adapter/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ dpo_run/checkpoint-100/tokenizer.json filter=lfs diff=lfs merge=lfs -text
38
+ dpo_run/checkpoint-192/tokenizer.json filter=lfs diff=lfs merge=lfs -text
39
+ merged/tokenizer.json filter=lfs diff=lfs merge=lfs -text
adapter/README.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: ./checkpoints/ft_jais_paper/merged
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:adapter:./checkpoints/ft_jais_paper/merged
7
+ - dpo
8
+ - lora
9
+ - transformers
10
+ - trl
11
+ ---
12
+
13
+ # Model Card for Model ID
14
+
15
+ <!-- Provide a quick summary of what the model is/does. -->
16
+
17
+
18
+
19
+ ## Model Details
20
+
21
+ ### Model Description
22
+
23
+ <!-- Provide a longer summary of what this model is. -->
24
+
25
+
26
+
27
+ - **Developed by:** [More Information Needed]
28
+ - **Funded by [optional]:** [More Information Needed]
29
+ - **Shared by [optional]:** [More Information Needed]
30
+ - **Model type:** [More Information Needed]
31
+ - **Language(s) (NLP):** [More Information Needed]
32
+ - **License:** [More Information Needed]
33
+ - **Finetuned from model [optional]:** [More Information Needed]
34
+
35
+ ### Model Sources [optional]
36
+
37
+ <!-- Provide the basic links for the model. -->
38
+
39
+ - **Repository:** [More Information Needed]
40
+ - **Paper [optional]:** [More Information Needed]
41
+ - **Demo [optional]:** [More Information Needed]
42
+
43
+ ## Uses
44
+
45
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
46
+
47
+ ### Direct Use
48
+
49
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
50
+
51
+ [More Information Needed]
52
+
53
+ ### Downstream Use [optional]
54
+
55
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
56
+
57
+ [More Information Needed]
58
+
59
+ ### Out-of-Scope Use
60
+
61
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
62
+
63
+ [More Information Needed]
64
+
65
+ ## Bias, Risks, and Limitations
66
+
67
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
68
+
69
+ [More Information Needed]
70
+
71
+ ### Recommendations
72
+
73
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
74
+
75
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
76
+
77
+ ## How to Get Started with the Model
78
+
79
+ Use the code below to get started with the model.
80
+
81
+ [More Information Needed]
82
+
83
+ ## Training Details
84
+
85
+ ### Training Data
86
+
87
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
88
+
89
+ [More Information Needed]
90
+
91
+ ### Training Procedure
92
+
93
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
94
+
95
+ #### Preprocessing [optional]
96
+
97
+ [More Information Needed]
98
+
99
+
100
+ #### Training Hyperparameters
101
+
102
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
103
+
104
+ #### Speeds, Sizes, Times [optional]
105
+
106
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
107
+
108
+ [More Information Needed]
109
+
110
+ ## Evaluation
111
+
112
+ <!-- This section describes the evaluation protocols and provides the results. -->
113
+
114
+ ### Testing Data, Factors & Metrics
115
+
116
+ #### Testing Data
117
+
118
+ <!-- This should link to a Dataset Card if possible. -->
119
+
120
+ [More Information Needed]
121
+
122
+ #### Factors
123
+
124
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
125
+
126
+ [More Information Needed]
127
+
128
+ #### Metrics
129
+
130
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
131
+
132
+ [More Information Needed]
133
+
134
+ ### Results
135
+
136
+ [More Information Needed]
137
+
138
+ #### Summary
139
+
140
+
141
+
142
+ ## Model Examination [optional]
143
+
144
+ <!-- Relevant interpretability work for the model goes here -->
145
+
146
+ [More Information Needed]
147
+
148
+ ## Environmental Impact
149
+
150
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
151
+
152
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
153
+
154
+ - **Hardware Type:** [More Information Needed]
155
+ - **Hours used:** [More Information Needed]
156
+ - **Cloud Provider:** [More Information Needed]
157
+ - **Compute Region:** [More Information Needed]
158
+ - **Carbon Emitted:** [More Information Needed]
159
+
160
+ ## Technical Specifications [optional]
161
+
162
+ ### Model Architecture and Objective
163
+
164
+ [More Information Needed]
165
+
166
+ ### Compute Infrastructure
167
+
168
+ [More Information Needed]
169
+
170
+ #### Hardware
171
+
172
+ [More Information Needed]
173
+
174
+ #### Software
175
+
176
+ [More Information Needed]
177
+
178
+ ## Citation [optional]
179
+
180
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
181
+
182
+ **BibTeX:**
183
+
184
+ [More Information Needed]
185
+
186
+ **APA:**
187
+
188
+ [More Information Needed]
189
+
190
+ ## Glossary [optional]
191
+
192
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
193
+
194
+ [More Information Needed]
195
+
196
+ ## More Information [optional]
197
+
198
+ [More Information Needed]
199
+
200
+ ## Model Card Authors [optional]
201
+
202
+ [More Information Needed]
203
+
204
+ ## Model Card Contact
205
+
206
+ [More Information Needed]
207
+ ### Framework versions
208
+
209
+ - PEFT 0.19.1
adapter/adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "./checkpoints/ft_jais_paper/merged",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 8,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "k_proj",
34
+ "o_proj",
35
+ "v_proj",
36
+ "q_proj"
37
+ ],
38
+ "target_parameters": null,
39
+ "task_type": "CAUSAL_LM",
40
+ "trainable_token_indices": null,
41
+ "use_bdlora": null,
42
+ "use_dora": false,
43
+ "use_qalora": false,
44
+ "use_rslora": false
45
+ }
adapter/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03d4100efca27bc77f47040e82b338dcc0e20a2fe7e5bc8a325ae77af2eb607e
3
+ size 27297032
adapter/chat_template.jinja ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined %}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if not tools_in_user_message is defined %}
6
+ {%- set tools_in_user_message = true %}
7
+ {%- endif %}
8
+ {%- if not date_string is defined %}
9
+ {%- set date_string = "26 Jul 2024" %}
10
+ {%- endif %}
11
+ {%- if not tools is defined %}
12
+ {%- set tools = none %}
13
+ {%- endif %}
14
+
15
+ {#- This block extracts the system message, so we can slot it into the right place. #}
16
+ {%- if messages[0]['role'] == 'system' %}
17
+ {%- set system_message = messages[0]['content']|trim %}
18
+ {%- set messages = messages[1:] %}
19
+ {%- else %}
20
+ {%- set system_message = "" %}
21
+ {%- endif %}
22
+
23
+ {#- System message + builtin tools #}
24
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
25
+ {%- if builtin_tools is defined or tools is not none %}
26
+ {{- "Environment: ipython\n" }}
27
+ {%- endif %}
28
+ {%- if builtin_tools is defined %}
29
+ {{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
30
+ {%- endif %}
31
+ {{- "Cutting Knowledge Date: December 2023\n" }}
32
+ {{- "Today Date: " + date_string + "\n\n" }}
33
+ {%- if tools is not none and not tools_in_user_message %}
34
+ {{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
35
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
36
+ {{- "Do not use variables.\n\n" }}
37
+ {%- for t in tools %}
38
+ {{- t | tojson(indent=4) }}
39
+ {{- "\n\n" }}
40
+ {%- endfor %}
41
+ {%- endif %}
42
+ {{- system_message }}
43
+ {{- "<|eot_id|>" }}
44
+
45
+ {#- Custom tools are passed in a user message with some extra guidance #}
46
+ {%- if tools_in_user_message and not tools is none %}
47
+ {#- Extract the first user message so we can plug it in here #}
48
+ {%- if messages | length != 0 %}
49
+ {%- set first_user_message = messages[0]['content']|trim %}
50
+ {%- set messages = messages[1:] %}
51
+ {%- else %}
52
+ {{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
53
+ {%- endif %}
54
+ {{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
55
+ {{- "Given the following functions, please respond with a JSON for a function call " }}
56
+ {{- "with its proper arguments that best answers the given prompt.\n\n" }}
57
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
58
+ {{- "Do not use variables.\n\n" }}
59
+ {%- for t in tools %}
60
+ {{- t | tojson(indent=4) }}
61
+ {{- "\n\n" }}
62
+ {%- endfor %}
63
+ {{- first_user_message + "<|eot_id|>"}}
64
+ {%- endif %}
65
+
66
+ {%- for message in messages %}
67
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
68
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
69
+ {%- elif 'tool_calls' in message %}
70
+ {%- if not message.tool_calls|length == 1 %}
71
+ {{- raise_exception("This model only supports single tool-calls at once!") }}
72
+ {%- endif %}
73
+ {%- set tool_call = message.tool_calls[0].function %}
74
+ {%- if builtin_tools is defined and tool_call.name in builtin_tools %}
75
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
76
+ {{- "<|python_tag|>" + tool_call.name + ".call(" }}
77
+ {%- for arg_name, arg_val in tool_call.arguments | items %}
78
+ {{- arg_name + '="' + arg_val + '"' }}
79
+ {%- if not loop.last %}
80
+ {{- ", " }}
81
+ {%- endif %}
82
+ {%- endfor %}
83
+ {{- ")" }}
84
+ {%- else %}
85
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
86
+ {{- '{"name": "' + tool_call.name + '", ' }}
87
+ {{- '"parameters": ' }}
88
+ {{- tool_call.arguments | tojson }}
89
+ {{- "}" }}
90
+ {%- endif %}
91
+ {%- if builtin_tools is defined %}
92
+ {#- This means we're in ipython mode #}
93
+ {{- "<|eom_id|>" }}
94
+ {%- else %}
95
+ {{- "<|eot_id|>" }}
96
+ {%- endif %}
97
+ {%- elif message.role == "tool" or message.role == "ipython" %}
98
+ {{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
99
+ {%- if message.content is mapping or message.content is iterable %}
100
+ {{- message.content | tojson }}
101
+ {%- else %}
102
+ {{- message.content }}
103
+ {%- endif %}
104
+ {{- "<|eot_id|>" }}
105
+ {%- endif %}
106
+ {%- endfor %}
107
+ {%- if add_generation_prompt %}
108
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
109
+ {%- endif %}
adapter/ref/adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "./checkpoints/ft_jais_paper/merged",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 8,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "k_proj",
34
+ "o_proj",
35
+ "v_proj",
36
+ "q_proj"
37
+ ],
38
+ "target_parameters": null,
39
+ "task_type": "CAUSAL_LM",
40
+ "trainable_token_indices": null,
41
+ "use_bdlora": null,
42
+ "use_dora": false,
43
+ "use_qalora": false,
44
+ "use_rslora": false
45
+ }
adapter/ref/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57db2b296bc7290f18c750843e4280daf15135b126a73cbfdad9b171a581a4e3
3
+ size 27297032
adapter/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
adapter/tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|eot_id|>",
6
+ "is_local": true,
7
+ "local_files_only": false,
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 131072,
13
+ "pad_token": "<|eot_id|>",
14
+ "padding_side": "right",
15
+ "tokenizer_class": "TokenizersBackend"
16
+ }
dpo_run/README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ model_name: dpo_run
4
+ tags:
5
+ - generated_from_trainer
6
+ - dpo
7
+ - trl
8
+ licence: license
9
+ ---
10
+
11
+ # Model Card for dpo_run
12
+
13
+ This model is a fine-tuned version of [None](https://huggingface.co/None).
14
+ It has been trained using [TRL](https://github.com/huggingface/trl).
15
+
16
+ ## Quick start
17
+
18
+ ```python
19
+ from transformers import pipeline
20
+
21
+ 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?"
22
+ generator = pipeline("text-generation", model="None", device="cuda")
23
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
24
+ print(output["generated_text"])
25
+ ```
26
+
27
+ ## Training procedure
28
+
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: 1.7.1
38
+ - Transformers: 5.13.0
39
+ - Pytorch: 2.12.0+cu130
40
+ - Datasets: 5.0.0
41
+ - Tokenizers: 0.22.2
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
+ @software{vonwerra2020trl,
62
+ title = {{TRL: Transformers Reinforcement Learning}},
63
+ author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
64
+ license = {Apache-2.0},
65
+ url = {https://github.com/huggingface/trl},
66
+ year = {2020}
67
+ }
68
+ ```
dpo_run/checkpoint-100/README.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: ./checkpoints/ft_jais_paper/merged
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:adapter:./checkpoints/ft_jais_paper/merged
7
+ - dpo
8
+ - lora
9
+ - transformers
10
+ - trl
11
+ ---
12
+
13
+ # Model Card for Model ID
14
+
15
+ <!-- Provide a quick summary of what the model is/does. -->
16
+
17
+
18
+
19
+ ## Model Details
20
+
21
+ ### Model Description
22
+
23
+ <!-- Provide a longer summary of what this model is. -->
24
+
25
+
26
+
27
+ - **Developed by:** [More Information Needed]
28
+ - **Funded by [optional]:** [More Information Needed]
29
+ - **Shared by [optional]:** [More Information Needed]
30
+ - **Model type:** [More Information Needed]
31
+ - **Language(s) (NLP):** [More Information Needed]
32
+ - **License:** [More Information Needed]
33
+ - **Finetuned from model [optional]:** [More Information Needed]
34
+
35
+ ### Model Sources [optional]
36
+
37
+ <!-- Provide the basic links for the model. -->
38
+
39
+ - **Repository:** [More Information Needed]
40
+ - **Paper [optional]:** [More Information Needed]
41
+ - **Demo [optional]:** [More Information Needed]
42
+
43
+ ## Uses
44
+
45
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
46
+
47
+ ### Direct Use
48
+
49
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
50
+
51
+ [More Information Needed]
52
+
53
+ ### Downstream Use [optional]
54
+
55
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
56
+
57
+ [More Information Needed]
58
+
59
+ ### Out-of-Scope Use
60
+
61
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
62
+
63
+ [More Information Needed]
64
+
65
+ ## Bias, Risks, and Limitations
66
+
67
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
68
+
69
+ [More Information Needed]
70
+
71
+ ### Recommendations
72
+
73
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
74
+
75
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
76
+
77
+ ## How to Get Started with the Model
78
+
79
+ Use the code below to get started with the model.
80
+
81
+ [More Information Needed]
82
+
83
+ ## Training Details
84
+
85
+ ### Training Data
86
+
87
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
88
+
89
+ [More Information Needed]
90
+
91
+ ### Training Procedure
92
+
93
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
94
+
95
+ #### Preprocessing [optional]
96
+
97
+ [More Information Needed]
98
+
99
+
100
+ #### Training Hyperparameters
101
+
102
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
103
+
104
+ #### Speeds, Sizes, Times [optional]
105
+
106
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
107
+
108
+ [More Information Needed]
109
+
110
+ ## Evaluation
111
+
112
+ <!-- This section describes the evaluation protocols and provides the results. -->
113
+
114
+ ### Testing Data, Factors & Metrics
115
+
116
+ #### Testing Data
117
+
118
+ <!-- This should link to a Dataset Card if possible. -->
119
+
120
+ [More Information Needed]
121
+
122
+ #### Factors
123
+
124
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
125
+
126
+ [More Information Needed]
127
+
128
+ #### Metrics
129
+
130
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
131
+
132
+ [More Information Needed]
133
+
134
+ ### Results
135
+
136
+ [More Information Needed]
137
+
138
+ #### Summary
139
+
140
+
141
+
142
+ ## Model Examination [optional]
143
+
144
+ <!-- Relevant interpretability work for the model goes here -->
145
+
146
+ [More Information Needed]
147
+
148
+ ## Environmental Impact
149
+
150
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
151
+
152
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
153
+
154
+ - **Hardware Type:** [More Information Needed]
155
+ - **Hours used:** [More Information Needed]
156
+ - **Cloud Provider:** [More Information Needed]
157
+ - **Compute Region:** [More Information Needed]
158
+ - **Carbon Emitted:** [More Information Needed]
159
+
160
+ ## Technical Specifications [optional]
161
+
162
+ ### Model Architecture and Objective
163
+
164
+ [More Information Needed]
165
+
166
+ ### Compute Infrastructure
167
+
168
+ [More Information Needed]
169
+
170
+ #### Hardware
171
+
172
+ [More Information Needed]
173
+
174
+ #### Software
175
+
176
+ [More Information Needed]
177
+
178
+ ## Citation [optional]
179
+
180
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
181
+
182
+ **BibTeX:**
183
+
184
+ [More Information Needed]
185
+
186
+ **APA:**
187
+
188
+ [More Information Needed]
189
+
190
+ ## Glossary [optional]
191
+
192
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
193
+
194
+ [More Information Needed]
195
+
196
+ ## More Information [optional]
197
+
198
+ [More Information Needed]
199
+
200
+ ## Model Card Authors [optional]
201
+
202
+ [More Information Needed]
203
+
204
+ ## Model Card Contact
205
+
206
+ [More Information Needed]
207
+ ### Framework versions
208
+
209
+ - PEFT 0.19.1
dpo_run/checkpoint-100/adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "./checkpoints/ft_jais_paper/merged",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 8,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "k_proj",
34
+ "o_proj",
35
+ "v_proj",
36
+ "q_proj"
37
+ ],
38
+ "target_parameters": null,
39
+ "task_type": "CAUSAL_LM",
40
+ "trainable_token_indices": null,
41
+ "use_bdlora": null,
42
+ "use_dora": false,
43
+ "use_qalora": false,
44
+ "use_rslora": false
45
+ }
dpo_run/checkpoint-100/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20e862962a6bc122e3a27c5385e5be355d611ac8336ec9d8be00a37868fd24be
3
+ size 27297032
dpo_run/checkpoint-100/chat_template.jinja ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined %}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if not tools_in_user_message is defined %}
6
+ {%- set tools_in_user_message = true %}
7
+ {%- endif %}
8
+ {%- if not date_string is defined %}
9
+ {%- set date_string = "26 Jul 2024" %}
10
+ {%- endif %}
11
+ {%- if not tools is defined %}
12
+ {%- set tools = none %}
13
+ {%- endif %}
14
+
15
+ {#- This block extracts the system message, so we can slot it into the right place. #}
16
+ {%- if messages[0]['role'] == 'system' %}
17
+ {%- set system_message = messages[0]['content']|trim %}
18
+ {%- set messages = messages[1:] %}
19
+ {%- else %}
20
+ {%- set system_message = "" %}
21
+ {%- endif %}
22
+
23
+ {#- System message + builtin tools #}
24
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
25
+ {%- if builtin_tools is defined or tools is not none %}
26
+ {{- "Environment: ipython\n" }}
27
+ {%- endif %}
28
+ {%- if builtin_tools is defined %}
29
+ {{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
30
+ {%- endif %}
31
+ {{- "Cutting Knowledge Date: December 2023\n" }}
32
+ {{- "Today Date: " + date_string + "\n\n" }}
33
+ {%- if tools is not none and not tools_in_user_message %}
34
+ {{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
35
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
36
+ {{- "Do not use variables.\n\n" }}
37
+ {%- for t in tools %}
38
+ {{- t | tojson(indent=4) }}
39
+ {{- "\n\n" }}
40
+ {%- endfor %}
41
+ {%- endif %}
42
+ {{- system_message }}
43
+ {{- "<|eot_id|>" }}
44
+
45
+ {#- Custom tools are passed in a user message with some extra guidance #}
46
+ {%- if tools_in_user_message and not tools is none %}
47
+ {#- Extract the first user message so we can plug it in here #}
48
+ {%- if messages | length != 0 %}
49
+ {%- set first_user_message = messages[0]['content']|trim %}
50
+ {%- set messages = messages[1:] %}
51
+ {%- else %}
52
+ {{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
53
+ {%- endif %}
54
+ {{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
55
+ {{- "Given the following functions, please respond with a JSON for a function call " }}
56
+ {{- "with its proper arguments that best answers the given prompt.\n\n" }}
57
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
58
+ {{- "Do not use variables.\n\n" }}
59
+ {%- for t in tools %}
60
+ {{- t | tojson(indent=4) }}
61
+ {{- "\n\n" }}
62
+ {%- endfor %}
63
+ {{- first_user_message + "<|eot_id|>"}}
64
+ {%- endif %}
65
+
66
+ {%- for message in messages %}
67
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
68
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
69
+ {%- elif 'tool_calls' in message %}
70
+ {%- if not message.tool_calls|length == 1 %}
71
+ {{- raise_exception("This model only supports single tool-calls at once!") }}
72
+ {%- endif %}
73
+ {%- set tool_call = message.tool_calls[0].function %}
74
+ {%- if builtin_tools is defined and tool_call.name in builtin_tools %}
75
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
76
+ {{- "<|python_tag|>" + tool_call.name + ".call(" }}
77
+ {%- for arg_name, arg_val in tool_call.arguments | items %}
78
+ {{- arg_name + '="' + arg_val + '"' }}
79
+ {%- if not loop.last %}
80
+ {{- ", " }}
81
+ {%- endif %}
82
+ {%- endfor %}
83
+ {{- ")" }}
84
+ {%- else %}
85
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
86
+ {{- '{"name": "' + tool_call.name + '", ' }}
87
+ {{- '"parameters": ' }}
88
+ {{- tool_call.arguments | tojson }}
89
+ {{- "}" }}
90
+ {%- endif %}
91
+ {%- if builtin_tools is defined %}
92
+ {#- This means we're in ipython mode #}
93
+ {{- "<|eom_id|>" }}
94
+ {%- else %}
95
+ {{- "<|eot_id|>" }}
96
+ {%- endif %}
97
+ {%- elif message.role == "tool" or message.role == "ipython" %}
98
+ {{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
99
+ {%- if message.content is mapping or message.content is iterable %}
100
+ {{- message.content | tojson }}
101
+ {%- else %}
102
+ {{- message.content }}
103
+ {%- endif %}
104
+ {{- "<|eot_id|>" }}
105
+ {%- endif %}
106
+ {%- endfor %}
107
+ {%- if add_generation_prompt %}
108
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
109
+ {%- endif %}
dpo_run/checkpoint-100/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb1917c37272304c307399b4c607011befca959e9f0db5d4619853025fa409b8
3
+ size 54680139
dpo_run/checkpoint-100/ref/adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "./checkpoints/ft_jais_paper/merged",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 8,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "k_proj",
34
+ "o_proj",
35
+ "v_proj",
36
+ "q_proj"
37
+ ],
38
+ "target_parameters": null,
39
+ "task_type": "CAUSAL_LM",
40
+ "trainable_token_indices": null,
41
+ "use_bdlora": null,
42
+ "use_dora": false,
43
+ "use_qalora": false,
44
+ "use_rslora": false
45
+ }
dpo_run/checkpoint-100/ref/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57db2b296bc7290f18c750843e4280daf15135b126a73cbfdad9b171a581a4e3
3
+ size 27297032
dpo_run/checkpoint-100/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8e2011629d8bed3ef560fa11175cac55684c4e12a72634bb24abf767b6c7399
3
+ size 14645
dpo_run/checkpoint-100/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76b14909a0f0138023fc5a1a2a595ead21962ba33aa04cc7226670ad9ec1cc66
3
+ size 1465
dpo_run/checkpoint-100/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
dpo_run/checkpoint-100/tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|eot_id|>",
6
+ "is_local": true,
7
+ "local_files_only": false,
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 131072,
13
+ "pad_token": "<|eot_id|>",
14
+ "padding_side": "right",
15
+ "tokenizer_class": "TokenizersBackend"
16
+ }
dpo_run/checkpoint-100/trainer_state.json ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": 100,
3
+ "best_metric": 0.6545524597167969,
4
+ "best_model_checkpoint": "checkpoints/ft_jais_simdpo/dpo_run/checkpoint-100",
5
+ "epoch": 1.5625,
6
+ "eval_steps": 50,
7
+ "global_step": 100,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "entropy": 0.8328714728355407,
14
+ "epoch": 0.15625,
15
+ "grad_norm": 3.5907697677612305,
16
+ "learning_rate": 2.25e-05,
17
+ "logits/chosen": 0.9851744980764,
18
+ "logits/rejected": 0.9132862824057325,
19
+ "logps/chosen": -80.49798936843872,
20
+ "logps/rejected": -87.13544521331787,
21
+ "loss": 0.691208028793335,
22
+ "mean_token_accuracy": 0.8373994886875152,
23
+ "num_tokens": 16910.0,
24
+ "rewards/accuracies": 0.4125,
25
+ "rewards/chosen": 0.005871815676800907,
26
+ "rewards/margins": 0.0046546274214051666,
27
+ "rewards/rejected": 0.0012171887326985597,
28
+ "step": 10
29
+ },
30
+ {
31
+ "entropy": 0.8236085653305054,
32
+ "epoch": 0.3125,
33
+ "grad_norm": 3.045801877975464,
34
+ "learning_rate": 4.75e-05,
35
+ "logits/chosen": 0.9432169298637705,
36
+ "logits/rejected": 0.9300128951388309,
37
+ "logps/chosen": -80.01706008911133,
38
+ "logps/rejected": -86.19765682220459,
39
+ "loss": 0.6912835597991943,
40
+ "mean_token_accuracy": 0.8420414581894875,
41
+ "num_tokens": 33876.0,
42
+ "rewards/accuracies": 0.5625,
43
+ "rewards/chosen": 0.046248766069766134,
44
+ "rewards/margins": 0.0050085548544302584,
45
+ "rewards/rejected": 0.04124021101742983,
46
+ "step": 20
47
+ },
48
+ {
49
+ "entropy": 0.8710977151989937,
50
+ "epoch": 0.46875,
51
+ "grad_norm": 4.131756782531738,
52
+ "learning_rate": 4.9662976890711167e-05,
53
+ "logits/chosen": 0.952295882064034,
54
+ "logits/rejected": 0.8837412199420139,
55
+ "logps/chosen": -83.00751543045044,
56
+ "logps/rejected": -89.77082118988037,
57
+ "loss": 0.6836707592010498,
58
+ "mean_token_accuracy": 0.830362756550312,
59
+ "num_tokens": 51751.0,
60
+ "rewards/accuracies": 0.55,
61
+ "rewards/chosen": 0.19173650545999407,
62
+ "rewards/margins": 0.02175652077421546,
63
+ "rewards/rejected": 0.1699799854774028,
64
+ "step": 30
65
+ },
66
+ {
67
+ "entropy": 0.8702168866991997,
68
+ "epoch": 0.625,
69
+ "grad_norm": 3.4390907287597656,
70
+ "learning_rate": 4.850961997099892e-05,
71
+ "logits/chosen": 0.9335240972164126,
72
+ "logits/rejected": 0.8931220467287231,
73
+ "logps/chosen": -78.64973669052124,
74
+ "logps/rejected": -83.12959709167481,
75
+ "loss": 0.680081558227539,
76
+ "mean_token_accuracy": 0.8323500514030456,
77
+ "num_tokens": 68855.0,
78
+ "rewards/accuracies": 0.575,
79
+ "rewards/chosen": 0.5641312405467034,
80
+ "rewards/margins": 0.03580198623239994,
81
+ "rewards/rejected": 0.5283292587846518,
82
+ "step": 40
83
+ },
84
+ {
85
+ "entropy": 0.8412925243377686,
86
+ "epoch": 0.78125,
87
+ "grad_norm": 3.696289539337158,
88
+ "learning_rate": 4.657412981885862e-05,
89
+ "logits/chosen": 0.9247626503111631,
90
+ "logits/rejected": 0.9220718661915835,
91
+ "logps/chosen": -68.65432586669922,
92
+ "logps/rejected": -82.09786891937256,
93
+ "loss": 0.628887414932251,
94
+ "mean_token_accuracy": 0.8538857877254487,
95
+ "num_tokens": 86484.0,
96
+ "rewards/accuracies": 0.775,
97
+ "rewards/chosen": 1.0782162077724933,
98
+ "rewards/margins": 0.16525846347212791,
99
+ "rewards/rejected": 0.9129577524960041,
100
+ "step": 50
101
+ },
102
+ {
103
+ "epoch": 0.78125,
104
+ "eval_entropy": 0.8311625965710344,
105
+ "eval_logits/chosen": 0.9525682816067235,
106
+ "eval_logits/rejected": 0.9378524862311701,
107
+ "eval_logps/chosen": -70.774687273749,
108
+ "eval_logps/rejected": -77.4474421534045,
109
+ "eval_loss": 0.663590133190155,
110
+ "eval_mean_token_accuracy": 0.8474541881988789,
111
+ "eval_num_tokens": 86484.0,
112
+ "eval_rewards/accuracies": 0.6724137931034483,
113
+ "eval_rewards/chosen": 1.197298473325269,
114
+ "eval_rewards/margins": 0.1253269150339324,
115
+ "eval_rewards/rejected": 1.0719715516115058,
116
+ "eval_runtime": 3.6052,
117
+ "eval_samples_per_second": 15.811,
118
+ "eval_steps_per_second": 8.044,
119
+ "step": 50
120
+ },
121
+ {
122
+ "entropy": 0.9258149698376655,
123
+ "epoch": 0.9375,
124
+ "grad_norm": 9.48177433013916,
125
+ "learning_rate": 4.392089757165841e-05,
126
+ "logits/chosen": 0.9196924747627211,
127
+ "logits/rejected": 0.9150918054479149,
128
+ "logps/chosen": -69.63652791976929,
129
+ "logps/rejected": -74.67644653320312,
130
+ "loss": 0.6724472045898438,
131
+ "mean_token_accuracy": 0.8314912617206573,
132
+ "num_tokens": 103165.0,
133
+ "rewards/accuracies": 0.6,
134
+ "rewards/chosen": 1.612139716744423,
135
+ "rewards/margins": 0.10208179727196694,
136
+ "rewards/rejected": 1.5100578874349595,
137
+ "step": 60
138
+ },
139
+ {
140
+ "entropy": 0.9276665955781936,
141
+ "epoch": 1.09375,
142
+ "grad_norm": 4.742893218994141,
143
+ "learning_rate": 4.0638192674691136e-05,
144
+ "logits/chosen": 0.9372565226225635,
145
+ "logits/rejected": 0.8758297012073308,
146
+ "logps/chosen": -72.57800025939942,
147
+ "logps/rejected": -75.22021579742432,
148
+ "loss": 0.5596485137939453,
149
+ "mean_token_accuracy": 0.8355538666248321,
150
+ "num_tokens": 120923.0,
151
+ "rewards/accuracies": 0.75,
152
+ "rewards/chosen": 1.6647123485803603,
153
+ "rewards/margins": 0.3873647030442953,
154
+ "rewards/rejected": 1.2773476531729102,
155
+ "step": 70
156
+ },
157
+ {
158
+ "entropy": 0.9321356564760208,
159
+ "epoch": 1.25,
160
+ "grad_norm": 3.8452413082122803,
161
+ "learning_rate": 3.683522627621608e-05,
162
+ "logits/chosen": 0.9183959182419773,
163
+ "logits/rejected": 0.8850714484434743,
164
+ "logps/chosen": -73.9180368423462,
165
+ "logps/rejected": -87.95330810546875,
166
+ "loss": 0.4759009838104248,
167
+ "mean_token_accuracy": 0.8352961301803589,
168
+ "num_tokens": 138825.0,
169
+ "rewards/accuracies": 0.8,
170
+ "rewards/chosen": 1.2514840960502625,
171
+ "rewards/margins": 0.6839764896780253,
172
+ "rewards/rejected": 0.5675076065585017,
173
+ "step": 80
174
+ },
175
+ {
176
+ "entropy": 0.9279324404895306,
177
+ "epoch": 1.40625,
178
+ "grad_norm": 5.118920803070068,
179
+ "learning_rate": 3.263851792039109e-05,
180
+ "logits/chosen": 0.8924988958553159,
181
+ "logits/rejected": 0.8284702619552127,
182
+ "logps/chosen": -71.48162698745728,
183
+ "logps/rejected": -83.52158260345459,
184
+ "loss": 0.39791891574859617,
185
+ "mean_token_accuracy": 0.8307904973626137,
186
+ "num_tokens": 155378.0,
187
+ "rewards/accuracies": 0.8875,
188
+ "rewards/chosen": 1.317165607213974,
189
+ "rewards/margins": 0.9690214801579714,
190
+ "rewards/rejected": 0.34814412128180267,
191
+ "step": 90
192
+ },
193
+ {
194
+ "entropy": 0.9241503536701202,
195
+ "epoch": 1.5625,
196
+ "grad_norm": 7.398733615875244,
197
+ "learning_rate": 2.81876864133027e-05,
198
+ "logits/chosen": 0.9289504257072073,
199
+ "logits/rejected": 0.9161463222864651,
200
+ "logps/chosen": -62.29160423278809,
201
+ "logps/rejected": -79.298428440094,
202
+ "loss": 0.41886510848999026,
203
+ "mean_token_accuracy": 0.8381225109100342,
204
+ "num_tokens": 171778.0,
205
+ "rewards/accuracies": 0.7875,
206
+ "rewards/chosen": 1.9696232751011848,
207
+ "rewards/margins": 1.0112529575824738,
208
+ "rewards/rejected": 0.9583703201264143,
209
+ "step": 100
210
+ },
211
+ {
212
+ "epoch": 1.5625,
213
+ "eval_entropy": 0.8753328939964031,
214
+ "eval_logits/chosen": 0.980303409740094,
215
+ "eval_logits/rejected": 0.9663606126464863,
216
+ "eval_logps/chosen": -59.93091070240941,
217
+ "eval_logps/rejected": -69.91863198115908,
218
+ "eval_loss": 0.6545524597167969,
219
+ "eval_mean_token_accuracy": 0.8393763550396623,
220
+ "eval_num_tokens": 171778.0,
221
+ "eval_rewards/accuracies": 0.6551724137931034,
222
+ "eval_rewards/chosen": 2.281676158822816,
223
+ "eval_rewards/margins": 0.45682352164696005,
224
+ "eval_rewards/rejected": 1.8248526556738491,
225
+ "eval_runtime": 3.6534,
226
+ "eval_samples_per_second": 15.602,
227
+ "eval_steps_per_second": 7.938,
228
+ "step": 100
229
+ }
230
+ ],
231
+ "logging_steps": 10,
232
+ "max_steps": 192,
233
+ "num_input_tokens_seen": 0,
234
+ "num_train_epochs": 3,
235
+ "save_steps": 100,
236
+ "stateful_callbacks": {
237
+ "TrainerControl": {
238
+ "args": {
239
+ "should_epoch_stop": false,
240
+ "should_evaluate": false,
241
+ "should_log": false,
242
+ "should_save": true,
243
+ "should_training_stop": false
244
+ },
245
+ "attributes": {}
246
+ }
247
+ },
248
+ "total_flos": 1.070816827686912e+16,
249
+ "train_batch_size": 2,
250
+ "trial_name": null,
251
+ "trial_params": null
252
+ }
dpo_run/checkpoint-100/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e2f5c93a150a28b433b4deecef1c96d772331f7a6843d129188a66b41666003
3
+ size 5841
dpo_run/checkpoint-192/README.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: ./checkpoints/ft_jais_paper/merged
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:adapter:./checkpoints/ft_jais_paper/merged
7
+ - dpo
8
+ - lora
9
+ - transformers
10
+ - trl
11
+ ---
12
+
13
+ # Model Card for Model ID
14
+
15
+ <!-- Provide a quick summary of what the model is/does. -->
16
+
17
+
18
+
19
+ ## Model Details
20
+
21
+ ### Model Description
22
+
23
+ <!-- Provide a longer summary of what this model is. -->
24
+
25
+
26
+
27
+ - **Developed by:** [More Information Needed]
28
+ - **Funded by [optional]:** [More Information Needed]
29
+ - **Shared by [optional]:** [More Information Needed]
30
+ - **Model type:** [More Information Needed]
31
+ - **Language(s) (NLP):** [More Information Needed]
32
+ - **License:** [More Information Needed]
33
+ - **Finetuned from model [optional]:** [More Information Needed]
34
+
35
+ ### Model Sources [optional]
36
+
37
+ <!-- Provide the basic links for the model. -->
38
+
39
+ - **Repository:** [More Information Needed]
40
+ - **Paper [optional]:** [More Information Needed]
41
+ - **Demo [optional]:** [More Information Needed]
42
+
43
+ ## Uses
44
+
45
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
46
+
47
+ ### Direct Use
48
+
49
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
50
+
51
+ [More Information Needed]
52
+
53
+ ### Downstream Use [optional]
54
+
55
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
56
+
57
+ [More Information Needed]
58
+
59
+ ### Out-of-Scope Use
60
+
61
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
62
+
63
+ [More Information Needed]
64
+
65
+ ## Bias, Risks, and Limitations
66
+
67
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
68
+
69
+ [More Information Needed]
70
+
71
+ ### Recommendations
72
+
73
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
74
+
75
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
76
+
77
+ ## How to Get Started with the Model
78
+
79
+ Use the code below to get started with the model.
80
+
81
+ [More Information Needed]
82
+
83
+ ## Training Details
84
+
85
+ ### Training Data
86
+
87
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
88
+
89
+ [More Information Needed]
90
+
91
+ ### Training Procedure
92
+
93
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
94
+
95
+ #### Preprocessing [optional]
96
+
97
+ [More Information Needed]
98
+
99
+
100
+ #### Training Hyperparameters
101
+
102
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
103
+
104
+ #### Speeds, Sizes, Times [optional]
105
+
106
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
107
+
108
+ [More Information Needed]
109
+
110
+ ## Evaluation
111
+
112
+ <!-- This section describes the evaluation protocols and provides the results. -->
113
+
114
+ ### Testing Data, Factors & Metrics
115
+
116
+ #### Testing Data
117
+
118
+ <!-- This should link to a Dataset Card if possible. -->
119
+
120
+ [More Information Needed]
121
+
122
+ #### Factors
123
+
124
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
125
+
126
+ [More Information Needed]
127
+
128
+ #### Metrics
129
+
130
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
131
+
132
+ [More Information Needed]
133
+
134
+ ### Results
135
+
136
+ [More Information Needed]
137
+
138
+ #### Summary
139
+
140
+
141
+
142
+ ## Model Examination [optional]
143
+
144
+ <!-- Relevant interpretability work for the model goes here -->
145
+
146
+ [More Information Needed]
147
+
148
+ ## Environmental Impact
149
+
150
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
151
+
152
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
153
+
154
+ - **Hardware Type:** [More Information Needed]
155
+ - **Hours used:** [More Information Needed]
156
+ - **Cloud Provider:** [More Information Needed]
157
+ - **Compute Region:** [More Information Needed]
158
+ - **Carbon Emitted:** [More Information Needed]
159
+
160
+ ## Technical Specifications [optional]
161
+
162
+ ### Model Architecture and Objective
163
+
164
+ [More Information Needed]
165
+
166
+ ### Compute Infrastructure
167
+
168
+ [More Information Needed]
169
+
170
+ #### Hardware
171
+
172
+ [More Information Needed]
173
+
174
+ #### Software
175
+
176
+ [More Information Needed]
177
+
178
+ ## Citation [optional]
179
+
180
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
181
+
182
+ **BibTeX:**
183
+
184
+ [More Information Needed]
185
+
186
+ **APA:**
187
+
188
+ [More Information Needed]
189
+
190
+ ## Glossary [optional]
191
+
192
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
193
+
194
+ [More Information Needed]
195
+
196
+ ## More Information [optional]
197
+
198
+ [More Information Needed]
199
+
200
+ ## Model Card Authors [optional]
201
+
202
+ [More Information Needed]
203
+
204
+ ## Model Card Contact
205
+
206
+ [More Information Needed]
207
+ ### Framework versions
208
+
209
+ - PEFT 0.19.1
dpo_run/checkpoint-192/adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "./checkpoints/ft_jais_paper/merged",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 8,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "k_proj",
34
+ "o_proj",
35
+ "v_proj",
36
+ "q_proj"
37
+ ],
38
+ "target_parameters": null,
39
+ "task_type": "CAUSAL_LM",
40
+ "trainable_token_indices": null,
41
+ "use_bdlora": null,
42
+ "use_dora": false,
43
+ "use_qalora": false,
44
+ "use_rslora": false
45
+ }
dpo_run/checkpoint-192/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03d4100efca27bc77f47040e82b338dcc0e20a2fe7e5bc8a325ae77af2eb607e
3
+ size 27297032
dpo_run/checkpoint-192/chat_template.jinja ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined %}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if not tools_in_user_message is defined %}
6
+ {%- set tools_in_user_message = true %}
7
+ {%- endif %}
8
+ {%- if not date_string is defined %}
9
+ {%- set date_string = "26 Jul 2024" %}
10
+ {%- endif %}
11
+ {%- if not tools is defined %}
12
+ {%- set tools = none %}
13
+ {%- endif %}
14
+
15
+ {#- This block extracts the system message, so we can slot it into the right place. #}
16
+ {%- if messages[0]['role'] == 'system' %}
17
+ {%- set system_message = messages[0]['content']|trim %}
18
+ {%- set messages = messages[1:] %}
19
+ {%- else %}
20
+ {%- set system_message = "" %}
21
+ {%- endif %}
22
+
23
+ {#- System message + builtin tools #}
24
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
25
+ {%- if builtin_tools is defined or tools is not none %}
26
+ {{- "Environment: ipython\n" }}
27
+ {%- endif %}
28
+ {%- if builtin_tools is defined %}
29
+ {{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
30
+ {%- endif %}
31
+ {{- "Cutting Knowledge Date: December 2023\n" }}
32
+ {{- "Today Date: " + date_string + "\n\n" }}
33
+ {%- if tools is not none and not tools_in_user_message %}
34
+ {{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
35
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
36
+ {{- "Do not use variables.\n\n" }}
37
+ {%- for t in tools %}
38
+ {{- t | tojson(indent=4) }}
39
+ {{- "\n\n" }}
40
+ {%- endfor %}
41
+ {%- endif %}
42
+ {{- system_message }}
43
+ {{- "<|eot_id|>" }}
44
+
45
+ {#- Custom tools are passed in a user message with some extra guidance #}
46
+ {%- if tools_in_user_message and not tools is none %}
47
+ {#- Extract the first user message so we can plug it in here #}
48
+ {%- if messages | length != 0 %}
49
+ {%- set first_user_message = messages[0]['content']|trim %}
50
+ {%- set messages = messages[1:] %}
51
+ {%- else %}
52
+ {{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
53
+ {%- endif %}
54
+ {{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
55
+ {{- "Given the following functions, please respond with a JSON for a function call " }}
56
+ {{- "with its proper arguments that best answers the given prompt.\n\n" }}
57
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
58
+ {{- "Do not use variables.\n\n" }}
59
+ {%- for t in tools %}
60
+ {{- t | tojson(indent=4) }}
61
+ {{- "\n\n" }}
62
+ {%- endfor %}
63
+ {{- first_user_message + "<|eot_id|>"}}
64
+ {%- endif %}
65
+
66
+ {%- for message in messages %}
67
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
68
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
69
+ {%- elif 'tool_calls' in message %}
70
+ {%- if not message.tool_calls|length == 1 %}
71
+ {{- raise_exception("This model only supports single tool-calls at once!") }}
72
+ {%- endif %}
73
+ {%- set tool_call = message.tool_calls[0].function %}
74
+ {%- if builtin_tools is defined and tool_call.name in builtin_tools %}
75
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
76
+ {{- "<|python_tag|>" + tool_call.name + ".call(" }}
77
+ {%- for arg_name, arg_val in tool_call.arguments | items %}
78
+ {{- arg_name + '="' + arg_val + '"' }}
79
+ {%- if not loop.last %}
80
+ {{- ", " }}
81
+ {%- endif %}
82
+ {%- endfor %}
83
+ {{- ")" }}
84
+ {%- else %}
85
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
86
+ {{- '{"name": "' + tool_call.name + '", ' }}
87
+ {{- '"parameters": ' }}
88
+ {{- tool_call.arguments | tojson }}
89
+ {{- "}" }}
90
+ {%- endif %}
91
+ {%- if builtin_tools is defined %}
92
+ {#- This means we're in ipython mode #}
93
+ {{- "<|eom_id|>" }}
94
+ {%- else %}
95
+ {{- "<|eot_id|>" }}
96
+ {%- endif %}
97
+ {%- elif message.role == "tool" or message.role == "ipython" %}
98
+ {{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
99
+ {%- if message.content is mapping or message.content is iterable %}
100
+ {{- message.content | tojson }}
101
+ {%- else %}
102
+ {{- message.content }}
103
+ {%- endif %}
104
+ {{- "<|eot_id|>" }}
105
+ {%- endif %}
106
+ {%- endfor %}
107
+ {%- if add_generation_prompt %}
108
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
109
+ {%- endif %}
dpo_run/checkpoint-192/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea895e56e2d1d0aa65c07ee1ff3c9a811707cb52e769c2518afaf34820d3e358
3
+ size 54680139
dpo_run/checkpoint-192/ref/adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "./checkpoints/ft_jais_paper/merged",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 16,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 8,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "k_proj",
34
+ "o_proj",
35
+ "v_proj",
36
+ "q_proj"
37
+ ],
38
+ "target_parameters": null,
39
+ "task_type": "CAUSAL_LM",
40
+ "trainable_token_indices": null,
41
+ "use_bdlora": null,
42
+ "use_dora": false,
43
+ "use_qalora": false,
44
+ "use_rslora": false
45
+ }
dpo_run/checkpoint-192/ref/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57db2b296bc7290f18c750843e4280daf15135b126a73cbfdad9b171a581a4e3
3
+ size 27297032
dpo_run/checkpoint-192/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f196323d7423b60f8e4ceb7dbf8715ee326c0d068e5ff164f13c63b279b9f1a0
3
+ size 14645
dpo_run/checkpoint-192/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8caff6c4ce3bd764f4450dcf25ad72fb2330bcf7e768724f2d73c08c3ad61c6
3
+ size 1465
dpo_run/checkpoint-192/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
dpo_run/checkpoint-192/tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|eot_id|>",
6
+ "is_local": true,
7
+ "local_files_only": false,
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 131072,
13
+ "pad_token": "<|eot_id|>",
14
+ "padding_side": "right",
15
+ "tokenizer_class": "TokenizersBackend"
16
+ }
dpo_run/checkpoint-192/trainer_state.json ADDED
@@ -0,0 +1,452 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": 192,
3
+ "best_metric": 0.6124392151832581,
4
+ "best_model_checkpoint": "checkpoints/ft_jais_simdpo/dpo_run/checkpoint-192",
5
+ "epoch": 3.0,
6
+ "eval_steps": 50,
7
+ "global_step": 192,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "entropy": 0.8328714728355407,
14
+ "epoch": 0.15625,
15
+ "grad_norm": 3.5907697677612305,
16
+ "learning_rate": 2.25e-05,
17
+ "logits/chosen": 0.9851744980764,
18
+ "logits/rejected": 0.9132862824057325,
19
+ "logps/chosen": -80.49798936843872,
20
+ "logps/rejected": -87.13544521331787,
21
+ "loss": 0.691208028793335,
22
+ "mean_token_accuracy": 0.8373994886875152,
23
+ "num_tokens": 16910.0,
24
+ "rewards/accuracies": 0.4125,
25
+ "rewards/chosen": 0.005871815676800907,
26
+ "rewards/margins": 0.0046546274214051666,
27
+ "rewards/rejected": 0.0012171887326985597,
28
+ "step": 10
29
+ },
30
+ {
31
+ "entropy": 0.8236085653305054,
32
+ "epoch": 0.3125,
33
+ "grad_norm": 3.045801877975464,
34
+ "learning_rate": 4.75e-05,
35
+ "logits/chosen": 0.9432169298637705,
36
+ "logits/rejected": 0.9300128951388309,
37
+ "logps/chosen": -80.01706008911133,
38
+ "logps/rejected": -86.19765682220459,
39
+ "loss": 0.6912835597991943,
40
+ "mean_token_accuracy": 0.8420414581894875,
41
+ "num_tokens": 33876.0,
42
+ "rewards/accuracies": 0.5625,
43
+ "rewards/chosen": 0.046248766069766134,
44
+ "rewards/margins": 0.0050085548544302584,
45
+ "rewards/rejected": 0.04124021101742983,
46
+ "step": 20
47
+ },
48
+ {
49
+ "entropy": 0.8710977151989937,
50
+ "epoch": 0.46875,
51
+ "grad_norm": 4.131756782531738,
52
+ "learning_rate": 4.9662976890711167e-05,
53
+ "logits/chosen": 0.952295882064034,
54
+ "logits/rejected": 0.8837412199420139,
55
+ "logps/chosen": -83.00751543045044,
56
+ "logps/rejected": -89.77082118988037,
57
+ "loss": 0.6836707592010498,
58
+ "mean_token_accuracy": 0.830362756550312,
59
+ "num_tokens": 51751.0,
60
+ "rewards/accuracies": 0.55,
61
+ "rewards/chosen": 0.19173650545999407,
62
+ "rewards/margins": 0.02175652077421546,
63
+ "rewards/rejected": 0.1699799854774028,
64
+ "step": 30
65
+ },
66
+ {
67
+ "entropy": 0.8702168866991997,
68
+ "epoch": 0.625,
69
+ "grad_norm": 3.4390907287597656,
70
+ "learning_rate": 4.850961997099892e-05,
71
+ "logits/chosen": 0.9335240972164126,
72
+ "logits/rejected": 0.8931220467287231,
73
+ "logps/chosen": -78.64973669052124,
74
+ "logps/rejected": -83.12959709167481,
75
+ "loss": 0.680081558227539,
76
+ "mean_token_accuracy": 0.8323500514030456,
77
+ "num_tokens": 68855.0,
78
+ "rewards/accuracies": 0.575,
79
+ "rewards/chosen": 0.5641312405467034,
80
+ "rewards/margins": 0.03580198623239994,
81
+ "rewards/rejected": 0.5283292587846518,
82
+ "step": 40
83
+ },
84
+ {
85
+ "entropy": 0.8412925243377686,
86
+ "epoch": 0.78125,
87
+ "grad_norm": 3.696289539337158,
88
+ "learning_rate": 4.657412981885862e-05,
89
+ "logits/chosen": 0.9247626503111631,
90
+ "logits/rejected": 0.9220718661915835,
91
+ "logps/chosen": -68.65432586669922,
92
+ "logps/rejected": -82.09786891937256,
93
+ "loss": 0.628887414932251,
94
+ "mean_token_accuracy": 0.8538857877254487,
95
+ "num_tokens": 86484.0,
96
+ "rewards/accuracies": 0.775,
97
+ "rewards/chosen": 1.0782162077724933,
98
+ "rewards/margins": 0.16525846347212791,
99
+ "rewards/rejected": 0.9129577524960041,
100
+ "step": 50
101
+ },
102
+ {
103
+ "epoch": 0.78125,
104
+ "eval_entropy": 0.8311625965710344,
105
+ "eval_logits/chosen": 0.9525682816067235,
106
+ "eval_logits/rejected": 0.9378524862311701,
107
+ "eval_logps/chosen": -70.774687273749,
108
+ "eval_logps/rejected": -77.4474421534045,
109
+ "eval_loss": 0.663590133190155,
110
+ "eval_mean_token_accuracy": 0.8474541881988789,
111
+ "eval_num_tokens": 86484.0,
112
+ "eval_rewards/accuracies": 0.6724137931034483,
113
+ "eval_rewards/chosen": 1.197298473325269,
114
+ "eval_rewards/margins": 0.1253269150339324,
115
+ "eval_rewards/rejected": 1.0719715516115058,
116
+ "eval_runtime": 3.6052,
117
+ "eval_samples_per_second": 15.811,
118
+ "eval_steps_per_second": 8.044,
119
+ "step": 50
120
+ },
121
+ {
122
+ "entropy": 0.9258149698376655,
123
+ "epoch": 0.9375,
124
+ "grad_norm": 9.48177433013916,
125
+ "learning_rate": 4.392089757165841e-05,
126
+ "logits/chosen": 0.9196924747627211,
127
+ "logits/rejected": 0.9150918054479149,
128
+ "logps/chosen": -69.63652791976929,
129
+ "logps/rejected": -74.67644653320312,
130
+ "loss": 0.6724472045898438,
131
+ "mean_token_accuracy": 0.8314912617206573,
132
+ "num_tokens": 103165.0,
133
+ "rewards/accuracies": 0.6,
134
+ "rewards/chosen": 1.612139716744423,
135
+ "rewards/margins": 0.10208179727196694,
136
+ "rewards/rejected": 1.5100578874349595,
137
+ "step": 60
138
+ },
139
+ {
140
+ "entropy": 0.9276665955781936,
141
+ "epoch": 1.09375,
142
+ "grad_norm": 4.742893218994141,
143
+ "learning_rate": 4.0638192674691136e-05,
144
+ "logits/chosen": 0.9372565226225635,
145
+ "logits/rejected": 0.8758297012073308,
146
+ "logps/chosen": -72.57800025939942,
147
+ "logps/rejected": -75.22021579742432,
148
+ "loss": 0.5596485137939453,
149
+ "mean_token_accuracy": 0.8355538666248321,
150
+ "num_tokens": 120923.0,
151
+ "rewards/accuracies": 0.75,
152
+ "rewards/chosen": 1.6647123485803603,
153
+ "rewards/margins": 0.3873647030442953,
154
+ "rewards/rejected": 1.2773476531729102,
155
+ "step": 70
156
+ },
157
+ {
158
+ "entropy": 0.9321356564760208,
159
+ "epoch": 1.25,
160
+ "grad_norm": 3.8452413082122803,
161
+ "learning_rate": 3.683522627621608e-05,
162
+ "logits/chosen": 0.9183959182419773,
163
+ "logits/rejected": 0.8850714484434743,
164
+ "logps/chosen": -73.9180368423462,
165
+ "logps/rejected": -87.95330810546875,
166
+ "loss": 0.4759009838104248,
167
+ "mean_token_accuracy": 0.8352961301803589,
168
+ "num_tokens": 138825.0,
169
+ "rewards/accuracies": 0.8,
170
+ "rewards/chosen": 1.2514840960502625,
171
+ "rewards/margins": 0.6839764896780253,
172
+ "rewards/rejected": 0.5675076065585017,
173
+ "step": 80
174
+ },
175
+ {
176
+ "entropy": 0.9279324404895306,
177
+ "epoch": 1.40625,
178
+ "grad_norm": 5.118920803070068,
179
+ "learning_rate": 3.263851792039109e-05,
180
+ "logits/chosen": 0.8924988958553159,
181
+ "logits/rejected": 0.8284702619552127,
182
+ "logps/chosen": -71.48162698745728,
183
+ "logps/rejected": -83.52158260345459,
184
+ "loss": 0.39791891574859617,
185
+ "mean_token_accuracy": 0.8307904973626137,
186
+ "num_tokens": 155378.0,
187
+ "rewards/accuracies": 0.8875,
188
+ "rewards/chosen": 1.317165607213974,
189
+ "rewards/margins": 0.9690214801579714,
190
+ "rewards/rejected": 0.34814412128180267,
191
+ "step": 90
192
+ },
193
+ {
194
+ "entropy": 0.9241503536701202,
195
+ "epoch": 1.5625,
196
+ "grad_norm": 7.398733615875244,
197
+ "learning_rate": 2.81876864133027e-05,
198
+ "logits/chosen": 0.9289504257072073,
199
+ "logits/rejected": 0.9161463222864651,
200
+ "logps/chosen": -62.29160423278809,
201
+ "logps/rejected": -79.298428440094,
202
+ "loss": 0.41886510848999026,
203
+ "mean_token_accuracy": 0.8381225109100342,
204
+ "num_tokens": 171778.0,
205
+ "rewards/accuracies": 0.7875,
206
+ "rewards/chosen": 1.9696232751011848,
207
+ "rewards/margins": 1.0112529575824738,
208
+ "rewards/rejected": 0.9583703201264143,
209
+ "step": 100
210
+ },
211
+ {
212
+ "epoch": 1.5625,
213
+ "eval_entropy": 0.8753328939964031,
214
+ "eval_logits/chosen": 0.980303409740094,
215
+ "eval_logits/rejected": 0.9663606126464863,
216
+ "eval_logps/chosen": -59.93091070240941,
217
+ "eval_logps/rejected": -69.91863198115908,
218
+ "eval_loss": 0.6545524597167969,
219
+ "eval_mean_token_accuracy": 0.8393763550396623,
220
+ "eval_num_tokens": 171778.0,
221
+ "eval_rewards/accuracies": 0.6551724137931034,
222
+ "eval_rewards/chosen": 2.281676158822816,
223
+ "eval_rewards/margins": 0.45682352164696005,
224
+ "eval_rewards/rejected": 1.8248526556738491,
225
+ "eval_runtime": 3.6534,
226
+ "eval_samples_per_second": 15.602,
227
+ "eval_steps_per_second": 7.938,
228
+ "step": 100
229
+ },
230
+ {
231
+ "entropy": 0.925814239680767,
232
+ "epoch": 1.71875,
233
+ "grad_norm": 8.321379661560059,
234
+ "learning_rate": 2.363080489428391e-05,
235
+ "logits/chosen": 0.9598024684886474,
236
+ "logits/rejected": 0.9392234660386203,
237
+ "logps/chosen": -56.625073719024655,
238
+ "logps/rejected": -75.99530391693115,
239
+ "loss": 0.4041135311126709,
240
+ "mean_token_accuracy": 0.8366730898618698,
241
+ "num_tokens": 189000.0,
242
+ "rewards/accuracies": 0.8,
243
+ "rewards/chosen": 2.5931301951408385,
244
+ "rewards/margins": 1.1382387332618236,
245
+ "rewards/rejected": 1.4548914805054665,
246
+ "step": 110
247
+ },
248
+ {
249
+ "entropy": 0.9351913735270501,
250
+ "epoch": 1.875,
251
+ "grad_norm": 4.9336466789245605,
252
+ "learning_rate": 1.911947464300911e-05,
253
+ "logits/chosen": 0.956082177662182,
254
+ "logits/rejected": 0.9381028811702933,
255
+ "logps/chosen": -54.52532286643982,
256
+ "logps/rejected": -76.56493139266968,
257
+ "loss": 0.34934821128845217,
258
+ "mean_token_accuracy": 0.8426205664873123,
259
+ "num_tokens": 205690.0,
260
+ "rewards/accuracies": 0.8625,
261
+ "rewards/chosen": 2.6219111740589143,
262
+ "rewards/margins": 1.4122635282576084,
263
+ "rewards/rejected": 1.2096476439386605,
264
+ "step": 120
265
+ },
266
+ {
267
+ "entropy": 0.8790753468871116,
268
+ "epoch": 2.03125,
269
+ "grad_norm": 5.272885322570801,
270
+ "learning_rate": 1.4803781510135723e-05,
271
+ "logits/chosen": 0.9955120400997179,
272
+ "logits/rejected": 0.9845384123605191,
273
+ "logps/chosen": -53.220950508117674,
274
+ "logps/rejected": -79.19157724380493,
275
+ "loss": 0.3726229429244995,
276
+ "mean_token_accuracy": 0.8485471993684769,
277
+ "num_tokens": 223246.0,
278
+ "rewards/accuracies": 0.875,
279
+ "rewards/chosen": 2.459031768143177,
280
+ "rewards/margins": 1.4352195501327514,
281
+ "rewards/rejected": 1.023812212049961,
282
+ "step": 130
283
+ },
284
+ {
285
+ "entropy": 0.9056376986205578,
286
+ "epoch": 2.1875,
287
+ "grad_norm": 3.285874605178833,
288
+ "learning_rate": 1.0827302764217886e-05,
289
+ "logits/chosen": 0.9938021062549278,
290
+ "logits/rejected": 0.9681679116775106,
291
+ "logps/chosen": -57.816345596313475,
292
+ "logps/rejected": -82.39878702163696,
293
+ "loss": 0.2858810186386108,
294
+ "mean_token_accuracy": 0.8472737610340119,
295
+ "num_tokens": 241397.0,
296
+ "rewards/accuracies": 0.875,
297
+ "rewards/chosen": 2.5517143607139587,
298
+ "rewards/margins": 1.8401621930301189,
299
+ "rewards/rejected": 0.7115521389991045,
300
+ "step": 140
301
+ },
302
+ {
303
+ "entropy": 0.909576078504324,
304
+ "epoch": 2.34375,
305
+ "grad_norm": 6.196996688842773,
306
+ "learning_rate": 7.3223304703363135e-06,
307
+ "logits/chosen": 1.0399517872536237,
308
+ "logits/rejected": 1.0104635176610677,
309
+ "logps/chosen": -58.187259101867674,
310
+ "logps/rejected": -77.37480745315551,
311
+ "loss": 0.2617202281951904,
312
+ "mean_token_accuracy": 0.8451652511954307,
313
+ "num_tokens": 258092.0,
314
+ "rewards/accuracies": 0.9375,
315
+ "rewards/chosen": 2.578557401895523,
316
+ "rewards/margins": 1.8622532173991204,
317
+ "rewards/rejected": 0.7163041835650802,
318
+ "step": 150
319
+ },
320
+ {
321
+ "epoch": 2.34375,
322
+ "eval_entropy": 0.8786308087151626,
323
+ "eval_logits/chosen": 1.059930572001866,
324
+ "eval_logits/rejected": 1.046939485793307,
325
+ "eval_logps/chosen": -62.954081962848534,
326
+ "eval_logps/rejected": -75.78464692214439,
327
+ "eval_loss": 0.6239838004112244,
328
+ "eval_mean_token_accuracy": 0.838767409324646,
329
+ "eval_num_tokens": 258092.0,
330
+ "eval_rewards/accuracies": 0.6379310344827587,
331
+ "eval_rewards/chosen": 1.979359085189885,
332
+ "eval_rewards/margins": 0.7411079571164888,
333
+ "eval_rewards/rejected": 1.2382511147137345,
334
+ "eval_runtime": 3.4745,
335
+ "eval_samples_per_second": 16.405,
336
+ "eval_steps_per_second": 8.346,
337
+ "step": 150
338
+ },
339
+ {
340
+ "entropy": 0.9093523040413857,
341
+ "epoch": 2.5,
342
+ "grad_norm": 7.856006622314453,
343
+ "learning_rate": 4.405470312171392e-06,
344
+ "logits/chosen": 1.0332511449254072,
345
+ "logits/rejected": 0.9843762032343205,
346
+ "logps/chosen": -58.752701950073245,
347
+ "logps/rejected": -90.71653842926025,
348
+ "loss": 0.1804887056350708,
349
+ "mean_token_accuracy": 0.8449469625949859,
350
+ "num_tokens": 276174.0,
351
+ "rewards/accuracies": 1.0,
352
+ "rewards/chosen": 2.356126905232668,
353
+ "rewards/margins": 2.361818128824234,
354
+ "rewards/rejected": -0.005691254138946533,
355
+ "step": 160
356
+ },
357
+ {
358
+ "entropy": 0.9203343503177166,
359
+ "epoch": 2.65625,
360
+ "grad_norm": 3.6486051082611084,
361
+ "learning_rate": 2.1737622787514593e-06,
362
+ "logits/chosen": 1.0113762496618601,
363
+ "logits/rejected": 0.957087860211527,
364
+ "logps/chosen": -63.05948009490967,
365
+ "logps/rejected": -90.06522645950318,
366
+ "loss": 0.20636234283447266,
367
+ "mean_token_accuracy": 0.8281458497047425,
368
+ "num_tokens": 292776.0,
369
+ "rewards/accuracies": 0.975,
370
+ "rewards/chosen": 2.0332263819873333,
371
+ "rewards/margins": 2.1697853356599808,
372
+ "rewards/rejected": -0.13655893383547663,
373
+ "step": 170
374
+ },
375
+ {
376
+ "entropy": 0.8908936537802219,
377
+ "epoch": 2.8125,
378
+ "grad_norm": 7.6800007820129395,
379
+ "learning_rate": 7.014522753768848e-07,
380
+ "logits/chosen": 1.0685504340633458,
381
+ "logits/rejected": 1.004012635665606,
382
+ "logps/chosen": -59.97100772857666,
383
+ "logps/rejected": -83.78988523483277,
384
+ "loss": 0.30030596256256104,
385
+ "mean_token_accuracy": 0.8450306236743927,
386
+ "num_tokens": 309430.0,
387
+ "rewards/accuracies": 0.875,
388
+ "rewards/chosen": 2.085699033737183,
389
+ "rewards/margins": 1.9329860083758832,
390
+ "rewards/rejected": 0.152713031694293,
391
+ "step": 180
392
+ },
393
+ {
394
+ "entropy": 0.9806399837136268,
395
+ "epoch": 2.96875,
396
+ "grad_norm": 6.668964862823486,
397
+ "learning_rate": 3.7522062854356e-08,
398
+ "logits/chosen": 1.0495178805180392,
399
+ "logits/rejected": 1.0239107221934693,
400
+ "logps/chosen": -63.53562860488891,
401
+ "logps/rejected": -97.54202632904052,
402
+ "loss": 0.17719583511352538,
403
+ "mean_token_accuracy": 0.8237368956208229,
404
+ "num_tokens": 326322.0,
405
+ "rewards/accuracies": 0.9625,
406
+ "rewards/chosen": 2.103805848956108,
407
+ "rewards/margins": 2.5391295909881593,
408
+ "rewards/rejected": -0.43532373029738664,
409
+ "step": 190
410
+ },
411
+ {
412
+ "epoch": 3.0,
413
+ "eval_entropy": 0.8723657192855045,
414
+ "eval_logits/chosen": 1.0758996205438673,
415
+ "eval_logits/rejected": 1.0639617696113528,
416
+ "eval_logps/chosen": -67.85506097201643,
417
+ "eval_logps/rejected": -81.96065271311792,
418
+ "eval_loss": 0.6124392151832581,
419
+ "eval_mean_token_accuracy": 0.8315057775069927,
420
+ "eval_num_tokens": 329799.0,
421
+ "eval_rewards/accuracies": 0.6724137931034483,
422
+ "eval_rewards/chosen": 1.4892611256961166,
423
+ "eval_rewards/margins": 0.868610680103302,
424
+ "eval_rewards/rejected": 0.6206504702568054,
425
+ "eval_runtime": 3.4723,
426
+ "eval_samples_per_second": 16.416,
427
+ "eval_steps_per_second": 8.352,
428
+ "step": 192
429
+ }
430
+ ],
431
+ "logging_steps": 10,
432
+ "max_steps": 192,
433
+ "num_input_tokens_seen": 0,
434
+ "num_train_epochs": 3,
435
+ "save_steps": 100,
436
+ "stateful_callbacks": {
437
+ "TrainerControl": {
438
+ "args": {
439
+ "should_epoch_stop": false,
440
+ "should_evaluate": false,
441
+ "should_log": false,
442
+ "should_save": true,
443
+ "should_training_stop": true
444
+ },
445
+ "attributes": {}
446
+ }
447
+ },
448
+ "total_flos": 2.040512082444288e+16,
449
+ "train_batch_size": 2,
450
+ "trial_name": null,
451
+ "trial_params": null
452
+ }
dpo_run/checkpoint-192/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e2f5c93a150a28b433b4deecef1c96d772331f7a6843d129188a66b41666003
3
+ size 5841
dpo_run/runs/Jul08_10-32-30_704022de3b85/events.out.tfevents.1783506750.704022de3b85.12455.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:908125c075ecaf8ffba995480dc4f8f157a7508cf8b99d8d0d6b2aaf3cde14d8
3
+ size 25303
merged/chat_template.jinja ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined %}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if not tools_in_user_message is defined %}
6
+ {%- set tools_in_user_message = true %}
7
+ {%- endif %}
8
+ {%- if not date_string is defined %}
9
+ {%- set date_string = "26 Jul 2024" %}
10
+ {%- endif %}
11
+ {%- if not tools is defined %}
12
+ {%- set tools = none %}
13
+ {%- endif %}
14
+
15
+ {#- This block extracts the system message, so we can slot it into the right place. #}
16
+ {%- if messages[0]['role'] == 'system' %}
17
+ {%- set system_message = messages[0]['content']|trim %}
18
+ {%- set messages = messages[1:] %}
19
+ {%- else %}
20
+ {%- set system_message = "" %}
21
+ {%- endif %}
22
+
23
+ {#- System message + builtin tools #}
24
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
25
+ {%- if builtin_tools is defined or tools is not none %}
26
+ {{- "Environment: ipython\n" }}
27
+ {%- endif %}
28
+ {%- if builtin_tools is defined %}
29
+ {{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
30
+ {%- endif %}
31
+ {{- "Cutting Knowledge Date: December 2023\n" }}
32
+ {{- "Today Date: " + date_string + "\n\n" }}
33
+ {%- if tools is not none and not tools_in_user_message %}
34
+ {{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
35
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
36
+ {{- "Do not use variables.\n\n" }}
37
+ {%- for t in tools %}
38
+ {{- t | tojson(indent=4) }}
39
+ {{- "\n\n" }}
40
+ {%- endfor %}
41
+ {%- endif %}
42
+ {{- system_message }}
43
+ {{- "<|eot_id|>" }}
44
+
45
+ {#- Custom tools are passed in a user message with some extra guidance #}
46
+ {%- if tools_in_user_message and not tools is none %}
47
+ {#- Extract the first user message so we can plug it in here #}
48
+ {%- if messages | length != 0 %}
49
+ {%- set first_user_message = messages[0]['content']|trim %}
50
+ {%- set messages = messages[1:] %}
51
+ {%- else %}
52
+ {{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
53
+ {%- endif %}
54
+ {{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
55
+ {{- "Given the following functions, please respond with a JSON for a function call " }}
56
+ {{- "with its proper arguments that best answers the given prompt.\n\n" }}
57
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
58
+ {{- "Do not use variables.\n\n" }}
59
+ {%- for t in tools %}
60
+ {{- t | tojson(indent=4) }}
61
+ {{- "\n\n" }}
62
+ {%- endfor %}
63
+ {{- first_user_message + "<|eot_id|>"}}
64
+ {%- endif %}
65
+
66
+ {%- for message in messages %}
67
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
68
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
69
+ {%- elif 'tool_calls' in message %}
70
+ {%- if not message.tool_calls|length == 1 %}
71
+ {{- raise_exception("This model only supports single tool-calls at once!") }}
72
+ {%- endif %}
73
+ {%- set tool_call = message.tool_calls[0].function %}
74
+ {%- if builtin_tools is defined and tool_call.name in builtin_tools %}
75
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
76
+ {{- "<|python_tag|>" + tool_call.name + ".call(" }}
77
+ {%- for arg_name, arg_val in tool_call.arguments | items %}
78
+ {{- arg_name + '="' + arg_val + '"' }}
79
+ {%- if not loop.last %}
80
+ {{- ", " }}
81
+ {%- endif %}
82
+ {%- endfor %}
83
+ {{- ")" }}
84
+ {%- else %}
85
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
86
+ {{- '{"name": "' + tool_call.name + '", ' }}
87
+ {{- '"parameters": ' }}
88
+ {{- tool_call.arguments | tojson }}
89
+ {{- "}" }}
90
+ {%- endif %}
91
+ {%- if builtin_tools is defined %}
92
+ {#- This means we're in ipython mode #}
93
+ {{- "<|eom_id|>" }}
94
+ {%- else %}
95
+ {{- "<|eot_id|>" }}
96
+ {%- endif %}
97
+ {%- elif message.role == "tool" or message.role == "ipython" %}
98
+ {{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
99
+ {%- if message.content is mapping or message.content is iterable %}
100
+ {{- message.content | tojson }}
101
+ {%- else %}
102
+ {{- message.content }}
103
+ {%- endif %}
104
+ {{- "<|eot_id|>" }}
105
+ {%- endif %}
106
+ {%- endfor %}
107
+ {%- if add_generation_prompt %}
108
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
109
+ {%- endif %}
merged/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 128000,
8
+ "dtype": "float16",
9
+ "eos_token_id": [
10
+ 128001,
11
+ 128008,
12
+ 128009
13
+ ],
14
+ "head_dim": 128,
15
+ "hidden_act": "silu",
16
+ "hidden_size": 4096,
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 14336,
19
+ "max_position_embeddings": 131072,
20
+ "mlp_bias": false,
21
+ "model_type": "llama",
22
+ "num_attention_heads": 32,
23
+ "num_hidden_layers": 32,
24
+ "num_key_value_heads": 8,
25
+ "pad_token_id": null,
26
+ "pretraining_tp": 1,
27
+ "rms_norm_eps": 1e-05,
28
+ "rope_parameters": {
29
+ "factor": 8.0,
30
+ "high_freq_factor": 4.0,
31
+ "low_freq_factor": 1.0,
32
+ "original_max_position_embeddings": 8192,
33
+ "rope_theta": 500000.0,
34
+ "rope_type": "llama3"
35
+ },
36
+ "tie_word_embeddings": false,
37
+ "transformers_version": "5.13.0",
38
+ "use_cache": true,
39
+ "vocab_size": 128256
40
+ }
merged/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": "5.13.0"
12
+ }
merged/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7083cf9a27da0ba2afbf22f012784bbcf5c582ce269de259925977feedd6e0c
3
+ size 16060556328
merged/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
merged/tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|eot_id|>",
6
+ "is_local": true,
7
+ "local_files_only": false,
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 131072,
13
+ "pad_token": "<|eot_id|>",
14
+ "padding_side": "right",
15
+ "tokenizer_class": "TokenizersBackend"
16
+ }