danym commited on
Commit
f5cdbb5
·
verified ·
1 Parent(s): 4c29fe8

stage1 v3 qwen3_6_27b

Browse files
.gitattributes CHANGED
@@ -43,3 +43,4 @@ stage2_recipe_AB_lowlr_topk64/tokenizer.json filter=lfs diff=lfs merge=lfs -text
43
  qwen3_5_0_8b_stage2_v3/vllm_compat/tokenizer.json filter=lfs diff=lfs merge=lfs -text
44
  qwen3_5_2b_stage2_v3/vllm_compat/tokenizer.json filter=lfs diff=lfs merge=lfs -text
45
  qwen3_5_9b_stage2_v3/vllm_compat/tokenizer.json filter=lfs diff=lfs merge=lfs -text
 
 
43
  qwen3_5_0_8b_stage2_v3/vllm_compat/tokenizer.json filter=lfs diff=lfs merge=lfs -text
44
  qwen3_5_2b_stage2_v3/vllm_compat/tokenizer.json filter=lfs diff=lfs merge=lfs -text
45
  qwen3_5_9b_stage2_v3/vllm_compat/tokenizer.json filter=lfs diff=lfs merge=lfs -text
46
+ stage1_v3_qwen3_6_27b/tokenizer.json filter=lfs diff=lfs merge=lfs -text
stage1_v3_qwen3_6_27b/chat_template.jinja ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if (preserve_thinking is defined and preserve_thinking is true) or (loop.index0 > ns.last_query_index) %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {%- if enable_thinking is defined and enable_thinking is false %}
150
+ {{- '<think>\n\n</think>\n\n' }}
151
+ {%- else %}
152
+ {{- '<think>\n' }}
153
+ {%- endif %}
154
+ {%- endif %}
stage1_v3_qwen3_6_27b/loss_curve.csv ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ step,loss,lr,tok_per_s
2
+ 0,3.993352,5.000e-05,95.7
3
+ 5,3.881543,3.000e-04,4144.0
4
+ 10,3.806364,5.500e-04,3980.2
5
+ 15,3.551234,8.000e-04,4152.3
6
+ 20,3.013006,1.000e-03,4248.7
7
+ 25,2.827564,9.981e-04,4263.1
8
+ 30,2.476648,9.924e-04,4261.5
9
+ 35,2.241153,9.830e-04,4275.3
10
+ 40,1.998935,9.698e-04,4275.0
11
+ 45,2.591520,9.532e-04,4276.7
12
+ 50,2.507889,9.330e-04,4273.1
13
+ 55,2.260417,9.096e-04,4276.6
14
+ 60,2.211508,8.830e-04,4272.1
15
+ 65,2.097555,8.536e-04,4275.4
16
+ 70,1.806510,8.214e-04,4275.7
17
+ 75,1.737853,7.868e-04,4276.2
18
+ 80,1.681238,7.500e-04,4276.8
19
+ 85,1.527681,7.113e-04,4278.0
20
+ 90,1.487800,6.710e-04,4279.4
21
+ 95,1.395350,6.294e-04,4256.4
22
+ 100,1.460943,5.868e-04,4264.8
23
+ 105,1.237850,5.436e-04,4265.9
24
+ 110,1.180859,5.000e-04,4269.7
25
+ 115,1.102229,4.564e-04,4268.2
26
+ 120,1.126031,4.132e-04,4266.2
27
+ 125,1.803083,3.706e-04,4268.5
28
+ 130,1.620632,3.290e-04,4267.5
29
+ 135,1.747785,2.887e-04,4267.5
30
+ 140,1.699758,2.500e-04,4266.1
31
+ 145,1.729147,2.132e-04,4267.9
32
+ 150,1.648632,1.786e-04,4266.2
33
+ 155,1.644816,1.464e-04,4265.6
34
+ 160,1.733385,1.170e-04,4265.2
35
+ 165,1.817360,9.042e-05,4266.4
36
+ 170,1.816725,6.699e-05,4266.1
37
+ 175,2.071765,4.685e-05,4265.7
38
+ 180,1.885692,3.015e-05,4266.7
39
+ 185,1.873427,1.704e-05,4265.1
40
+ 190,2.011757,7.596e-06,4264.9
41
+ 195,1.968878,1.903e-06,4265.3
42
+ 199,1.954217,7.615e-08,4257.3
stage1_v3_qwen3_6_27b/stage1_summary.json ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "Qwen/Qwen3.6-27B",
3
+ "probe": "probe_results/qwen3_6_27b_v3.json",
4
+ "steps": 200,
5
+ "lr": 0.001,
6
+ "seq_len": 2048,
7
+ "batch_size": 1,
8
+ "d_idx": 16,
9
+ "elapsed_min": 1.9683955115833327,
10
+ "final_per_head_kl": {
11
+ "3": [
12
+ 1.4239823818206787
13
+ ],
14
+ "7": [
15
+ 2.6987695693969727
16
+ ],
17
+ "11": [
18
+ 2.377558708190918,
19
+ 2.787999153137207,
20
+ 2.438776969909668,
21
+ 1.564170002937317
22
+ ],
23
+ "15": [
24
+ 1.8237659931182861,
25
+ 1.3233871459960938,
26
+ 1.5367882251739502,
27
+ 1.606621503829956,
28
+ 1.8042058944702148,
29
+ 1.4368648529052734,
30
+ 1.7141367197036743,
31
+ 1.8361910581588745
32
+ ],
33
+ "19": [
34
+ 1.1314971446990967,
35
+ 1.6120601892471313,
36
+ 1.7221510410308838,
37
+ 1.445702314376831,
38
+ 1.589271068572998,
39
+ 2.221271276473999,
40
+ 2.0320956707000732,
41
+ 1.9286909103393555
42
+ ],
43
+ "23": [
44
+ 1.7663816213607788,
45
+ 3.007701873779297
46
+ ],
47
+ "27": [
48
+ 1.834385871887207,
49
+ 2.185379981994629
50
+ ],
51
+ "31": [
52
+ 1.6225991249084473
53
+ ],
54
+ "35": [
55
+ 2.3036327362060547
56
+ ],
57
+ "39": [
58
+ 2.4662833213806152
59
+ ],
60
+ "43": [
61
+ 2.4847326278686523
62
+ ],
63
+ "47": [
64
+ 1.744596242904663,
65
+ 1.852041244506836,
66
+ 1.3673009872436523
67
+ ],
68
+ "51": [
69
+ 1.8634147644042969,
70
+ 2.1502764225006104,
71
+ 1.6011509895324707,
72
+ 1.6176682710647583,
73
+ 1.5763602256774902,
74
+ 1.666095495223999,
75
+ 1.786155104637146,
76
+ 2.1532015800476074,
77
+ 1.8322596549987793,
78
+ 1.7880979776382446,
79
+ 2.0255823135375977,
80
+ 2.2395434379577637,
81
+ 1.8771419525146484,
82
+ 2.0412936210632324
83
+ ],
84
+ "55": [
85
+ 1.6782424449920654,
86
+ 1.913238525390625,
87
+ 1.5459322929382324,
88
+ 1.4227039813995361,
89
+ 1.8281331062316895
90
+ ],
91
+ "59": [
92
+ 1.867315649986267,
93
+ 1.6641249656677246,
94
+ 1.3729698657989502,
95
+ 1.4456760883331299,
96
+ 1.8807485103607178
97
+ ],
98
+ "63": [
99
+ 1.381635069847107
100
+ ]
101
+ },
102
+ "final_mean_kl": 1.8432750989650857,
103
+ "final_max_kl": 3.007701873779297
104
+ }
stage1_v3_qwen3_6_27b/state_dict.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3861ab13859bab28f1b174392ab1e986ee359ce9dc970a7b56cf6cb77525ad4
3
+ size 991109
stage1_v3_qwen3_6_27b/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
3
+ size 19989325
stage1_v3_qwen3_6_27b/tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": false,
13
+ "local_files_only": false,
14
+ "model_max_length": 262144,
15
+ "model_specific_special_tokens": {
16
+ "audio_bos_token": "<|audio_start|>",
17
+ "audio_eos_token": "<|audio_end|>",
18
+ "audio_token": "<|audio_pad|>",
19
+ "image_token": "<|image_pad|>",
20
+ "video_token": "<|video_pad|>",
21
+ "vision_bos_token": "<|vision_start|>",
22
+ "vision_eos_token": "<|vision_end|>"
23
+ },
24
+ "pad_token": "<|endoftext|>",
25
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
26
+ "split_special_tokens": false,
27
+ "tokenizer_class": "Qwen2Tokenizer",
28
+ "unk_token": null,
29
+ "video_token": "<|video_pad|>",
30
+ "vision_bos_token": "<|vision_start|>",
31
+ "vision_eos_token": "<|vision_end|>"
32
+ }