commit d67e7301861ba49986b13b16396192ce120eae94 Author: ModelHub XC Date: Sat Jun 13 15:53:16 2026 +0800 初始化项目,由ModelHub XC社区提供模型 Model: christinakopi/thinkprm-full-trl Source: Original Platform diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..40b9d20 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,38 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +checkpoint-64/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-96/tokenizer.json filter=lfs diff=lfs merge=lfs -text +tokenizer.json filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..357bc47 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +--- +base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B +library_name: transformers +model_name: thinkprm-full-trl +tags: +- generated_from_trainer +- sft +- trl +licence: license +--- + +# Model Card for thinkprm-full-trl + +This model is a fine-tuned version of [deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B). +It has been trained using [TRL](https://github.com/huggingface/trl). + +## Quick start + +```python +from transformers import pipeline + +question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?" +generator = pipeline("text-generation", model="None", device="cuda") +output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0] +print(output["generated_text"]) +``` + +## Training procedure + +[Visualize in Weights & Biases](https://wandb.ai/christina-kopidaki-epfl/thinkprm/runs/89hedlc3) + + + +This model was trained with SFT. + +### Framework versions + +- TRL: 1.0.0 +- Transformers: 5.5.0 +- Pytorch: 2.5.1+cu118 +- Datasets: 4.8.4 +- Tokenizers: 0.22.2 + +## Citations + + + +Cite TRL as: + +```bibtex +@software{vonwerra2020trl, + title = {{TRL: Transformers Reinforcement Learning}}, + author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin}, + license = {Apache-2.0}, + url = {https://github.com/huggingface/trl}, + year = {2020} +} +``` \ No newline at end of file diff --git a/chat_template.jinja b/chat_template.jinja new file mode 100644 index 0000000..c2066bd --- /dev/null +++ b/chat_template.jinja @@ -0,0 +1 @@ +{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '' in content %}{% set content = content.split('')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>\n'}}{% endif %} \ No newline at end of file diff --git a/checkpoint-64/chat_template.jinja b/checkpoint-64/chat_template.jinja new file mode 100644 index 0000000..c2066bd --- /dev/null +++ b/checkpoint-64/chat_template.jinja @@ -0,0 +1 @@ +{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '' in content %}{% set content = content.split('')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>\n'}}{% endif %} \ No newline at end of file diff --git a/checkpoint-64/config.json b/checkpoint-64/config.json new file mode 100644 index 0000000..9b05f54 --- /dev/null +++ b/checkpoint-64/config.json @@ -0,0 +1,62 @@ +{ + "architectures": [ + "Qwen2ForCausalLM" + ], + "attention_dropout": 0.0, + "bos_token_id": 151646, + "dtype": "bfloat16", + "eos_token_id": 151643, + "hidden_act": "silu", + "hidden_size": 1536, + "initializer_range": 0.02, + "intermediate_size": 8960, + "layer_types": [ + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention" + ], + "max_position_embeddings": 131072, + "max_window_layers": 21, + "model_type": "qwen2", + "num_attention_heads": 12, + "num_hidden_layers": 28, + "num_key_value_heads": 2, + "pad_token_id": 151643, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "rope_theta": 10000, + "rope_type": "default" + }, + "sliding_window": null, + "tie_word_embeddings": false, + "transformers_version": "5.5.0", + "use_cache": false, + "use_mrope": false, + "use_sliding_window": false, + "vocab_size": 151936 +} diff --git a/checkpoint-64/generation_config.json b/checkpoint-64/generation_config.json new file mode 100644 index 0000000..5c1a349 --- /dev/null +++ b/checkpoint-64/generation_config.json @@ -0,0 +1,12 @@ +{ + "_from_model_config": true, + "bos_token_id": 151646, + "do_sample": true, + "eos_token_id": [ + 151643 + ], + "pad_token_id": 151643, + "temperature": 0.6, + "top_p": 0.95, + "transformers_version": "5.5.0" +} diff --git a/checkpoint-64/model.safetensors b/checkpoint-64/model.safetensors new file mode 100644 index 0000000..8605d2c --- /dev/null +++ b/checkpoint-64/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80b03bce94ee75fd40e7e0634cabf03b5ae45b09f4994f9c80d36c32d6c55c5d +size 3554214752 diff --git a/checkpoint-64/optimizer.pt b/checkpoint-64/optimizer.pt new file mode 100644 index 0000000..54eb063 --- /dev/null +++ b/checkpoint-64/optimizer.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a6a08938e221b78f29b51efd7fcef340d6be254e56950bb4b625c8d34efce6a +size 7108644139 diff --git a/checkpoint-64/rng_state_0.pth b/checkpoint-64/rng_state_0.pth new file mode 100644 index 0000000..fbb045d --- /dev/null +++ b/checkpoint-64/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a6ec98147904582f9073debdd2d46db8be81f1fae8b7e30a4fb33c0724bf01a +size 15024 diff --git a/checkpoint-64/rng_state_1.pth b/checkpoint-64/rng_state_1.pth new file mode 100644 index 0000000..0233b83 --- /dev/null +++ b/checkpoint-64/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53345026ed0535abd8cf6a0e1ecbdbf9a4d5ef86d37a344cbca5ef2567e6cc18 +size 15024 diff --git a/checkpoint-64/rng_state_2.pth b/checkpoint-64/rng_state_2.pth new file mode 100644 index 0000000..1be0966 --- /dev/null +++ b/checkpoint-64/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb45d6dbfeb6c6a340bea2c45d80cd63df0bd6b093ca44076be3a394a5390059 +size 15024 diff --git a/checkpoint-64/rng_state_3.pth b/checkpoint-64/rng_state_3.pth new file mode 100644 index 0000000..a436b67 --- /dev/null +++ b/checkpoint-64/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:184eba8fad81b78f577f59c07102dc1253cd2cdbd814ae3d20c579d2332fc55c +size 15024 diff --git a/checkpoint-64/scheduler.pt b/checkpoint-64/scheduler.pt new file mode 100644 index 0000000..88f0e38 --- /dev/null +++ b/checkpoint-64/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38aae7f031adb4bca6603aca638a1be57deaca2e29f6d25a07754ffcad18fba3 +size 1064 diff --git a/checkpoint-64/tokenizer.json b/checkpoint-64/tokenizer.json new file mode 100644 index 0000000..4306d79 --- /dev/null +++ b/checkpoint-64/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:322664cdc3082b6eba003af5228a77ca1d7936d402e584ecde8f15d3d98bdb72 +size 11421911 diff --git a/checkpoint-64/tokenizer_config.json b/checkpoint-64/tokenizer_config.json new file mode 100644 index 0000000..cab3a59 --- /dev/null +++ b/checkpoint-64/tokenizer_config.json @@ -0,0 +1,13 @@ +{ + "backend": "tokenizers", + "bos_token": "<|begin▁of▁sentence|>", + "clean_up_tokenization_spaces": false, + "eos_token": "<|end▁of▁sentence|>", + "is_local": false, + "legacy": true, + "model_max_length": 16384, + "pad_token": "<|end▁of▁sentence|>", + "sp_model_kwargs": {}, + "tokenizer_class": "TokenizersBackend", + "unk_token": null +} diff --git a/checkpoint-64/trainer_state.json b/checkpoint-64/trainer_state.json new file mode 100644 index 0000000..34b6ee9 --- /dev/null +++ b/checkpoint-64/trainer_state.json @@ -0,0 +1,94 @@ +{ + "best_global_step": null, + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 2.0, + "eval_steps": 100, + "global_step": 64, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "entropy": 0.4654052224010229, + "epoch": 0.32, + "grad_norm": 0.048828125, + "learning_rate": 6e-05, + "loss": 0.30594801902770996, + "mean_token_accuracy": 0.9038856193423271, + "num_tokens": 460568.0, + "step": 10 + }, + { + "entropy": 0.42793196588754656, + "epoch": 0.64, + "grad_norm": 0.050537109375, + "learning_rate": 6e-05, + "loss": 0.2569255828857422, + "mean_token_accuracy": 0.9156977899372578, + "num_tokens": 916064.0, + "step": 20 + }, + { + "entropy": 0.41921926364302636, + "epoch": 0.96, + "grad_norm": 0.043701171875, + "learning_rate": 6e-05, + "loss": 0.26015210151672363, + "mean_token_accuracy": 0.9139690645039081, + "num_tokens": 1373088.0, + "step": 30 + }, + { + "entropy": 0.38780535757541656, + "epoch": 1.256, + "grad_norm": 0.042724609375, + "learning_rate": 6e-05, + "loss": 0.1978880524635315, + "mean_token_accuracy": 0.9332824486332971, + "num_tokens": 1799690.0, + "step": 40 + }, + { + "entropy": 0.3551080597564578, + "epoch": 1.576, + "grad_norm": 0.041259765625, + "learning_rate": 6e-05, + "loss": 0.18691558837890626, + "mean_token_accuracy": 0.9357104673981667, + "num_tokens": 2257096.0, + "step": 50 + }, + { + "entropy": 0.34900726228952406, + "epoch": 1.896, + "grad_norm": 0.042236328125, + "learning_rate": 6e-05, + "loss": 0.1920093059539795, + "mean_token_accuracy": 0.9355965360999108, + "num_tokens": 2710250.0, + "step": 60 + } + ], + "logging_steps": 10, + "max_steps": 96, + "num_input_tokens_seen": 0, + "num_train_epochs": 3, + "save_steps": 100, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 2.6497787881324544e+16, + "train_batch_size": 1, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-64/training_args.bin b/checkpoint-64/training_args.bin new file mode 100644 index 0000000..01ed848 --- /dev/null +++ b/checkpoint-64/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b6ba99fbb102272b4ce278ab05ae0e477eb8ff8bab9f89f281c9f2c3dce6e1d +size 5304 diff --git a/checkpoint-96/chat_template.jinja b/checkpoint-96/chat_template.jinja new file mode 100644 index 0000000..c2066bd --- /dev/null +++ b/checkpoint-96/chat_template.jinja @@ -0,0 +1 @@ +{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '' in content %}{% set content = content.split('')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>\n'}}{% endif %} \ No newline at end of file diff --git a/checkpoint-96/config.json b/checkpoint-96/config.json new file mode 100644 index 0000000..9b05f54 --- /dev/null +++ b/checkpoint-96/config.json @@ -0,0 +1,62 @@ +{ + "architectures": [ + "Qwen2ForCausalLM" + ], + "attention_dropout": 0.0, + "bos_token_id": 151646, + "dtype": "bfloat16", + "eos_token_id": 151643, + "hidden_act": "silu", + "hidden_size": 1536, + "initializer_range": 0.02, + "intermediate_size": 8960, + "layer_types": [ + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention" + ], + "max_position_embeddings": 131072, + "max_window_layers": 21, + "model_type": "qwen2", + "num_attention_heads": 12, + "num_hidden_layers": 28, + "num_key_value_heads": 2, + "pad_token_id": 151643, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "rope_theta": 10000, + "rope_type": "default" + }, + "sliding_window": null, + "tie_word_embeddings": false, + "transformers_version": "5.5.0", + "use_cache": false, + "use_mrope": false, + "use_sliding_window": false, + "vocab_size": 151936 +} diff --git a/checkpoint-96/generation_config.json b/checkpoint-96/generation_config.json new file mode 100644 index 0000000..5c1a349 --- /dev/null +++ b/checkpoint-96/generation_config.json @@ -0,0 +1,12 @@ +{ + "_from_model_config": true, + "bos_token_id": 151646, + "do_sample": true, + "eos_token_id": [ + 151643 + ], + "pad_token_id": 151643, + "temperature": 0.6, + "top_p": 0.95, + "transformers_version": "5.5.0" +} diff --git a/checkpoint-96/model.safetensors b/checkpoint-96/model.safetensors new file mode 100644 index 0000000..eb54c3b --- /dev/null +++ b/checkpoint-96/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83f9c059687a03a4e06639ac7491380843bf59ec2c7e6e803f0fa60ae395c5cf +size 3554214752 diff --git a/checkpoint-96/optimizer.pt b/checkpoint-96/optimizer.pt new file mode 100644 index 0000000..d9351c9 --- /dev/null +++ b/checkpoint-96/optimizer.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea1d8d8d133716e4cc980be5c28c30fbe5ffdd8bf60b7d244738e8543e52425d +size 7108644139 diff --git a/checkpoint-96/rng_state_0.pth b/checkpoint-96/rng_state_0.pth new file mode 100644 index 0000000..25c968b --- /dev/null +++ b/checkpoint-96/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03269e9b7ea16cd98a78d6ea7a50b8454cbd266a053c02f734d27c4d0056b89d +size 15024 diff --git a/checkpoint-96/rng_state_1.pth b/checkpoint-96/rng_state_1.pth new file mode 100644 index 0000000..955a80e --- /dev/null +++ b/checkpoint-96/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4509495bd2a081212bbe15f7d1784af338aff3aadb1c5fe444c3f44626992d0 +size 15024 diff --git a/checkpoint-96/rng_state_2.pth b/checkpoint-96/rng_state_2.pth new file mode 100644 index 0000000..fa005c7 --- /dev/null +++ b/checkpoint-96/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:104638f895e79f68373b82e8ca745e8070a37851d21a073a0fa5ae1db47649d6 +size 15024 diff --git a/checkpoint-96/rng_state_3.pth b/checkpoint-96/rng_state_3.pth new file mode 100644 index 0000000..104e9cc --- /dev/null +++ b/checkpoint-96/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:765f109d2f595ccad091f8175cdf531d159f08de0ff5196e08c6bb1d0ceda0d5 +size 15024 diff --git a/checkpoint-96/scheduler.pt b/checkpoint-96/scheduler.pt new file mode 100644 index 0000000..e466a89 --- /dev/null +++ b/checkpoint-96/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b45fa5872c6b94546611865552c748b8465c292687e6f6f8c42dfe9aff51ed39 +size 1064 diff --git a/checkpoint-96/tokenizer.json b/checkpoint-96/tokenizer.json new file mode 100644 index 0000000..4306d79 --- /dev/null +++ b/checkpoint-96/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:322664cdc3082b6eba003af5228a77ca1d7936d402e584ecde8f15d3d98bdb72 +size 11421911 diff --git a/checkpoint-96/tokenizer_config.json b/checkpoint-96/tokenizer_config.json new file mode 100644 index 0000000..cab3a59 --- /dev/null +++ b/checkpoint-96/tokenizer_config.json @@ -0,0 +1,13 @@ +{ + "backend": "tokenizers", + "bos_token": "<|begin▁of▁sentence|>", + "clean_up_tokenization_spaces": false, + "eos_token": "<|end▁of▁sentence|>", + "is_local": false, + "legacy": true, + "model_max_length": 16384, + "pad_token": "<|end▁of▁sentence|>", + "sp_model_kwargs": {}, + "tokenizer_class": "TokenizersBackend", + "unk_token": null +} diff --git a/checkpoint-96/trainer_state.json b/checkpoint-96/trainer_state.json new file mode 100644 index 0000000..fbb9893 --- /dev/null +++ b/checkpoint-96/trainer_state.json @@ -0,0 +1,124 @@ +{ + "best_global_step": null, + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 3.0, + "eval_steps": 100, + "global_step": 96, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "entropy": 0.4654052224010229, + "epoch": 0.32, + "grad_norm": 0.048828125, + "learning_rate": 6e-05, + "loss": 0.30594801902770996, + "mean_token_accuracy": 0.9038856193423271, + "num_tokens": 460568.0, + "step": 10 + }, + { + "entropy": 0.42793196588754656, + "epoch": 0.64, + "grad_norm": 0.050537109375, + "learning_rate": 6e-05, + "loss": 0.2569255828857422, + "mean_token_accuracy": 0.9156977899372578, + "num_tokens": 916064.0, + "step": 20 + }, + { + "entropy": 0.41921926364302636, + "epoch": 0.96, + "grad_norm": 0.043701171875, + "learning_rate": 6e-05, + "loss": 0.26015210151672363, + "mean_token_accuracy": 0.9139690645039081, + "num_tokens": 1373088.0, + "step": 30 + }, + { + "entropy": 0.38780535757541656, + "epoch": 1.256, + "grad_norm": 0.042724609375, + "learning_rate": 6e-05, + "loss": 0.1978880524635315, + "mean_token_accuracy": 0.9332824486332971, + "num_tokens": 1799690.0, + "step": 40 + }, + { + "entropy": 0.3551080597564578, + "epoch": 1.576, + "grad_norm": 0.041259765625, + "learning_rate": 6e-05, + "loss": 0.18691558837890626, + "mean_token_accuracy": 0.9357104673981667, + "num_tokens": 2257096.0, + "step": 50 + }, + { + "entropy": 0.34900726228952406, + "epoch": 1.896, + "grad_norm": 0.042236328125, + "learning_rate": 6e-05, + "loss": 0.1920093059539795, + "mean_token_accuracy": 0.9355965360999108, + "num_tokens": 2710250.0, + "step": 60 + }, + { + "entropy": 0.32550016951722066, + "epoch": 2.192, + "grad_norm": 0.04443359375, + "learning_rate": 6e-05, + "loss": 0.16194652318954467, + "mean_token_accuracy": 0.945790433400386, + "num_tokens": 3126379.0, + "step": 70 + }, + { + "entropy": 0.2879067212343216, + "epoch": 2.512, + "grad_norm": 0.040771484375, + "learning_rate": 6e-05, + "loss": 0.14068626165390014, + "mean_token_accuracy": 0.951568552851677, + "num_tokens": 3590470.0, + "step": 80 + }, + { + "entropy": 0.27728699781000615, + "epoch": 2.832, + "grad_norm": 0.04052734375, + "learning_rate": 6e-05, + "loss": 0.134770405292511, + "mean_token_accuracy": 0.9545286163687706, + "num_tokens": 4047880.0, + "step": 90 + } + ], + "logging_steps": 10, + "max_steps": 96, + "num_input_tokens_seen": 0, + "num_train_epochs": 3, + "save_steps": 100, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": true + }, + "attributes": {} + } + }, + "total_flos": 3.97466818052096e+16, + "train_batch_size": 1, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-96/training_args.bin b/checkpoint-96/training_args.bin new file mode 100644 index 0000000..01ed848 --- /dev/null +++ b/checkpoint-96/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b6ba99fbb102272b4ce278ab05ae0e477eb8ff8bab9f89f281c9f2c3dce6e1d +size 5304 diff --git a/config.json b/config.json new file mode 100644 index 0000000..9b05f54 --- /dev/null +++ b/config.json @@ -0,0 +1,62 @@ +{ + "architectures": [ + "Qwen2ForCausalLM" + ], + "attention_dropout": 0.0, + "bos_token_id": 151646, + "dtype": "bfloat16", + "eos_token_id": 151643, + "hidden_act": "silu", + "hidden_size": 1536, + "initializer_range": 0.02, + "intermediate_size": 8960, + "layer_types": [ + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention" + ], + "max_position_embeddings": 131072, + "max_window_layers": 21, + "model_type": "qwen2", + "num_attention_heads": 12, + "num_hidden_layers": 28, + "num_key_value_heads": 2, + "pad_token_id": 151643, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "rope_theta": 10000, + "rope_type": "default" + }, + "sliding_window": null, + "tie_word_embeddings": false, + "transformers_version": "5.5.0", + "use_cache": false, + "use_mrope": false, + "use_sliding_window": false, + "vocab_size": 151936 +} diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..5c1a349 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,12 @@ +{ + "_from_model_config": true, + "bos_token_id": 151646, + "do_sample": true, + "eos_token_id": [ + 151643 + ], + "pad_token_id": 151643, + "temperature": 0.6, + "top_p": 0.95, + "transformers_version": "5.5.0" +} diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..eb54c3b --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83f9c059687a03a4e06639ac7491380843bf59ec2c7e6e803f0fa60ae395c5cf +size 3554214752 diff --git a/run_config.json b/run_config.json new file mode 100644 index 0000000..1b494fb --- /dev/null +++ b/run_config.json @@ -0,0 +1,30 @@ +{ + "dataloader_num_workers": 0, + "eval_hf_split": null, + "eval_split_ratio": 0.0, + "eval_steps": 100, + "eval_strategy": "no", + "gradient_accumulation_steps": 8, + "gradient_checkpointing": true, + "hf_dataset": "launch/thinkprm-1K-verification-cots", + "hf_split": "train", + "learning_rate": 6e-05, + "logging_steps": 10, + "lr_scheduler_type": "constant", + "max_grad_norm": 1.0, + "max_length": 4096, + "model_name_or_path": "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", + "num_train_epochs": 3.0, + "output_dir": "/mnt/nlp/scratch/home/kopidaki/outputs/thinkprm-full-trl", + "per_device_eval_batch_size": 1, + "per_device_train_batch_size": 1, + "repo_root": "/mnt/nlp/scratch/home/kopidaki/ThinkPRM/", + "report_to": "wandb", + "resume_from_checkpoint": null, + "save_steps": 100, + "save_strategy": "epoch", + "save_total_limit": 2, + "seed": 42, + "warmup_ratio": 0.0, + "weight_decay": 0.0 +} \ No newline at end of file diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..4306d79 --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:322664cdc3082b6eba003af5228a77ca1d7936d402e584ecde8f15d3d98bdb72 +size 11421911 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..cab3a59 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,13 @@ +{ + "backend": "tokenizers", + "bos_token": "<|begin▁of▁sentence|>", + "clean_up_tokenization_spaces": false, + "eos_token": "<|end▁of▁sentence|>", + "is_local": false, + "legacy": true, + "model_max_length": 16384, + "pad_token": "<|end▁of▁sentence|>", + "sp_model_kwargs": {}, + "tokenizer_class": "TokenizersBackend", + "unk_token": null +} diff --git a/trainer_state.json b/trainer_state.json new file mode 100644 index 0000000..ee18b13 --- /dev/null +++ b/trainer_state.json @@ -0,0 +1,136 @@ +{ + "best_global_step": null, + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 3.0, + "eval_steps": 100, + "global_step": 96, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "entropy": 0.4654052224010229, + "epoch": 0.32, + "grad_norm": 0.048828125, + "learning_rate": 6e-05, + "loss": 0.30594801902770996, + "mean_token_accuracy": 0.9038856193423271, + "num_tokens": 460568.0, + "step": 10 + }, + { + "entropy": 0.42793196588754656, + "epoch": 0.64, + "grad_norm": 0.050537109375, + "learning_rate": 6e-05, + "loss": 0.2569255828857422, + "mean_token_accuracy": 0.9156977899372578, + "num_tokens": 916064.0, + "step": 20 + }, + { + "entropy": 0.41921926364302636, + "epoch": 0.96, + "grad_norm": 0.043701171875, + "learning_rate": 6e-05, + "loss": 0.26015210151672363, + "mean_token_accuracy": 0.9139690645039081, + "num_tokens": 1373088.0, + "step": 30 + }, + { + "entropy": 0.38780535757541656, + "epoch": 1.256, + "grad_norm": 0.042724609375, + "learning_rate": 6e-05, + "loss": 0.1978880524635315, + "mean_token_accuracy": 0.9332824486332971, + "num_tokens": 1799690.0, + "step": 40 + }, + { + "entropy": 0.3551080597564578, + "epoch": 1.576, + "grad_norm": 0.041259765625, + "learning_rate": 6e-05, + "loss": 0.18691558837890626, + "mean_token_accuracy": 0.9357104673981667, + "num_tokens": 2257096.0, + "step": 50 + }, + { + "entropy": 0.34900726228952406, + "epoch": 1.896, + "grad_norm": 0.042236328125, + "learning_rate": 6e-05, + "loss": 0.1920093059539795, + "mean_token_accuracy": 0.9355965360999108, + "num_tokens": 2710250.0, + "step": 60 + }, + { + "entropy": 0.32550016951722066, + "epoch": 2.192, + "grad_norm": 0.04443359375, + "learning_rate": 6e-05, + "loss": 0.16194652318954467, + "mean_token_accuracy": 0.945790433400386, + "num_tokens": 3126379.0, + "step": 70 + }, + { + "entropy": 0.2879067212343216, + "epoch": 2.512, + "grad_norm": 0.040771484375, + "learning_rate": 6e-05, + "loss": 0.14068626165390014, + "mean_token_accuracy": 0.951568552851677, + "num_tokens": 3590470.0, + "step": 80 + }, + { + "entropy": 0.27728699781000615, + "epoch": 2.832, + "grad_norm": 0.04052734375, + "learning_rate": 6e-05, + "loss": 0.134770405292511, + "mean_token_accuracy": 0.9545286163687706, + "num_tokens": 4047880.0, + "step": 90 + }, + { + "entropy": 0.29260293891032535, + "epoch": 3.0, + "mean_token_accuracy": 0.9474576853570484, + "num_tokens": 4291239.0, + "step": 96, + "total_flos": 3.97466818052096e+16, + "train_loss": 0.20133286652465662, + "train_runtime": 225.298, + "train_samples_per_second": 13.316, + "train_steps_per_second": 0.426 + } + ], + "logging_steps": 10, + "max_steps": 96, + "num_input_tokens_seen": 0, + "num_train_epochs": 3, + "save_steps": 100, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": true + }, + "attributes": {} + } + }, + "total_flos": 3.97466818052096e+16, + "train_batch_size": 1, + "trial_name": null, + "trial_params": null +} diff --git a/training_args.bin b/training_args.bin new file mode 100644 index 0000000..01ed848 --- /dev/null +++ b/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b6ba99fbb102272b4ce278ab05ae0e477eb8ff8bab9f89f281c9f2c3dce6e1d +size 5304