ndemoss28 commited on
Commit
e62b3fd
·
verified ·
1 Parent(s): d262891

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
README.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen2.5-Coder-3B-Instruct
4
+ library_name: peft
5
+ tags:
6
+ - competitive-programming
7
+ - codeforces
8
+ - qlora
9
+ datasets:
10
+ - open-r1/codeforces-cots
11
+ ---
12
+
13
+ # Ladder-3B (unevaluated)
14
+
15
+ A QLoRA adapter for `Qwen2.5-Coder-3B-Instruct`, trained on verified Codeforces
16
+ reasoning traces with [Ladder](https://github.com/NiLabs-Models/ladder).
17
+
18
+ > **This model has not been evaluated.** There is no pass@1 for it, and none is
19
+ > claimed. It is stored here so the weights are not stranded on a temporary
20
+ > disk, and so any GPU can pick it up and score it. The repository stays private
21
+ > until there are measured numbers to publish with it.
22
+
23
+ ## Training
24
+
25
+ | | |
26
+ | --- | --- |
27
+ | Base | `unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit` |
28
+ | Method | QLoRA, 4-bit, rank 32, loss on the assistant turn only |
29
+ | Data | 2,271 traces, each verified by executing its solution against the problem's own tests |
30
+ | Steps | 150, effective batch 16, context 8,192 |
31
+ | Hardware | Tesla T4, 5.05 h, 594.9 tok/s, peak VRAM 6.78 GB |
32
+
33
+ ## Evaluating it
34
+
35
+ ```bash
36
+ git clone https://github.com/NiLabs-Models/ladder
37
+ ladder eval --config configs/ladder-3b-kaggle.yaml # base
38
+ ladder eval --config configs/ladder-3b-kaggle.yaml --adapter <this> # tuned
39
+ ```
40
+
41
+ Scoring runs generated programs against real Codeforces test cases. No
42
+ model-as-judge, no similarity metric.
43
+
44
+ ## Known limitations
45
+
46
+ - Python only; most competitive programming is C++.
47
+ - Trained on the 30% of the corpus short enough to fit 8,192 tokens. The median
48
+ trace is ~13,770 tokens, so the hardest problems are disproportionately absent.
49
+ - Codeforces `checker` and interactive problems are excluded from evaluation.
adapter_config.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": {
6
+ "base_model_class": "Qwen2ForCausalLM",
7
+ "parent_library": "transformers.models.qwen2.modeling_qwen2",
8
+ "unsloth_fixed": true
9
+ },
10
+ "base_model_name_or_path": "unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit",
11
+ "bias": "none",
12
+ "corda_config": null,
13
+ "ensure_weight_tying": false,
14
+ "eva_config": null,
15
+ "exclude_modules": null,
16
+ "fan_in_fan_out": false,
17
+ "inference_mode": true,
18
+ "init_lora_weights": true,
19
+ "layer_replication": null,
20
+ "layers_pattern": null,
21
+ "layers_to_transform": null,
22
+ "loftq_config": {},
23
+ "lora_alpha": 32,
24
+ "lora_bias": false,
25
+ "lora_dropout": 0.0,
26
+ "lora_ga_config": null,
27
+ "megatron_config": null,
28
+ "megatron_core": "megatron.core",
29
+ "modules_to_save": null,
30
+ "peft_type": "LORA",
31
+ "peft_version": "0.19.1",
32
+ "qalora_group_size": 16,
33
+ "r": 32,
34
+ "rank_pattern": {},
35
+ "revision": null,
36
+ "target_modules": [
37
+ "k_proj",
38
+ "q_proj",
39
+ "o_proj",
40
+ "v_proj",
41
+ "down_proj",
42
+ "gate_proj",
43
+ "up_proj"
44
+ ],
45
+ "target_parameters": null,
46
+ "task_type": "CAUSAL_LM",
47
+ "trainable_token_indices": null,
48
+ "use_bdlora": null,
49
+ "use_dora": false,
50
+ "use_qalora": false,
51
+ "use_rslora": false
52
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9226b3df264d076d04548e01a41203cd86d7640a7e7c5e906188abe89aa66465
3
+ size 239536272
chat_template.jinja ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0]['role'] == 'system' %}
4
+ {{- messages[0]['content'] }}
5
+ {%- else %}
6
+ {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
7
+ {%- endif %}
8
+ {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
9
+ {%- for tool in tools %}
10
+ {{- "\n" }}
11
+ {{- tool | tojson }}
12
+ {%- endfor %}
13
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
14
+ {%- else %}
15
+ {%- if messages[0]['role'] == 'system' %}
16
+ {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
17
+ {%- else %}
18
+ {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
19
+ {%- endif %}
20
+ {%- endif %}
21
+ {%- for message in messages %}
22
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
23
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
24
+ {%- elif message.role == "assistant" %}
25
+ {{- '<|im_start|>' + message.role }}
26
+ {%- if message.content %}
27
+ {{- '\n' + message.content }}
28
+ {%- endif %}
29
+ {%- for tool_call in message.tool_calls %}
30
+ {%- if tool_call.function is defined %}
31
+ {%- set tool_call = tool_call.function %}
32
+ {%- endif %}
33
+ {{- '\n<tool_call>\n{"name": "' }}
34
+ {{- tool_call.name }}
35
+ {{- '", "arguments": ' }}
36
+ {{- tool_call.arguments | tojson }}
37
+ {{- '}\n</tool_call>' }}
38
+ {%- endfor %}
39
+ {{- '<|im_end|>\n' }}
40
+ {%- elif message.role == "tool" %}
41
+ {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
42
+ {{- '<|im_start|>user' }}
43
+ {%- endif %}
44
+ {{- '\n<tool_response>\n' }}
45
+ {{- message.content }}
46
+ {{- '\n</tool_response>' }}
47
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
48
+ {{- '<|im_end|>\n' }}
49
+ {%- endif %}
50
+ {%- endif %}
51
+ {%- endfor %}
52
+ {%- if add_generation_prompt %}
53
+ {{- '<|im_start|>assistant\n' }}
54
+ {%- endif %}
run_config.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "ladder-3b-kaggle",
3
+ "data": {
4
+ "dataset": "open-r1/codeforces-cots",
5
+ "config_name": "solutions_py_decontaminated",
6
+ "split": "train",
7
+ "max_tokens": 8192,
8
+ "min_tokens": 256,
9
+ "min_rating": null,
10
+ "max_rating": null,
11
+ "require_finish_reason": "stop",
12
+ "dedup_by_problem": true,
13
+ "verify_solutions": true,
14
+ "verify_max_tests": 4,
15
+ "verify_timeout": 5.0,
16
+ "verify_memory_limit_mb": 1024,
17
+ "verify_workers": 8,
18
+ "verify_keep_unverifiable": true,
19
+ "val_fraction": 0.04,
20
+ "seed": 17,
21
+ "max_samples": 0
22
+ },
23
+ "model": {
24
+ "base_model": "unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit",
25
+ "max_seq_length": 8192,
26
+ "load_in_4bit": true,
27
+ "lora_r": 32,
28
+ "lora_alpha": 32,
29
+ "lora_dropout": 0.0,
30
+ "target_modules": [
31
+ "q_proj",
32
+ "k_proj",
33
+ "v_proj",
34
+ "o_proj",
35
+ "gate_proj",
36
+ "up_proj",
37
+ "down_proj"
38
+ ],
39
+ "use_gradient_checkpointing": "unsloth"
40
+ },
41
+ "train": {
42
+ "output_dir": "/kaggle/working/outputs/ladder-3b-kaggle",
43
+ "per_device_train_batch_size": 1,
44
+ "gradient_accumulation_steps": 16,
45
+ "num_train_epochs": 1.0,
46
+ "max_steps": 150,
47
+ "learning_rate": 0.0001,
48
+ "warmup_ratio": 0.03,
49
+ "lr_scheduler_type": "cosine",
50
+ "weight_decay": 0.01,
51
+ "optim": "adamw_8bit",
52
+ "max_grad_norm": 0.5,
53
+ "logging_steps": 5,
54
+ "save_steps": 75,
55
+ "save_total_limit": 2,
56
+ "eval_steps": 100,
57
+ "seed": 17,
58
+ "train_on_completions_only": true,
59
+ "hub_model_id": null,
60
+ "push_to_hub": false
61
+ },
62
+ "eval": {
63
+ "dataset": "open-r1/codeforces-cots",
64
+ "config_name": "solutions_py_decontaminated",
65
+ "split": "train",
66
+ "num_problems": 40,
67
+ "samples_per_problem": 1,
68
+ "problem_types": [
69
+ "diff"
70
+ ],
71
+ "max_new_tokens": 4096,
72
+ "temperature": 0.0,
73
+ "top_p": 0.95,
74
+ "seed": 17,
75
+ "timeout_seconds": 8.0,
76
+ "memory_limit_mb": 1024,
77
+ "max_tests_per_problem": 12,
78
+ "case_sensitive": false,
79
+ "results_path": "/kaggle/working/outputs/eval/results.json"
80
+ }
81
+ }
throughput.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "train_runtime_seconds": 18178.6,
3
+ "train_runtime_hours": 5.05,
4
+ "n_examples": 2271,
5
+ "total_tokens": 10813978,
6
+ "tokens_per_second": 594.9,
7
+ "seconds_per_example": 8.005,
8
+ "mean_tokens_per_example": 4762,
9
+ "peak_vram_gb": 6.78,
10
+ "max_seq_length": 8192,
11
+ "effective_batch": 16,
12
+ "max_steps": 150,
13
+ "gpu": "Tesla T4"
14
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd5948af71b4f56cf697f7580814c7ce8b80595ef985544efcacf716126a2e31
3
+ size 11422356
tokenizer_config.json ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": false,
24
+ "model_max_length": 32768,
25
+ "pad_token": "<|PAD_TOKEN|>",
26
+ "padding_side": "left",
27
+ "split_special_tokens": false,
28
+ "tokenizer_class": "Qwen2Tokenizer",
29
+ "unk_token": null,
30
+ "added_tokens_decoder": {
31
+ "151643": {
32
+ "content": "<|endoftext|>",
33
+ "single_word": false,
34
+ "lstrip": false,
35
+ "rstrip": false,
36
+ "normalized": false,
37
+ "special": true
38
+ },
39
+ "151644": {
40
+ "content": "<|im_start|>",
41
+ "single_word": false,
42
+ "lstrip": false,
43
+ "rstrip": false,
44
+ "normalized": false,
45
+ "special": true
46
+ },
47
+ "151645": {
48
+ "content": "<|im_end|>",
49
+ "single_word": false,
50
+ "lstrip": false,
51
+ "rstrip": false,
52
+ "normalized": false,
53
+ "special": true
54
+ },
55
+ "151646": {
56
+ "content": "<|object_ref_start|>",
57
+ "single_word": false,
58
+ "lstrip": false,
59
+ "rstrip": false,
60
+ "normalized": false,
61
+ "special": true
62
+ },
63
+ "151647": {
64
+ "content": "<|object_ref_end|>",
65
+ "single_word": false,
66
+ "lstrip": false,
67
+ "rstrip": false,
68
+ "normalized": false,
69
+ "special": true
70
+ },
71
+ "151648": {
72
+ "content": "<|box_start|>",
73
+ "single_word": false,
74
+ "lstrip": false,
75
+ "rstrip": false,
76
+ "normalized": false,
77
+ "special": true
78
+ },
79
+ "151649": {
80
+ "content": "<|box_end|>",
81
+ "single_word": false,
82
+ "lstrip": false,
83
+ "rstrip": false,
84
+ "normalized": false,
85
+ "special": true
86
+ },
87
+ "151650": {
88
+ "content": "<|quad_start|>",
89
+ "single_word": false,
90
+ "lstrip": false,
91
+ "rstrip": false,
92
+ "normalized": false,
93
+ "special": true
94
+ },
95
+ "151651": {
96
+ "content": "<|quad_end|>",
97
+ "single_word": false,
98
+ "lstrip": false,
99
+ "rstrip": false,
100
+ "normalized": false,
101
+ "special": true
102
+ },
103
+ "151652": {
104
+ "content": "<|vision_start|>",
105
+ "single_word": false,
106
+ "lstrip": false,
107
+ "rstrip": false,
108
+ "normalized": false,
109
+ "special": true
110
+ },
111
+ "151653": {
112
+ "content": "<|vision_end|>",
113
+ "single_word": false,
114
+ "lstrip": false,
115
+ "rstrip": false,
116
+ "normalized": false,
117
+ "special": true
118
+ },
119
+ "151654": {
120
+ "content": "<|vision_pad|>",
121
+ "single_word": false,
122
+ "lstrip": false,
123
+ "rstrip": false,
124
+ "normalized": false,
125
+ "special": true
126
+ },
127
+ "151655": {
128
+ "content": "<|image_pad|>",
129
+ "single_word": false,
130
+ "lstrip": false,
131
+ "rstrip": false,
132
+ "normalized": false,
133
+ "special": true
134
+ },
135
+ "151656": {
136
+ "content": "<|video_pad|>",
137
+ "single_word": false,
138
+ "lstrip": false,
139
+ "rstrip": false,
140
+ "normalized": false,
141
+ "special": true
142
+ },
143
+ "151657": {
144
+ "content": "<tool_call>",
145
+ "single_word": false,
146
+ "lstrip": false,
147
+ "rstrip": false,
148
+ "normalized": false,
149
+ "special": false
150
+ },
151
+ "151658": {
152
+ "content": "</tool_call>",
153
+ "single_word": false,
154
+ "lstrip": false,
155
+ "rstrip": false,
156
+ "normalized": false,
157
+ "special": false
158
+ },
159
+ "151659": {
160
+ "content": "<|fim_prefix|>",
161
+ "single_word": false,
162
+ "lstrip": false,
163
+ "rstrip": false,
164
+ "normalized": false,
165
+ "special": false
166
+ },
167
+ "151660": {
168
+ "content": "<|fim_middle|>",
169
+ "single_word": false,
170
+ "lstrip": false,
171
+ "rstrip": false,
172
+ "normalized": false,
173
+ "special": false
174
+ },
175
+ "151661": {
176
+ "content": "<|fim_suffix|>",
177
+ "single_word": false,
178
+ "lstrip": false,
179
+ "rstrip": false,
180
+ "normalized": false,
181
+ "special": false
182
+ },
183
+ "151662": {
184
+ "content": "<|fim_pad|>",
185
+ "single_word": false,
186
+ "lstrip": false,
187
+ "rstrip": false,
188
+ "normalized": false,
189
+ "special": false
190
+ },
191
+ "151663": {
192
+ "content": "<|repo_name|>",
193
+ "single_word": false,
194
+ "lstrip": false,
195
+ "rstrip": false,
196
+ "normalized": false,
197
+ "special": false
198
+ },
199
+ "151664": {
200
+ "content": "<|file_sep|>",
201
+ "single_word": false,
202
+ "lstrip": false,
203
+ "rstrip": false,
204
+ "normalized": false,
205
+ "special": false
206
+ },
207
+ "151665": {
208
+ "content": "<|PAD_TOKEN|>",
209
+ "single_word": false,
210
+ "lstrip": false,
211
+ "rstrip": false,
212
+ "normalized": false,
213
+ "special": true
214
+ }
215
+ }
216
+ }