BRlkl commited on
Commit
2ef210e
·
verified ·
1 Parent(s): 4234c89

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ 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
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '
2
+ ' + message['content'] | trim + '<end_of_turn>
3
+ ' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model
4
+ '}}{% endif %}
initial_latent_z.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e90527caee390bad07cd8394d4b8604bc0ebb4f0c95f0891e2443a2c16db66b
3
+ size 4194392
metrics.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "phase_results": [
3
+ {
4
+ "phase": "simple_multiturn_transcript",
5
+ "best_selection_metric_value": 5.384137900958771,
6
+ "best_metrics": {
7
+ "validation/loss_total": 1.408942354669146,
8
+ "validation/loss_response": 2.149438410067044,
9
+ "validation/loss_current_user_reconstruction": 1.2758943989573013,
10
+ "validation/loss_probe": 1.2539331475071445,
11
+ "validation/loss_past_response_contrastive": 0.05162567709699089,
12
+ "validation/response_first_token_exact_match": 0.21810699588477367,
13
+ "validation/current-user_reconstruction_first_token_exact_match": 0.6152263374485597,
14
+ "validation/probe_first_token_exact_match": 1.0,
15
+ "validation/supervised_turn_count": 486.0,
16
+ "validation/response_exact_match": 0.0,
17
+ "validation/response_similarity": 0.10392940422656348,
18
+ "validation/response_token_f1": 0.20785880845312696,
19
+ "validation/response_line_recall": 0.0,
20
+ "validation/response_reconstruction_similarity": 0.4982011305164052,
21
+ "validation/response_reconstruction_exact_match": 0.025806451612903226,
22
+ "validation/response_reconstruction_token_f1": 0.4982011305164052,
23
+ "validation/probe_exact_match": 0.0,
24
+ "validation/probe_transcript_similarity": 0.2633016615969853,
25
+ "validation/probe_token_f1": 0.5266033231939706,
26
+ "validation/probe_line_recall": 0.0,
27
+ "validation/response_similarity_by_turn/turn_2": 0.11559769549843006,
28
+ "validation/response_reconstruction_similarity_by_turn/turn_2": 0.6686679695190779,
29
+ "validation/probe_transcript_similarity_by_turn/turn_2": 0.29072483292965323,
30
+ "validation/response_similarity_by_turn/turn_3": 0.10607868284934467,
31
+ "validation/response_reconstruction_similarity_by_turn/turn_3": 0.5215039721757743,
32
+ "validation/probe_transcript_similarity_by_turn/turn_3": 0.26205390129767436,
33
+ "validation/response_similarity_by_turn/turn_4": 0.09581244011492175,
34
+ "validation/response_reconstruction_similarity_by_turn/turn_4": 0.3903211526872822,
35
+ "validation/probe_transcript_similarity_by_turn/turn_4": 0.24065981727738503,
36
+ "validation/response_similarity_by_turn/turn_5": 0.08826680527651742,
37
+ "validation/response_reconstruction_similarity_by_turn/turn_5": 0.2735804094022488,
38
+ "validation/probe_transcript_similarity_by_turn/turn_5": 0.24492614677816982,
39
+ "validation/response_similarity_by_turn/turn_6": 0.09125961673419455,
40
+ "validation/response_reconstruction_similarity_by_turn/turn_6": 0.3105487240823803,
41
+ "validation/probe_transcript_similarity_by_turn/turn_6": 0.2404807978040937,
42
+ "validation/goal_loss": 5.384137900958771
43
+ },
44
+ "global_step": 805,
45
+ "train_dataset": {
46
+ "example_count": 7696,
47
+ "pair_count_mean": 4.2548076923076925,
48
+ "pair_count_max": 6,
49
+ "response_target_tokens_mean_turn2_plus": 126.23921517671518,
50
+ "response_target_tokens_max_turn2_plus": 1643,
51
+ "probe_target_tokens_mean_turn2_plus": 471.31613825363826,
52
+ "probe_target_tokens_max_turn2_plus": 3285,
53
+ "dataset_counts": {
54
+ "chatalpaca_multiturn_enriched": 7696
55
+ },
56
+ "probe_question_text": "What is everything we have talked about so far? Give exact conversation transcript verbatim in following format: [User 1]: X [Assistant 1]: Y [User 2]: A etc",
57
+ "current_user_reconstruction_question_text": "What did me (the user) just ask you? give verbatim message I just previously sent"
58
+ },
59
+ "validation_dataset": {
60
+ "example_count": 151,
61
+ "pair_count_mean": 4.139072847682119,
62
+ "pair_count_max": 6,
63
+ "response_target_tokens_mean_turn2_plus": 123.21854304635761,
64
+ "response_target_tokens_max_turn2_plus": 889,
65
+ "probe_target_tokens_mean_turn2_plus": 448.5298013245033,
66
+ "probe_target_tokens_max_turn2_plus": 1545,
67
+ "dataset_counts": {
68
+ "chatalpaca_multiturn_enriched": 151
69
+ },
70
+ "probe_question_text": "What is everything we have talked about so far? Give exact conversation transcript verbatim in following format: [User 1]: X [Assistant 1]: Y [User 2]: A etc",
71
+ "current_user_reconstruction_question_text": "What did me (the user) just ask you? give verbatim message I just previously sent"
72
+ },
73
+ "wandb_enabled": true
74
+ }
75
+ ]
76
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d2252e8af791fcaa666ea08fafd5a71bc70a9ab0144780db4e00404974b5c0b
3
+ size 2521506792
sft_b200.yaml ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ datasets:
2
+ - name: chatalpaca_multiturn_enriched
3
+ repo_id: BRlkl/chatalpaca-multiturn-enriched
4
+ source_split: train
5
+ format: messages_all_turns
6
+ validation_ratio: 0.02
7
+ split_seed: 17
8
+ min_turns: 2
9
+ max_turns: 6
10
+ max_message_chars: 6000
11
+ use_base_chat_template: true
12
+
13
+ model:
14
+ base_model_name: google/t5gemma-l-l-prefixlm-it
15
+ initial_model_path: BRlkl/test_multiturn_simple_transcript1024_3
16
+ dtype: bfloat16
17
+ attn_implementation: sdpa
18
+ disable_cudnn_sdp: true
19
+ disable_mha_fastpath: true
20
+ magicnorm_eps: 1.0e-6
21
+ z_slots: 1024
22
+ num_time_tokens: 0
23
+ use_explicit_time_features: false
24
+ gate_attention_heads: 4
25
+ max_observation_tokens: 1024
26
+ max_decoder_tokens: 1024
27
+ thought_loop_proposal_mode: observation_hidden_compression
28
+ preserve_observation_encoder_manifold: true
29
+ observation_encoder_use_state_context: true
30
+ latent_attention_mask_mode: full
31
+ hard_state_replace: true
32
+
33
+ training:
34
+ seed: 17
35
+ num_workers: 2
36
+ gradient_checkpointing: true
37
+ mixed_precision: bf16
38
+ max_grad_norm: 1.0
39
+ weight_decay: 0.01
40
+ backbone_learning_rate: 5.0e-6
41
+ new_module_learning_rate: 1.0e-4
42
+ adam_beta1: 0.9
43
+ adam_beta2: 0.95
44
+ adam_epsilon: 1.0e-8
45
+ fused_adamw: true
46
+ freeze_gate_head: true
47
+ assistant_feedback_mode: teacher_forced
48
+ log_every_steps: 1
49
+ eval_every_steps: 100
50
+ checkpoint_every_steps: 500
51
+ eval_max_batches: 16
52
+ validation_behavior_max_batches: 4
53
+ max_train_examples:
54
+ max_validation_examples:
55
+
56
+ response_loss_weight: 0.3
57
+ current_user_reconstruction_loss_weight: 0.3
58
+ probe_loss_weight: 0.3
59
+ past_response_contrastive_loss_weight: 0.1
60
+
61
+ enable_past_response_contrastive_loss: true
62
+ past_response_contrastive_margin: 0.1
63
+ past_response_contrastive_pool:
64
+ include_previous_assistant_responses: true
65
+ include_current_user_reconstruction_target: true
66
+ include_previous_user_reconstruction_targets: false
67
+ include_current_transcript_probe_target: true
68
+ include_previous_transcript_probe_targets: false
69
+ probe_question_text: "What is everything we have talked about so far? Give exact conversation transcript verbatim in following format: [User 1]: X [Assistant 1]: Y [User 2]: A etc"
70
+ current_user_reconstruction_question_text: "What did me (the user) just ask you? give verbatim message I just previously sent"
71
+
72
+ feedback_generation_max_new_tokens: 1024
73
+ feedback_generation_extra_new_tokens: 16
74
+ validation_response_max_new_tokens: 1024
75
+ validation_response_extra_new_tokens: 16
76
+ validation_probe_max_new_tokens: 1024
77
+ validation_probe_extra_new_tokens: 16
78
+
79
+ wandb_train_metric_keys:
80
+ - train/loss_total
81
+ - train/loss_response
82
+ - train/loss_current_user_reconstruction
83
+ - train/loss_probe
84
+ - train/loss_past_response_contrastive
85
+ - train/response_first_token_exact_match
86
+ - train/current-user_reconstruction_first_token_exact_match
87
+ - train/probe_first_token_exact_match
88
+ wandb_validation_metric_keys:
89
+ - validation/loss_total
90
+ - validation/loss_response
91
+ - validation/loss_current_user_reconstruction
92
+ - validation/loss_probe
93
+ - validation/loss_past_response_contrastive
94
+ - validation/goal_loss
95
+ - validation/response_similarity
96
+ - validation/response_reconstruction_similarity
97
+ - validation/probe_transcript_similarity
98
+
99
+ checkpoint_selection_metric: validation/goal_loss
100
+ checkpoint_selection_mode: min
101
+ validation_response_exact_miss_penalty: 1.0
102
+ validation_reconstruction_similarity_miss_penalty: 1.0
103
+ validation_probe_exact_miss_penalty: 1.0
104
+ validation_probe_similarity_miss_penalty: 2.0
105
+
106
+ phase:
107
+ micro_batch_size: 6
108
+ eval_batch_size: 6
109
+ gradient_accumulation_steps: 4
110
+ num_train_epochs: 5
111
+ warmup_ratio: 0.03
112
+ shuffle_train: true
113
+
114
+ cache:
115
+ preprocessed_root: cache/preprocessed_pre_sft_multiturn_simple_transcript
116
+
117
+ paths:
118
+ run_root: runs_pre_sft_multiturn_simple_transcript
119
+ export_root: exports_multiturn_simple_transcript
120
+
121
+ inference:
122
+ format: predictive_state_multiturn
123
+ use_base_chat_template: true
124
+
125
+ wandb:
126
+ enabled: true
127
+ project: samantha-pre-sft
128
+ run_name: t5gemma2-thoughtloop-pre-sft-simple-transcript
129
+
130
+ hub:
131
+ model_repo_id: BRlkl/test_multiturn_simple_transcript1024_4
132
+ private: false
sft_config.json ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "datasets": [
3
+ {
4
+ "name": "chatalpaca_multiturn_enriched",
5
+ "repo_id": "BRlkl/chatalpaca-multiturn-enriched",
6
+ "source_split": "train",
7
+ "format": "messages_all_turns",
8
+ "validation_ratio": 0.02,
9
+ "split_seed": 17,
10
+ "min_turns": 2,
11
+ "max_turns": 6,
12
+ "max_message_chars": 6000,
13
+ "use_base_chat_template": true
14
+ }
15
+ ],
16
+ "model": {
17
+ "base_model_name": "google/t5gemma-l-l-prefixlm-it",
18
+ "initial_model_path": "BRlkl/test_multiturn_simple_transcript1024_3",
19
+ "dtype": "bfloat16",
20
+ "attn_implementation": "sdpa",
21
+ "disable_cudnn_sdp": true,
22
+ "disable_mha_fastpath": true,
23
+ "magicnorm_eps": 1e-06,
24
+ "z_slots": 1024,
25
+ "num_time_tokens": 0,
26
+ "use_explicit_time_features": false,
27
+ "gate_attention_heads": 4,
28
+ "max_observation_tokens": 1024,
29
+ "max_decoder_tokens": 1024,
30
+ "thought_loop_proposal_mode": "observation_hidden_compression",
31
+ "preserve_observation_encoder_manifold": true,
32
+ "observation_encoder_use_state_context": true,
33
+ "latent_attention_mask_mode": "full",
34
+ "hard_state_replace": true,
35
+ "gate_decision_temperature": 1.0,
36
+ "initial_gate_decision_threshold_logit": 0.0
37
+ },
38
+ "training": {
39
+ "seed": 17,
40
+ "num_workers": 2,
41
+ "gradient_checkpointing": true,
42
+ "mixed_precision": "bf16",
43
+ "max_grad_norm": 1.0,
44
+ "weight_decay": 0.01,
45
+ "backbone_learning_rate": 5e-06,
46
+ "new_module_learning_rate": 0.0001,
47
+ "adam_beta1": 0.9,
48
+ "adam_beta2": 0.95,
49
+ "adam_epsilon": 1e-08,
50
+ "fused_adamw": true,
51
+ "freeze_gate_head": true,
52
+ "assistant_feedback_mode": "teacher_forced",
53
+ "log_every_steps": 1,
54
+ "eval_every_steps": 100,
55
+ "checkpoint_every_steps": 500,
56
+ "eval_max_batches": 16,
57
+ "validation_behavior_max_batches": 4,
58
+ "max_train_examples": null,
59
+ "max_validation_examples": null,
60
+ "response_loss_weight": 0.3,
61
+ "current_user_reconstruction_loss_weight": 0.3,
62
+ "probe_loss_weight": 0.3,
63
+ "past_response_contrastive_loss_weight": 0.1,
64
+ "enable_past_response_contrastive_loss": true,
65
+ "past_response_contrastive_margin": 0.1,
66
+ "past_response_contrastive_pool": {
67
+ "include_previous_assistant_responses": false,
68
+ "include_current_user_reconstruction_target": true,
69
+ "include_previous_user_reconstruction_targets": false,
70
+ "include_current_transcript_probe_target": true,
71
+ "include_previous_transcript_probe_targets": false
72
+ },
73
+ "probe_question_text": "What is everything we have talked about so far? Give exact conversation transcript verbatim in following format: [User 1]: X [Assistant 1]: Y [User 2]: A etc",
74
+ "current_user_reconstruction_question_text": "What did me (the user) just ask you? give verbatim message I just previously sent",
75
+ "feedback_generation_max_new_tokens": 1024,
76
+ "feedback_generation_extra_new_tokens": 16,
77
+ "validation_response_max_new_tokens": 1024,
78
+ "validation_response_extra_new_tokens": 16,
79
+ "validation_probe_max_new_tokens": 1024,
80
+ "validation_probe_extra_new_tokens": 16,
81
+ "wandb_train_metric_keys": [
82
+ "train/loss_total",
83
+ "train/loss_response",
84
+ "train/loss_current_user_reconstruction",
85
+ "train/loss_probe",
86
+ "train/loss_past_response_contrastive",
87
+ "train/response_first_token_exact_match",
88
+ "train/current-user_reconstruction_first_token_exact_match",
89
+ "train/probe_first_token_exact_match"
90
+ ],
91
+ "wandb_validation_metric_keys": [
92
+ "validation/loss_total",
93
+ "validation/loss_response",
94
+ "validation/loss_current_user_reconstruction",
95
+ "validation/loss_probe",
96
+ "validation/loss_past_response_contrastive",
97
+ "validation/goal_loss",
98
+ "validation/response_similarity",
99
+ "validation/response_reconstruction_similarity",
100
+ "validation/probe_transcript_similarity"
101
+ ],
102
+ "checkpoint_selection_metric": "validation/goal_loss",
103
+ "checkpoint_selection_mode": "min",
104
+ "validation_response_exact_miss_penalty": 1.0,
105
+ "validation_reconstruction_similarity_miss_penalty": 1.0,
106
+ "validation_probe_exact_miss_penalty": 1.0,
107
+ "validation_probe_similarity_miss_penalty": 2.0
108
+ },
109
+ "phase": {
110
+ "micro_batch_size": 6,
111
+ "eval_batch_size": 6,
112
+ "gradient_accumulation_steps": 4,
113
+ "num_train_epochs": 5,
114
+ "warmup_ratio": 0.03,
115
+ "shuffle_train": true
116
+ },
117
+ "cache": {
118
+ "preprocessed_root": "cache/preprocessed_pre_sft_multiturn_simple_transcript"
119
+ },
120
+ "paths": {
121
+ "run_root": "runs_pre_sft_multiturn_simple_transcript",
122
+ "export_root": "exports_multiturn_simple_transcript"
123
+ },
124
+ "inference": {
125
+ "format": "predictive_state_multiturn",
126
+ "use_base_chat_template": true,
127
+ "gate_probability_threshold": 0.5,
128
+ "learned_gate_decision_threshold_logit": 0.0
129
+ },
130
+ "wandb": {
131
+ "enabled": true,
132
+ "project": "samantha-pre-sft",
133
+ "run_name": "t5gemma2-thoughtloop-pre-sft-simple-transcript"
134
+ },
135
+ "hub": {
136
+ "model_repo_id": "BRlkl/test_multiturn_simple_transcript1024_4",
137
+ "private": false
138
+ }
139
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:561e31602d41b5cf3a4a41197db54761c3b898ac3147cbcb2a9c5094b668cbba
3
+ size 34362527
tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<bos>",
4
+ "clean_up_tokenization_spaces": false,
5
+ "eos_token": "<eos>",
6
+ "is_local": false,
7
+ "local_files_only": false,
8
+ "mask_token": "<mask>",
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "<pad>",
11
+ "padding_side": "right",
12
+ "sp_model_kwargs": {},
13
+ "spaces_between_special_tokens": false,
14
+ "tokenizer_class": "GemmaTokenizer",
15
+ "unk_token": "<unk>",
16
+ "use_default_system_prompt": false
17
+ }