Evan-Lin commited on
Commit
9620728
1 Parent(s): d83eb7f

Evan-Lin/dpo-llama-chat

Browse files
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ tags:
4
+ - trl
5
+ - dpo
6
+ - generated_from_trainer
7
+ base_model: meta-llama/Llama-2-7b-chat-hf
8
+ model-index:
9
+ - name: dpo-llama-chat-without-none
10
+ results: []
11
+ ---
12
+
13
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
14
+ should probably proofread and complete it, then remove this comment. -->
15
+
16
+ # dpo-llama-chat-without-none
17
+
18
+ This model is a fine-tuned version of [meta-llama/Llama-2-7b-chat-hf](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf) on the None dataset.
19
+ It achieves the following results on the evaluation set:
20
+ - Loss: 0.0177
21
+ - Rewards/chosen: -5.0689
22
+ - Rewards/rejected: -14.1911
23
+ - Rewards/accuracies: 0.9933
24
+ - Rewards/margins: 9.1223
25
+ - Logps/rejected: -230.9264
26
+ - Logps/chosen: -147.4190
27
+ - Logits/rejected: -0.6518
28
+ - Logits/chosen: -0.6273
29
+
30
+ ## Model description
31
+
32
+ More information needed
33
+
34
+ ## Intended uses & limitations
35
+
36
+ More information needed
37
+
38
+ ## Training and evaluation data
39
+
40
+ More information needed
41
+
42
+ ## Training procedure
43
+
44
+ ### Training hyperparameters
45
+
46
+ The following hyperparameters were used during training:
47
+ - learning_rate: 0.0001
48
+ - train_batch_size: 2
49
+ - eval_batch_size: 2
50
+ - seed: 42
51
+ - distributed_type: multi-GPU
52
+ - num_devices: 2
53
+ - gradient_accumulation_steps: 64
54
+ - total_train_batch_size: 256
55
+ - total_eval_batch_size: 4
56
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
57
+ - lr_scheduler_type: cosine
58
+ - lr_scheduler_warmup_steps: 50
59
+ - training_steps: 1000
60
+
61
+ ### Training results
62
+
63
+ | Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
64
+ |:-------------:|:-----:|:----:|:---------------:|:--------------:|:----------------:|:------------------:|:---------------:|:--------------:|:------------:|:---------------:|:-------------:|
65
+ | 0.2627 | 1.92 | 100 | 0.2451 | -1.0090 | -3.0456 | 0.9240 | 2.0366 | -119.4711 | -106.8200 | -0.8708 | -0.8600 |
66
+ | 0.0386 | 3.84 | 200 | 0.0708 | -2.3491 | -7.1127 | 0.9813 | 4.7636 | -160.1419 | -120.2212 | -0.8381 | -0.8197 |
67
+ | 0.0147 | 5.76 | 300 | 0.0424 | -2.9584 | -8.9699 | 0.9840 | 6.0115 | -178.7142 | -126.3143 | -0.7736 | -0.7537 |
68
+ | 0.005 | 7.69 | 400 | 0.0294 | -3.7997 | -11.1138 | 0.9907 | 7.3141 | -200.1534 | -134.7274 | -0.7233 | -0.6967 |
69
+ | 0.002 | 9.61 | 500 | 0.0186 | -4.4609 | -12.4831 | 0.9947 | 8.0222 | -213.8460 | -141.3395 | -0.6848 | -0.6600 |
70
+ | 0.0008 | 11.53 | 600 | 0.0193 | -4.8300 | -13.5310 | 0.9947 | 8.7010 | -224.3250 | -145.0307 | -0.6646 | -0.6397 |
71
+ | 0.0006 | 13.45 | 700 | 0.0166 | -4.8968 | -13.8306 | 0.9947 | 8.9338 | -227.3210 | -145.6982 | -0.6552 | -0.6304 |
72
+ | 0.0005 | 15.37 | 800 | 0.0179 | -4.9970 | -14.0354 | 0.9933 | 9.0383 | -229.3687 | -146.7007 | -0.6498 | -0.6253 |
73
+ | 0.0005 | 17.29 | 900 | 0.0156 | -5.0417 | -14.1518 | 0.9947 | 9.1101 | -230.5333 | -147.1470 | -0.6492 | -0.6245 |
74
+ | 0.0005 | 19.21 | 1000 | 0.0177 | -5.0689 | -14.1911 | 0.9933 | 9.1223 | -230.9264 | -147.4190 | -0.6518 | -0.6273 |
75
+
76
+
77
+ ### Framework versions
78
+
79
+ - PEFT 0.7.1
80
+ - Transformers 4.36.2
81
+ - Pytorch 2.1.2+cu121
82
+ - Datasets 2.16.1
83
+ - Tokenizers 0.15.1
adapter_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "meta-llama/Llama-2-7b-chat-hf",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "loftq_config": {},
12
+ "lora_alpha": 16,
13
+ "lora_dropout": 0.05,
14
+ "megatron_config": null,
15
+ "megatron_core": "megatron.core",
16
+ "modules_to_save": null,
17
+ "peft_type": "LORA",
18
+ "r": 8,
19
+ "rank_pattern": {},
20
+ "revision": null,
21
+ "target_modules": [
22
+ "v_proj",
23
+ "out_proj",
24
+ "wte",
25
+ "k_proj",
26
+ "fc_out",
27
+ "q_proj",
28
+ "fc_in"
29
+ ],
30
+ "task_type": "CAUSAL_LM"
31
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:141dd4ed5d7add238576f244954362a8b9fdbb6e8f8f2bbb1bbfcb8157e84cff
3
+ size 25191360
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "</s>",
17
+ "unk_token": {
18
+ "content": "<unk>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ }
29
+ },
30
+ "bos_token": "<s>",
31
+ "chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>\\n' + system_message + '\\n<</SYS>>\\n\\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "legacy": false,
35
+ "model_max_length": 1000000000000000019884624838656,
36
+ "pad_token": "</s>",
37
+ "padding_side": "right",
38
+ "sp_model_kwargs": {},
39
+ "tokenizer_class": "LlamaTokenizer",
40
+ "unk_token": "<unk>",
41
+ "use_default_system_prompt": false
42
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf62c053ab3ff182f15262d4beb891b4d1ce3a524d83c6987386d6d7a82fd48c
3
+ size 4728