AlbertTan commited on
Commit
e993946
·
verified ·
1 Parent(s): 9221e70

Upload 15 files

Browse files
Files changed (15) hide show
  1. logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/checkpoints/epoch19__step8320__monitor0.070.ckpt +3 -0
  2. logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/events.out.tfevents.1747131676.tj-3008206-m-llama-ccot24-bs16-copy-master-0.46.0 +3 -0
  3. logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/events.out.tfevents.1747133876.tj-3008206-m-llama-ccot24-bs16-copy-master-0.46.1 +3 -0
  4. logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/hparams.yaml +204 -0
  5. logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/log.txt +155 -0
  6. logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/test_20250513-185756.json +0 -0
  7. logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/train.json +0 -0
  8. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/checkpoints/epoch21__step9152__monitor0.094.ckpt +3 -0
  9. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/checkpoints/last.ckpt +3 -0
  10. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/events.out.tfevents.1747137282.tj-3008206-m-qw1b-ccot24-bs16-mse-master-0.45.0 +3 -0
  11. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/events.out.tfevents.1747139343.tj-3008206-m-qw1b-ccot24-bs16-mse-master-0.45.1 +3 -0
  12. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/hparams.yaml +203 -0
  13. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/log.txt +155 -0
  14. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/test_20250513-202903.json +0 -0
  15. logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/train.json +0 -0
logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/checkpoints/epoch19__step8320__monitor0.070.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e164d77bdc554345d0992f5ba117c2c9ea4a6778eca1332798b3d177f192172
3
+ size 121746616
logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/events.out.tfevents.1747131676.tj-3008206-m-llama-ccot24-bs16-copy-master-0.46.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccf4646e1f2deb5abf6ccbfa387c35fe576d36cebc387b7ea76aa9f00dd86bef
3
+ size 373798
logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/events.out.tfevents.1747133876.tj-3008206-m-llama-ccot24-bs16-copy-master-0.46.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55bf56f39cd085a21e7e54ceabc739b3da239001a58c4590daa6c07239e2e61c
3
+ size 17866
logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/hparams.yaml ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model_kwargs:
2
+ model_id: Llama-3.2-1B-Instruct
3
+ depth: 1
4
+ sft_method: compressed_latent_cot
5
+ set_pad_as_last_token: false
6
+ do_lora: true
7
+ lora_config:
8
+ r: 128
9
+ lora_alpha: 32
10
+ coconut_config:
11
+ n_epochs_per_stage: 2
12
+ max_n_stage: 3
13
+ n_latents_per_step: 2
14
+ current_stage: 1
15
+ codi_config:
16
+ codi_proj: false
17
+ n_latents: 6
18
+ alpha: 1
19
+ beta: 1
20
+ gamma: 20
21
+ latent_cot_config:
22
+ ce_weight: 1
23
+ embed_modeling_weight: 1
24
+ embed_modeling_loss: nll
25
+ entropy_weight: 0
26
+ pred_embed_forward_weight: 1
27
+ max_compression_r: 4
28
+ pred_compressed_cot: true
29
+ replace_r_with_auto_prob: 0
30
+ sqrt_mean: true
31
+ latent_policy_config:
32
+ lp_determinisitc: false
33
+ lp_intermediate_size: 2048
34
+ latent_generation_config:
35
+ max_n_latent_forward: 256
36
+ latent_temperature: 1.0
37
+ compression_r: 2
38
+ answer_generation_config:
39
+ max_new_tokens: 16
40
+ do_sample: true
41
+ top_p: 0.9
42
+ temperature: 1.0
43
+ do_rl: false
44
+ rl_config:
45
+ random_speed_in_group: false
46
+ filter_dataset: false
47
+ exp_batch_size: 8
48
+ group_size: 8
49
+ punish_latent_length: false
50
+ clip_grad_norm: 1.0
51
+ clip_eps: 0.2
52
+ use_latent_loss: true
53
+ use_answer_loss: true
54
+ n_train_samples_per_epoch: 4096
55
+ training_kwargs:
56
+ optimizer:
57
+ target: torch.optim.AdamW
58
+ lr: 0.0001
59
+ weight_decay: 0.01
60
+ use_scheduler: false
61
+ scheduler:
62
+ target: constant_schedule_with_warmup
63
+ warmup_steps: 1000
64
+ all_config:
65
+ trainer:
66
+ target: lightning.pytorch.trainer.Trainer
67
+ devices:
68
+ - 0
69
+ - 1
70
+ - 2
71
+ - 3
72
+ - 4
73
+ - 5
74
+ - 6
75
+ - 7
76
+ max_steps: -1
77
+ check_val_every_n_epoch: 1
78
+ log_every_n_steps: 10
79
+ num_sanity_val_steps: 2
80
+ gradient_clip_val: null
81
+ reload_dataloaders_every_n_epochs: 0
82
+ accumulate_grad_batches: 1
83
+ precision: bf16-mixed
84
+ use_distributed_sampler: true
85
+ strategy: auto
86
+ logger:
87
+ target: lightning.pytorch.loggers.TensorBoardLogger
88
+ save_dir: logs/latent_cot
89
+ name: qsa-math
90
+ version: 20250513-181936_723990_m-llama-ccot24-bs16
91
+ max_epochs: 25
92
+ callbacks:
93
+ - target: lightning.pytorch.callbacks.ModelCheckpoint
94
+ save_last: true
95
+ save_top_k: 3
96
+ mode: max
97
+ monitor: monitor
98
+ auto_insert_metric_name: false
99
+ filename: epoch{epoch}__step{step}__monitor{monitor:.3f}
100
+ save_weights_only: true
101
+ seed: null
102
+ model:
103
+ target: src.models.latent_cot.LitLatentReasoning
104
+ model_kwargs:
105
+ model_id: Llama-3.2-1B-Instruct
106
+ depth: 1
107
+ sft_method: compressed_latent_cot
108
+ set_pad_as_last_token: false
109
+ do_lora: true
110
+ lora_config:
111
+ r: 128
112
+ lora_alpha: 32
113
+ coconut_config:
114
+ n_epochs_per_stage: 2
115
+ max_n_stage: 3
116
+ n_latents_per_step: 2
117
+ current_stage: 1
118
+ codi_config:
119
+ codi_proj: false
120
+ n_latents: 6
121
+ alpha: 1
122
+ beta: 1
123
+ gamma: 20
124
+ latent_cot_config:
125
+ ce_weight: 1
126
+ embed_modeling_weight: 1
127
+ embed_modeling_loss: nll
128
+ entropy_weight: 0
129
+ pred_embed_forward_weight: 1
130
+ max_compression_r: 4
131
+ pred_compressed_cot: true
132
+ replace_r_with_auto_prob: 0
133
+ sqrt_mean: true
134
+ latent_policy_config:
135
+ lp_determinisitc: false
136
+ lp_intermediate_size: 2048
137
+ latent_generation_config:
138
+ max_n_latent_forward: 256
139
+ latent_temperature: 1.0
140
+ compression_r: 2
141
+ answer_generation_config:
142
+ max_new_tokens: 16
143
+ do_sample: true
144
+ top_p: 0.9
145
+ temperature: 1.0
146
+ do_rl: false
147
+ rl_config:
148
+ random_speed_in_group: false
149
+ filter_dataset: false
150
+ exp_batch_size: 8
151
+ group_size: 8
152
+ punish_latent_length: false
153
+ clip_grad_norm: 1.0
154
+ clip_eps: 0.2
155
+ use_latent_loss: true
156
+ use_answer_loss: true
157
+ n_train_samples_per_epoch: 4096
158
+ training_kwargs:
159
+ optimizer:
160
+ target: torch.optim.AdamW
161
+ lr: 0.0001
162
+ weight_decay: 0.01
163
+ use_scheduler: false
164
+ scheduler:
165
+ target: constant_schedule_with_warmup
166
+ warmup_steps: 1000
167
+ dataloader:
168
+ batch_size: 2
169
+ val_batch_size: 32
170
+ num_workers: 32
171
+ pin_memory: true
172
+ persistent_workers: true
173
+ data_module:
174
+ target: src.datasets.qsa.QSADataModule
175
+ dataset_name: math
176
+ tiny_dataset: false
177
+ epoch_scaling: 1
178
+ args:
179
+ model: latent_cot
180
+ dataset: qsa
181
+ trainer: default
182
+ devices: all
183
+ no_log: false
184
+ log_suffix: m-llama-ccot24-bs16
185
+ resume_ckpt_path: null
186
+ load_ckpt_path: logs/latent_cot/qsa-math/20250511-015422_637954_math-1b-cot-bs64/checkpoints/epoch7__step1760__monitor0.170.ckpt
187
+ workspace_path: /workspace/images-ks3-starfs-hd/workspace/wenhui
188
+ do_test: true
189
+ test_ckpt_path: ''
190
+ test_times: 1
191
+ seed: 0
192
+ unkown_args:
193
+ dataset_name: math
194
+ model_id: Llama-3.2-1B-Instruct
195
+ batch_size: '16'
196
+ sft_method: compressed_latent_cot
197
+ max_compression_r: '4'
198
+ compression_r: '2'
199
+ replace_r_with_auto_prob: '0'
200
+ pred_compressed_cot: 'True'
201
+ max_new_tokens: '16'
202
+ pred_embed_forward_weight: '1'
203
+ embed_modeling_loss: nll
204
+ max_n_latent_forward: '256'
logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/log.txt ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 20250513-182119:
2
+ Start training with model:
3
+ LitLatentReasoning(
4
+ (llm): PeftModel(
5
+ (base_model): LoraModel(
6
+ (model): LlamaForCausalLM(
7
+ (model): LlamaModel(
8
+ (embed_tokens): Embedding(128257, 2048)
9
+ (layers): ModuleList(
10
+ (0-15): 16 x LlamaDecoderLayer(
11
+ (self_attn): LlamaSdpaAttention(
12
+ (q_proj): lora.Linear(
13
+ (base_layer): Linear(in_features=2048, out_features=2048, bias=False)
14
+ (lora_dropout): ModuleDict(
15
+ (default): Identity()
16
+ )
17
+ (lora_A): ModuleDict(
18
+ (default): Linear(in_features=2048, out_features=128, bias=False)
19
+ )
20
+ (lora_B): ModuleDict(
21
+ (default): Linear(in_features=128, out_features=2048, bias=False)
22
+ )
23
+ (lora_embedding_A): ParameterDict()
24
+ (lora_embedding_B): ParameterDict()
25
+ (lora_magnitude_vector): ModuleDict()
26
+ )
27
+ (k_proj): Linear(in_features=2048, out_features=512, bias=False)
28
+ (v_proj): lora.Linear(
29
+ (base_layer): Linear(in_features=2048, out_features=512, bias=False)
30
+ (lora_dropout): ModuleDict(
31
+ (default): Identity()
32
+ )
33
+ (lora_A): ModuleDict(
34
+ (default): Linear(in_features=2048, out_features=128, bias=False)
35
+ )
36
+ (lora_B): ModuleDict(
37
+ (default): Linear(in_features=128, out_features=512, bias=False)
38
+ )
39
+ (lora_embedding_A): ParameterDict()
40
+ (lora_embedding_B): ParameterDict()
41
+ (lora_magnitude_vector): ModuleDict()
42
+ )
43
+ (o_proj): Linear(in_features=2048, out_features=2048, bias=False)
44
+ (rotary_emb): LlamaRotaryEmbedding()
45
+ )
46
+ (mlp): LlamaMLP(
47
+ (gate_proj): Linear(in_features=2048, out_features=8192, bias=False)
48
+ (up_proj): Linear(in_features=2048, out_features=8192, bias=False)
49
+ (down_proj): Linear(in_features=8192, out_features=2048, bias=False)
50
+ (act_fn): SiLU()
51
+ )
52
+ (input_layernorm): LlamaRMSNorm((2048,), eps=1e-05)
53
+ (post_attention_layernorm): LlamaRMSNorm((2048,), eps=1e-05)
54
+ )
55
+ )
56
+ (norm): LlamaRMSNorm((2048,), eps=1e-05)
57
+ (rotary_emb): LlamaRotaryEmbedding()
58
+ )
59
+ (lm_head): Linear(in_features=2048, out_features=128257, bias=False)
60
+ )
61
+ )
62
+ )
63
+ (embedding): Embedding(128257, 2048)
64
+ (latent_policy): LatentPolicy(
65
+ (fc): Sequential(
66
+ (0): Linear(in_features=2048, out_features=2048, bias=True)
67
+ (1): GELU(approximate='none')
68
+ (2): Linear(in_features=2048, out_features=2048, bias=True)
69
+ (3): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)
70
+ )
71
+ (mean): Linear(in_features=2048, out_features=2048, bias=True)
72
+ (log_std): Linear(in_features=2048, out_features=2048, bias=True)
73
+ )
74
+ )
75
+ config:
76
+ {'trainer': {'target': 'lightning.pytorch.trainer.Trainer', 'devices': [0, 1, 2, 3, 4, 5, 6, 7], 'max_steps': -1, 'check_val_every_n_epoch': 1, 'log_every_n_steps': 10, 'num_sanity_val_steps': 2, 'gradient_clip_val': None, 'reload_dataloaders_every_n_epochs': 0, 'accumulate_grad_batches': 1, 'precision': 'bf16-mixed', 'use_distributed_sampler': True, 'strategy': 'auto', 'logger': {'target': 'lightning.pytorch.loggers.TensorBoardLogger', 'save_dir': 'logs/latent_cot', 'name': 'qsa-math', 'version': '20250513-181936_723990_m-llama-ccot24-bs16'}, 'max_epochs': 25}, 'callbacks': [{'target': 'lightning.pytorch.callbacks.ModelCheckpoint', 'save_last': True, 'save_top_k': 3, 'mode': 'max', 'monitor': 'monitor', 'auto_insert_metric_name': False, 'filename': 'epoch{epoch}__step{step}__monitor{monitor:.3f}', 'save_weights_only': True}], 'seed': None, 'model': {'target': 'src.models.latent_cot.LitLatentReasoning', 'model_kwargs': {'model_id': 'Llama-3.2-1B-Instruct', 'depth': 1, 'sft_method': 'compressed_latent_cot', 'set_pad_as_last_token': False, 'do_lora': True, 'lora_config': {'r': 128, 'lora_alpha': 32}, 'coconut_config': {'n_epochs_per_stage': 2, 'max_n_stage': 3, 'n_latents_per_step': 2, 'current_stage': 1}, 'codi_config': {'codi_proj': False, 'n_latents': 6, 'alpha': 1, 'beta': 1, 'gamma': 20}, 'latent_cot_config': {'ce_weight': 1, 'embed_modeling_weight': 1, 'embed_modeling_loss': 'nll', 'entropy_weight': 0, 'pred_embed_forward_weight': 1, 'max_compression_r': 4, 'pred_compressed_cot': True, 'replace_r_with_auto_prob': 0, 'sqrt_mean': True}, 'latent_policy_config': {'lp_determinisitc': False, 'lp_intermediate_size': 2048}, 'latent_generation_config': {'max_n_latent_forward': 256, 'latent_temperature': 1.0, 'compression_r': 2}, 'answer_generation_config': {'max_new_tokens': 16, 'do_sample': True, 'top_p': 0.9, 'temperature': 1.0}, 'do_rl': False, 'rl_config': {'random_speed_in_group': False, 'filter_dataset': False, 'exp_batch_size': 8, 'group_size': 8, 'punish_latent_length': False, 'clip_grad_norm': 1.0, 'clip_eps': 0.2, 'use_latent_loss': True, 'use_answer_loss': True, 'n_train_samples_per_epoch': 4096}}, 'training_kwargs': {'optimizer': {'target': 'torch.optim.AdamW', 'lr': 0.0001, 'weight_decay': 0.01}, 'use_scheduler': False, 'scheduler': {'target': 'constant_schedule_with_warmup', 'warmup_steps': 1000}}}, 'dataloader': {'batch_size': 2, 'val_batch_size': 32, 'num_workers': 32, 'pin_memory': True, 'persistent_workers': True}, 'data_module': {'target': 'src.datasets.qsa.QSADataModule', 'dataset_name': 'math', 'tiny_dataset': False, 'epoch_scaling': 1}, 'args': {'model': 'latent_cot', 'dataset': 'qsa', 'trainer': 'default', 'devices': 'all', 'no_log': False, 'log_suffix': 'm-llama-ccot24-bs16', 'resume_ckpt_path': None, 'load_ckpt_path': 'logs/latent_cot/qsa-math/20250511-015422_637954_math-1b-cot-bs64/checkpoints/epoch7__step1760__monitor0.170.ckpt', 'workspace_path': '/workspace/images-ks3-starfs-hd/workspace/wenhui', 'do_test': True, 'test_ckpt_path': '', 'test_times': 1, 'seed': 0}, 'unkown_args': {'dataset_name': 'math', 'model_id': 'Llama-3.2-1B-Instruct', 'batch_size': '16', 'sft_method': 'compressed_latent_cot', 'max_compression_r': '4', 'compression_r': '2', 'replace_r_with_auto_prob': '0', 'pred_compressed_cot': 'True', 'max_new_tokens': '16', 'pred_embed_forward_weight': '1', 'embed_modeling_loss': 'nll', 'max_n_latent_forward': '256'}}
77
+ 20250513-185756:
78
+ Start testing with model:
79
+ LitLatentReasoning(
80
+ (llm): PeftModel(
81
+ (base_model): LoraModel(
82
+ (model): LlamaForCausalLM(
83
+ (model): LlamaModel(
84
+ (embed_tokens): Embedding(128257, 2048)
85
+ (layers): ModuleList(
86
+ (0-15): 16 x LlamaDecoderLayer(
87
+ (self_attn): LlamaSdpaAttention(
88
+ (q_proj): lora.Linear(
89
+ (base_layer): Linear(in_features=2048, out_features=2048, bias=False)
90
+ (lora_dropout): ModuleDict(
91
+ (default): Identity()
92
+ )
93
+ (lora_A): ModuleDict(
94
+ (default): Linear(in_features=2048, out_features=128, bias=False)
95
+ )
96
+ (lora_B): ModuleDict(
97
+ (default): Linear(in_features=128, out_features=2048, bias=False)
98
+ )
99
+ (lora_embedding_A): ParameterDict()
100
+ (lora_embedding_B): ParameterDict()
101
+ (lora_magnitude_vector): ModuleDict()
102
+ )
103
+ (k_proj): Linear(in_features=2048, out_features=512, bias=False)
104
+ (v_proj): lora.Linear(
105
+ (base_layer): Linear(in_features=2048, out_features=512, bias=False)
106
+ (lora_dropout): ModuleDict(
107
+ (default): Identity()
108
+ )
109
+ (lora_A): ModuleDict(
110
+ (default): Linear(in_features=2048, out_features=128, bias=False)
111
+ )
112
+ (lora_B): ModuleDict(
113
+ (default): Linear(in_features=128, out_features=512, bias=False)
114
+ )
115
+ (lora_embedding_A): ParameterDict()
116
+ (lora_embedding_B): ParameterDict()
117
+ (lora_magnitude_vector): ModuleDict()
118
+ )
119
+ (o_proj): Linear(in_features=2048, out_features=2048, bias=False)
120
+ (rotary_emb): LlamaRotaryEmbedding()
121
+ )
122
+ (mlp): LlamaMLP(
123
+ (gate_proj): Linear(in_features=2048, out_features=8192, bias=False)
124
+ (up_proj): Linear(in_features=2048, out_features=8192, bias=False)
125
+ (down_proj): Linear(in_features=8192, out_features=2048, bias=False)
126
+ (act_fn): SiLU()
127
+ )
128
+ (input_layernorm): LlamaRMSNorm((2048,), eps=1e-05)
129
+ (post_attention_layernorm): LlamaRMSNorm((2048,), eps=1e-05)
130
+ )
131
+ )
132
+ (norm): LlamaRMSNorm((2048,), eps=1e-05)
133
+ (rotary_emb): LlamaRotaryEmbedding()
134
+ )
135
+ (lm_head): Linear(in_features=2048, out_features=128257, bias=False)
136
+ )
137
+ )
138
+ )
139
+ (embedding): Embedding(128257, 2048)
140
+ (latent_policy): LatentPolicy(
141
+ (fc): Sequential(
142
+ (0): Linear(in_features=2048, out_features=2048, bias=True)
143
+ (1): GELU(approximate='none')
144
+ (2): Linear(in_features=2048, out_features=2048, bias=True)
145
+ (3): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)
146
+ )
147
+ (mean): Linear(in_features=2048, out_features=2048, bias=True)
148
+ (log_std): Linear(in_features=2048, out_features=2048, bias=True)
149
+ )
150
+ )
151
+ config:
152
+ {'trainer': {'target': 'lightning.pytorch.trainer.Trainer', 'devices': [0, 1, 2, 3, 4, 5, 6, 7], 'max_steps': -1, 'check_val_every_n_epoch': 1, 'log_every_n_steps': 10, 'num_sanity_val_steps': 2, 'gradient_clip_val': None, 'reload_dataloaders_every_n_epochs': 0, 'accumulate_grad_batches': 1, 'precision': 'bf16-mixed', 'use_distributed_sampler': True, 'strategy': 'auto', 'logger': {'target': 'lightning.pytorch.loggers.TensorBoardLogger', 'save_dir': 'logs/latent_cot', 'name': 'qsa-math', 'version': '20250513-181936_723990_m-llama-ccot24-bs16'}, 'max_epochs': 25}, 'callbacks': [{'target': 'lightning.pytorch.callbacks.ModelCheckpoint', 'save_last': True, 'save_top_k': 3, 'mode': 'max', 'monitor': 'monitor', 'auto_insert_metric_name': False, 'filename': 'epoch{epoch}__step{step}__monitor{monitor:.3f}', 'save_weights_only': True}], 'seed': None, 'model': {'target': 'src.models.latent_cot.LitLatentReasoning', 'model_kwargs': {'model_id': 'Llama-3.2-1B-Instruct', 'depth': 1, 'sft_method': 'compressed_latent_cot', 'set_pad_as_last_token': False, 'do_lora': True, 'lora_config': {'r': 128, 'lora_alpha': 32}, 'coconut_config': {'n_epochs_per_stage': 2, 'max_n_stage': 3, 'n_latents_per_step': 2, 'current_stage': 1}, 'codi_config': {'codi_proj': False, 'n_latents': 6, 'alpha': 1, 'beta': 1, 'gamma': 20}, 'latent_cot_config': {'ce_weight': 1, 'embed_modeling_weight': 1, 'embed_modeling_loss': 'nll', 'entropy_weight': 0, 'pred_embed_forward_weight': 1, 'max_compression_r': 4, 'pred_compressed_cot': True, 'replace_r_with_auto_prob': 0, 'sqrt_mean': True}, 'latent_policy_config': {'lp_determinisitc': False, 'lp_intermediate_size': 2048}, 'latent_generation_config': {'max_n_latent_forward': 256, 'latent_temperature': 1.0, 'compression_r': 2}, 'answer_generation_config': {'max_new_tokens': 16, 'do_sample': True, 'top_p': 0.9, 'temperature': 1.0}, 'do_rl': False, 'rl_config': {'random_speed_in_group': False, 'filter_dataset': False, 'exp_batch_size': 8, 'group_size': 8, 'punish_latent_length': False, 'clip_grad_norm': 1.0, 'clip_eps': 0.2, 'use_latent_loss': True, 'use_answer_loss': True, 'n_train_samples_per_epoch': 4096}}, 'training_kwargs': {'optimizer': {'target': 'torch.optim.AdamW', 'lr': 0.0001, 'weight_decay': 0.01}, 'use_scheduler': False, 'scheduler': {'target': 'constant_schedule_with_warmup', 'warmup_steps': 1000}}}, 'dataloader': {'batch_size': 2, 'val_batch_size': 32, 'num_workers': 32, 'pin_memory': True, 'persistent_workers': True}, 'data_module': {'target': 'src.datasets.qsa.QSADataModule', 'dataset_name': 'math', 'tiny_dataset': False, 'epoch_scaling': 1}, 'args': {'model': 'latent_cot', 'dataset': 'qsa', 'trainer': 'default', 'devices': 'all', 'no_log': False, 'log_suffix': 'm-llama-ccot24-bs16', 'resume_ckpt_path': None, 'load_ckpt_path': 'logs/latent_cot/qsa-math/20250511-015422_637954_math-1b-cot-bs64/checkpoints/epoch7__step1760__monitor0.170.ckpt', 'workspace_path': '/workspace/images-ks3-starfs-hd/workspace/wenhui', 'do_test': True, 'test_ckpt_path': '', 'test_times': 1, 'seed': 0}, 'unkown_args': {'dataset_name': 'math', 'model_id': 'Llama-3.2-1B-Instruct', 'batch_size': '16', 'sft_method': 'compressed_latent_cot', 'max_compression_r': '4', 'compression_r': '2', 'replace_r_with_auto_prob': '0', 'pred_compressed_cot': 'True', 'max_new_tokens': '16', 'pred_embed_forward_weight': '1', 'embed_modeling_loss': 'nll', 'max_n_latent_forward': '256'}}.
153
+ 20250513-185942:
154
+ Test results: defaultdict(<class 'list'>, {'monitor': [0.05293159559369087], 'test/acc': [0.05293159559369087], 'test/n_latent_forward': [81.7109146118164], 'test/n_latent_forward_on_acc': [46.450679779052734], 'test/output_length': [7.493078231811523]})
155
+ Test statistics with 1 replications: {'monitor': (0.05293159559369087, 0.0), 'test/acc': (0.05293159559369087, 0.0), 'test/n_latent_forward': (81.7109146118164, 0.0), 'test/n_latent_forward_on_acc': (46.450679779052734, 0.0), 'test/output_length': (7.493078231811523, 0.0)}
logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/test_20250513-185756.json ADDED
The diff for this file is too large to render. See raw diff
 
logs/colar/qsa-math/20250513-181936_723990_m-llama-ccot24-bs16/train.json ADDED
The diff for this file is too large to render. See raw diff
 
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/checkpoints/epoch21__step9152__monitor0.094.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:442c03c1cc159c2c285794561fa704e63c52536be1578fb3cf663b2a5028ab27
3
+ size 124381374
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/checkpoints/last.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf871093b6c754303ca78881fc346ca1530d9c12a60bdc7d94c3ae2552c977b6
3
+ size 124381374
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/events.out.tfevents.1747137282.tj-3008206-m-qw1b-ccot24-bs16-mse-master-0.45.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:692f1704a95d56aa10e17e72add0611044603f8520192ca88c154c1d12b6cb17
3
+ size 373711
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/events.out.tfevents.1747139343.tj-3008206-m-qw1b-ccot24-bs16-mse-master-0.45.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:559e3712e7030368929d3648e8ab44b15b7bdcde5d69b46ccf923d237f4f0643
3
+ size 17779
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/hparams.yaml ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model_kwargs:
2
+ model_id: DeepSeek-R1-Distill-Qwen-1.5B
3
+ depth: 1
4
+ sft_method: compressed_latent_cot
5
+ set_pad_as_last_token: false
6
+ do_lora: true
7
+ lora_config:
8
+ r: 128
9
+ lora_alpha: 32
10
+ coconut_config:
11
+ n_epochs_per_stage: 2
12
+ max_n_stage: 3
13
+ n_latents_per_step: 2
14
+ current_stage: 1
15
+ codi_config:
16
+ codi_proj: false
17
+ n_latents: 6
18
+ alpha: 1
19
+ beta: 1
20
+ gamma: 20
21
+ latent_cot_config:
22
+ ce_weight: 1
23
+ embed_modeling_weight: 1
24
+ embed_modeling_loss: mse
25
+ entropy_weight: 0
26
+ pred_embed_forward_weight: 0
27
+ max_compression_r: 4
28
+ pred_compressed_cot: true
29
+ replace_r_with_auto_prob: 0
30
+ sqrt_mean: true
31
+ latent_policy_config:
32
+ lp_determinisitc: false
33
+ lp_intermediate_size: 2048
34
+ latent_generation_config:
35
+ max_n_latent_forward: 256
36
+ latent_temperature: 1.0
37
+ compression_r: 2
38
+ answer_generation_config:
39
+ max_new_tokens: 16
40
+ do_sample: true
41
+ top_p: 0.9
42
+ temperature: 1.0
43
+ do_rl: false
44
+ rl_config:
45
+ random_speed_in_group: false
46
+ filter_dataset: false
47
+ exp_batch_size: 8
48
+ group_size: 8
49
+ punish_latent_length: false
50
+ clip_grad_norm: 1.0
51
+ clip_eps: 0.2
52
+ use_latent_loss: true
53
+ use_answer_loss: true
54
+ n_train_samples_per_epoch: 4096
55
+ training_kwargs:
56
+ optimizer:
57
+ target: torch.optim.AdamW
58
+ lr: 0.0001
59
+ weight_decay: 0.01
60
+ use_scheduler: false
61
+ scheduler:
62
+ target: constant_schedule_with_warmup
63
+ warmup_steps: 1000
64
+ all_config:
65
+ trainer:
66
+ target: lightning.pytorch.trainer.Trainer
67
+ devices:
68
+ - 0
69
+ - 1
70
+ - 2
71
+ - 3
72
+ - 4
73
+ - 5
74
+ - 6
75
+ - 7
76
+ max_steps: -1
77
+ check_val_every_n_epoch: 1
78
+ log_every_n_steps: 10
79
+ num_sanity_val_steps: 2
80
+ gradient_clip_val: null
81
+ reload_dataloaders_every_n_epochs: 0
82
+ accumulate_grad_batches: 1
83
+ precision: bf16-mixed
84
+ use_distributed_sampler: true
85
+ strategy: auto
86
+ logger:
87
+ target: lightning.pytorch.loggers.TensorBoardLogger
88
+ save_dir: logs/latent_cot
89
+ name: qsa-math
90
+ version: 20250513-195204_122466_m-qw1b-ccot24-bs16
91
+ max_epochs: 25
92
+ callbacks:
93
+ - target: lightning.pytorch.callbacks.ModelCheckpoint
94
+ save_last: true
95
+ save_top_k: 3
96
+ mode: max
97
+ monitor: monitor
98
+ auto_insert_metric_name: false
99
+ filename: epoch{epoch}__step{step}__monitor{monitor:.3f}
100
+ save_weights_only: true
101
+ seed: null
102
+ model:
103
+ target: src.models.latent_cot.LitLatentReasoning
104
+ model_kwargs:
105
+ model_id: DeepSeek-R1-Distill-Qwen-1.5B
106
+ depth: 1
107
+ sft_method: compressed_latent_cot
108
+ set_pad_as_last_token: false
109
+ do_lora: true
110
+ lora_config:
111
+ r: 128
112
+ lora_alpha: 32
113
+ coconut_config:
114
+ n_epochs_per_stage: 2
115
+ max_n_stage: 3
116
+ n_latents_per_step: 2
117
+ current_stage: 1
118
+ codi_config:
119
+ codi_proj: false
120
+ n_latents: 6
121
+ alpha: 1
122
+ beta: 1
123
+ gamma: 20
124
+ latent_cot_config:
125
+ ce_weight: 1
126
+ embed_modeling_weight: 1
127
+ embed_modeling_loss: mse
128
+ entropy_weight: 0
129
+ pred_embed_forward_weight: 0
130
+ max_compression_r: 4
131
+ pred_compressed_cot: true
132
+ replace_r_with_auto_prob: 0
133
+ sqrt_mean: true
134
+ latent_policy_config:
135
+ lp_determinisitc: false
136
+ lp_intermediate_size: 2048
137
+ latent_generation_config:
138
+ max_n_latent_forward: 256
139
+ latent_temperature: 1.0
140
+ compression_r: 2
141
+ answer_generation_config:
142
+ max_new_tokens: 16
143
+ do_sample: true
144
+ top_p: 0.9
145
+ temperature: 1.0
146
+ do_rl: false
147
+ rl_config:
148
+ random_speed_in_group: false
149
+ filter_dataset: false
150
+ exp_batch_size: 8
151
+ group_size: 8
152
+ punish_latent_length: false
153
+ clip_grad_norm: 1.0
154
+ clip_eps: 0.2
155
+ use_latent_loss: true
156
+ use_answer_loss: true
157
+ n_train_samples_per_epoch: 4096
158
+ training_kwargs:
159
+ optimizer:
160
+ target: torch.optim.AdamW
161
+ lr: 0.0001
162
+ weight_decay: 0.01
163
+ use_scheduler: false
164
+ scheduler:
165
+ target: constant_schedule_with_warmup
166
+ warmup_steps: 1000
167
+ dataloader:
168
+ batch_size: 2
169
+ val_batch_size: 32
170
+ num_workers: 32
171
+ pin_memory: true
172
+ persistent_workers: true
173
+ data_module:
174
+ target: src.datasets.qsa.QSADataModule
175
+ dataset_name: math
176
+ tiny_dataset: false
177
+ epoch_scaling: 1
178
+ args:
179
+ model: latent_cot
180
+ dataset: qsa
181
+ trainer: default
182
+ devices: all
183
+ no_log: false
184
+ log_suffix: m-qw1b-ccot24-bs16
185
+ resume_ckpt_path: null
186
+ load_ckpt_path: logs/latent_cot/qsa-math/20250511-025110_355317_math-qw1b-cot-bs32/checkpoints/epoch9__step2080__monitor0.247.ckpt
187
+ workspace_path: /workspace/images-ks3-starfs-hd/workspace/wenhui
188
+ do_test: true
189
+ test_ckpt_path: ''
190
+ test_times: 1
191
+ seed: 0
192
+ unkown_args:
193
+ dataset_name: math
194
+ model_id: DeepSeek-R1-Distill-Qwen-1.5B
195
+ batch_size: '16'
196
+ sft_method: compressed_latent_cot
197
+ max_compression_r: '4'
198
+ compression_r: '2'
199
+ replace_r_with_auto_prob: '0'
200
+ pred_compressed_cot: 'True'
201
+ max_new_tokens: '16'
202
+ embed_modeling_loss: mse
203
+ max_n_latent_forward: '256'
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/log.txt ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 20250513-195446:
2
+ Start training with model:
3
+ LitLatentReasoning(
4
+ (llm): PeftModel(
5
+ (base_model): LoraModel(
6
+ (model): Qwen2ForCausalLM(
7
+ (model): Qwen2Model(
8
+ (embed_tokens): Embedding(151666, 1536)
9
+ (layers): ModuleList(
10
+ (0-27): 28 x Qwen2DecoderLayer(
11
+ (self_attn): Qwen2SdpaAttention(
12
+ (q_proj): lora.Linear(
13
+ (base_layer): Linear(in_features=1536, out_features=1536, bias=True)
14
+ (lora_dropout): ModuleDict(
15
+ (default): Identity()
16
+ )
17
+ (lora_A): ModuleDict(
18
+ (default): Linear(in_features=1536, out_features=128, bias=False)
19
+ )
20
+ (lora_B): ModuleDict(
21
+ (default): Linear(in_features=128, out_features=1536, bias=False)
22
+ )
23
+ (lora_embedding_A): ParameterDict()
24
+ (lora_embedding_B): ParameterDict()
25
+ (lora_magnitude_vector): ModuleDict()
26
+ )
27
+ (k_proj): Linear(in_features=1536, out_features=256, bias=True)
28
+ (v_proj): lora.Linear(
29
+ (base_layer): Linear(in_features=1536, out_features=256, bias=True)
30
+ (lora_dropout): ModuleDict(
31
+ (default): Identity()
32
+ )
33
+ (lora_A): ModuleDict(
34
+ (default): Linear(in_features=1536, out_features=128, bias=False)
35
+ )
36
+ (lora_B): ModuleDict(
37
+ (default): Linear(in_features=128, out_features=256, bias=False)
38
+ )
39
+ (lora_embedding_A): ParameterDict()
40
+ (lora_embedding_B): ParameterDict()
41
+ (lora_magnitude_vector): ModuleDict()
42
+ )
43
+ (o_proj): Linear(in_features=1536, out_features=1536, bias=False)
44
+ (rotary_emb): Qwen2RotaryEmbedding()
45
+ )
46
+ (mlp): Qwen2MLP(
47
+ (gate_proj): Linear(in_features=1536, out_features=8960, bias=False)
48
+ (up_proj): Linear(in_features=1536, out_features=8960, bias=False)
49
+ (down_proj): Linear(in_features=8960, out_features=1536, bias=False)
50
+ (act_fn): SiLU()
51
+ )
52
+ (input_layernorm): Qwen2RMSNorm((1536,), eps=1e-06)
53
+ (post_attention_layernorm): Qwen2RMSNorm((1536,), eps=1e-06)
54
+ )
55
+ )
56
+ (norm): Qwen2RMSNorm((1536,), eps=1e-06)
57
+ (rotary_emb): Qwen2RotaryEmbedding()
58
+ )
59
+ (lm_head): Linear(in_features=1536, out_features=151666, bias=False)
60
+ )
61
+ )
62
+ )
63
+ (embedding): Embedding(151666, 1536)
64
+ (latent_policy): LatentPolicy(
65
+ (fc): Sequential(
66
+ (0): Linear(in_features=1536, out_features=2048, bias=True)
67
+ (1): GELU(approximate='none')
68
+ (2): Linear(in_features=2048, out_features=2048, bias=True)
69
+ (3): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)
70
+ )
71
+ (mean): Linear(in_features=2048, out_features=1536, bias=True)
72
+ (log_std): Linear(in_features=2048, out_features=1536, bias=True)
73
+ )
74
+ )
75
+ config:
76
+ {'trainer': {'target': 'lightning.pytorch.trainer.Trainer', 'devices': [0, 1, 2, 3, 4, 5, 6, 7], 'max_steps': -1, 'check_val_every_n_epoch': 1, 'log_every_n_steps': 10, 'num_sanity_val_steps': 2, 'gradient_clip_val': None, 'reload_dataloaders_every_n_epochs': 0, 'accumulate_grad_batches': 1, 'precision': 'bf16-mixed', 'use_distributed_sampler': True, 'strategy': 'auto', 'logger': {'target': 'lightning.pytorch.loggers.TensorBoardLogger', 'save_dir': 'logs/latent_cot', 'name': 'qsa-math', 'version': '20250513-195204_122466_m-qw1b-ccot24-bs16'}, 'max_epochs': 25}, 'callbacks': [{'target': 'lightning.pytorch.callbacks.ModelCheckpoint', 'save_last': True, 'save_top_k': 3, 'mode': 'max', 'monitor': 'monitor', 'auto_insert_metric_name': False, 'filename': 'epoch{epoch}__step{step}__monitor{monitor:.3f}', 'save_weights_only': True}], 'seed': None, 'model': {'target': 'src.models.latent_cot.LitLatentReasoning', 'model_kwargs': {'model_id': 'DeepSeek-R1-Distill-Qwen-1.5B', 'depth': 1, 'sft_method': 'compressed_latent_cot', 'set_pad_as_last_token': False, 'do_lora': True, 'lora_config': {'r': 128, 'lora_alpha': 32}, 'coconut_config': {'n_epochs_per_stage': 2, 'max_n_stage': 3, 'n_latents_per_step': 2, 'current_stage': 1}, 'codi_config': {'codi_proj': False, 'n_latents': 6, 'alpha': 1, 'beta': 1, 'gamma': 20}, 'latent_cot_config': {'ce_weight': 1, 'embed_modeling_weight': 1, 'embed_modeling_loss': 'mse', 'entropy_weight': 0, 'pred_embed_forward_weight': 0, 'max_compression_r': 4, 'pred_compressed_cot': True, 'replace_r_with_auto_prob': 0, 'sqrt_mean': True}, 'latent_policy_config': {'lp_determinisitc': False, 'lp_intermediate_size': 2048}, 'latent_generation_config': {'max_n_latent_forward': 256, 'latent_temperature': 1.0, 'compression_r': 2}, 'answer_generation_config': {'max_new_tokens': 16, 'do_sample': True, 'top_p': 0.9, 'temperature': 1.0}, 'do_rl': False, 'rl_config': {'random_speed_in_group': False, 'filter_dataset': False, 'exp_batch_size': 8, 'group_size': 8, 'punish_latent_length': False, 'clip_grad_norm': 1.0, 'clip_eps': 0.2, 'use_latent_loss': True, 'use_answer_loss': True, 'n_train_samples_per_epoch': 4096}}, 'training_kwargs': {'optimizer': {'target': 'torch.optim.AdamW', 'lr': 0.0001, 'weight_decay': 0.01}, 'use_scheduler': False, 'scheduler': {'target': 'constant_schedule_with_warmup', 'warmup_steps': 1000}}}, 'dataloader': {'batch_size': 2, 'val_batch_size': 32, 'num_workers': 32, 'pin_memory': True, 'persistent_workers': True}, 'data_module': {'target': 'src.datasets.qsa.QSADataModule', 'dataset_name': 'math', 'tiny_dataset': False, 'epoch_scaling': 1}, 'args': {'model': 'latent_cot', 'dataset': 'qsa', 'trainer': 'default', 'devices': 'all', 'no_log': False, 'log_suffix': 'm-qw1b-ccot24-bs16', 'resume_ckpt_path': None, 'load_ckpt_path': 'logs/latent_cot/qsa-math/20250511-025110_355317_math-qw1b-cot-bs32/checkpoints/epoch9__step2080__monitor0.247.ckpt', 'workspace_path': '/workspace/images-ks3-starfs-hd/workspace/wenhui', 'do_test': True, 'test_ckpt_path': '', 'test_times': 1, 'seed': 0}, 'unkown_args': {'dataset_name': 'math', 'model_id': 'DeepSeek-R1-Distill-Qwen-1.5B', 'batch_size': '16', 'sft_method': 'compressed_latent_cot', 'max_compression_r': '4', 'compression_r': '2', 'replace_r_with_auto_prob': '0', 'pred_compressed_cot': 'True', 'max_new_tokens': '16', 'embed_modeling_loss': 'mse', 'max_n_latent_forward': '256'}}
77
+ 20250513-202903:
78
+ Start testing with model:
79
+ LitLatentReasoning(
80
+ (llm): PeftModel(
81
+ (base_model): LoraModel(
82
+ (model): Qwen2ForCausalLM(
83
+ (model): Qwen2Model(
84
+ (embed_tokens): Embedding(151666, 1536)
85
+ (layers): ModuleList(
86
+ (0-27): 28 x Qwen2DecoderLayer(
87
+ (self_attn): Qwen2SdpaAttention(
88
+ (q_proj): lora.Linear(
89
+ (base_layer): Linear(in_features=1536, out_features=1536, bias=True)
90
+ (lora_dropout): ModuleDict(
91
+ (default): Identity()
92
+ )
93
+ (lora_A): ModuleDict(
94
+ (default): Linear(in_features=1536, out_features=128, bias=False)
95
+ )
96
+ (lora_B): ModuleDict(
97
+ (default): Linear(in_features=128, out_features=1536, bias=False)
98
+ )
99
+ (lora_embedding_A): ParameterDict()
100
+ (lora_embedding_B): ParameterDict()
101
+ (lora_magnitude_vector): ModuleDict()
102
+ )
103
+ (k_proj): Linear(in_features=1536, out_features=256, bias=True)
104
+ (v_proj): lora.Linear(
105
+ (base_layer): Linear(in_features=1536, out_features=256, bias=True)
106
+ (lora_dropout): ModuleDict(
107
+ (default): Identity()
108
+ )
109
+ (lora_A): ModuleDict(
110
+ (default): Linear(in_features=1536, out_features=128, bias=False)
111
+ )
112
+ (lora_B): ModuleDict(
113
+ (default): Linear(in_features=128, out_features=256, bias=False)
114
+ )
115
+ (lora_embedding_A): ParameterDict()
116
+ (lora_embedding_B): ParameterDict()
117
+ (lora_magnitude_vector): ModuleDict()
118
+ )
119
+ (o_proj): Linear(in_features=1536, out_features=1536, bias=False)
120
+ (rotary_emb): Qwen2RotaryEmbedding()
121
+ )
122
+ (mlp): Qwen2MLP(
123
+ (gate_proj): Linear(in_features=1536, out_features=8960, bias=False)
124
+ (up_proj): Linear(in_features=1536, out_features=8960, bias=False)
125
+ (down_proj): Linear(in_features=8960, out_features=1536, bias=False)
126
+ (act_fn): SiLU()
127
+ )
128
+ (input_layernorm): Qwen2RMSNorm((1536,), eps=1e-06)
129
+ (post_attention_layernorm): Qwen2RMSNorm((1536,), eps=1e-06)
130
+ )
131
+ )
132
+ (norm): Qwen2RMSNorm((1536,), eps=1e-06)
133
+ (rotary_emb): Qwen2RotaryEmbedding()
134
+ )
135
+ (lm_head): Linear(in_features=1536, out_features=151666, bias=False)
136
+ )
137
+ )
138
+ )
139
+ (embedding): Embedding(151666, 1536)
140
+ (latent_policy): LatentPolicy(
141
+ (fc): Sequential(
142
+ (0): Linear(in_features=1536, out_features=2048, bias=True)
143
+ (1): GELU(approximate='none')
144
+ (2): Linear(in_features=2048, out_features=2048, bias=True)
145
+ (3): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)
146
+ )
147
+ (mean): Linear(in_features=2048, out_features=1536, bias=True)
148
+ (log_std): Linear(in_features=2048, out_features=1536, bias=True)
149
+ )
150
+ )
151
+ config:
152
+ {'trainer': {'target': 'lightning.pytorch.trainer.Trainer', 'devices': [0, 1, 2, 3, 4, 5, 6, 7], 'max_steps': -1, 'check_val_every_n_epoch': 1, 'log_every_n_steps': 10, 'num_sanity_val_steps': 2, 'gradient_clip_val': None, 'reload_dataloaders_every_n_epochs': 0, 'accumulate_grad_batches': 1, 'precision': 'bf16-mixed', 'use_distributed_sampler': True, 'strategy': 'auto', 'logger': {'target': 'lightning.pytorch.loggers.TensorBoardLogger', 'save_dir': 'logs/latent_cot', 'name': 'qsa-math', 'version': '20250513-195204_122466_m-qw1b-ccot24-bs16'}, 'max_epochs': 25}, 'callbacks': [{'target': 'lightning.pytorch.callbacks.ModelCheckpoint', 'save_last': True, 'save_top_k': 3, 'mode': 'max', 'monitor': 'monitor', 'auto_insert_metric_name': False, 'filename': 'epoch{epoch}__step{step}__monitor{monitor:.3f}', 'save_weights_only': True}], 'seed': None, 'model': {'target': 'src.models.latent_cot.LitLatentReasoning', 'model_kwargs': {'model_id': 'DeepSeek-R1-Distill-Qwen-1.5B', 'depth': 1, 'sft_method': 'compressed_latent_cot', 'set_pad_as_last_token': False, 'do_lora': True, 'lora_config': {'r': 128, 'lora_alpha': 32}, 'coconut_config': {'n_epochs_per_stage': 2, 'max_n_stage': 3, 'n_latents_per_step': 2, 'current_stage': 1}, 'codi_config': {'codi_proj': False, 'n_latents': 6, 'alpha': 1, 'beta': 1, 'gamma': 20}, 'latent_cot_config': {'ce_weight': 1, 'embed_modeling_weight': 1, 'embed_modeling_loss': 'mse', 'entropy_weight': 0, 'pred_embed_forward_weight': 0, 'max_compression_r': 4, 'pred_compressed_cot': True, 'replace_r_with_auto_prob': 0, 'sqrt_mean': True}, 'latent_policy_config': {'lp_determinisitc': False, 'lp_intermediate_size': 2048}, 'latent_generation_config': {'max_n_latent_forward': 256, 'latent_temperature': 1.0, 'compression_r': 2}, 'answer_generation_config': {'max_new_tokens': 16, 'do_sample': True, 'top_p': 0.9, 'temperature': 1.0}, 'do_rl': False, 'rl_config': {'random_speed_in_group': False, 'filter_dataset': False, 'exp_batch_size': 8, 'group_size': 8, 'punish_latent_length': False, 'clip_grad_norm': 1.0, 'clip_eps': 0.2, 'use_latent_loss': True, 'use_answer_loss': True, 'n_train_samples_per_epoch': 4096}}, 'training_kwargs': {'optimizer': {'target': 'torch.optim.AdamW', 'lr': 0.0001, 'weight_decay': 0.01}, 'use_scheduler': False, 'scheduler': {'target': 'constant_schedule_with_warmup', 'warmup_steps': 1000}}}, 'dataloader': {'batch_size': 2, 'val_batch_size': 32, 'num_workers': 32, 'pin_memory': True, 'persistent_workers': True}, 'data_module': {'target': 'src.datasets.qsa.QSADataModule', 'dataset_name': 'math', 'tiny_dataset': False, 'epoch_scaling': 1}, 'args': {'model': 'latent_cot', 'dataset': 'qsa', 'trainer': 'default', 'devices': 'all', 'no_log': False, 'log_suffix': 'm-qw1b-ccot24-bs16', 'resume_ckpt_path': None, 'load_ckpt_path': 'logs/latent_cot/qsa-math/20250511-025110_355317_math-qw1b-cot-bs32/checkpoints/epoch9__step2080__monitor0.247.ckpt', 'workspace_path': '/workspace/images-ks3-starfs-hd/workspace/wenhui', 'do_test': True, 'test_ckpt_path': '', 'test_times': 1, 'seed': 0}, 'unkown_args': {'dataset_name': 'math', 'model_id': 'DeepSeek-R1-Distill-Qwen-1.5B', 'batch_size': '16', 'sft_method': 'compressed_latent_cot', 'max_compression_r': '4', 'compression_r': '2', 'replace_r_with_auto_prob': '0', 'pred_compressed_cot': 'True', 'max_new_tokens': '16', 'embed_modeling_loss': 'mse', 'max_n_latent_forward': '256'}}.
153
+ 20250513-203145:
154
+ Test results: defaultdict(<class 'list'>, {'monitor': [0.0993485376238823], 'test/acc': [0.0993485376238823], 'test/n_latent_forward': [104.30354309082031], 'test/n_latent_forward_on_acc': [37.89900207519531], 'test/output_length': [8.856677055358887]})
155
+ Test statistics with 1 replications: {'monitor': (0.0993485376238823, 0.0), 'test/acc': (0.0993485376238823, 0.0), 'test/n_latent_forward': (104.30354309082031, 0.0), 'test/n_latent_forward_on_acc': (37.89900207519531, 0.0), 'test/output_length': (8.856677055358887, 0.0)}
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/test_20250513-202903.json ADDED
The diff for this file is too large to render. See raw diff
 
logs/colar/qsa-math/20250513-195204_122466_m-qw1b-ccot24-bs16/train.json ADDED
The diff for this file is too large to render. See raw diff