commit 0952fa0201f7849e353b79eb257acaf68dc9d710 Author: ModelHub XC Date: Sat Apr 25 13:24:12 2026 +0800 初始化项目,由ModelHub XC社区提供模型 Model: christinakopi/thinkprm-reproduced Source: Original Platform diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..85949cb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,37 @@ +*.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-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..a21751e --- /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 +- trl +- sft +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/n503017k) + + + +This model was trained with SFT. + +### Framework versions + +- TRL: 1.0.0 +- Transformers: 4.57.1 +- Pytorch: 2.9.1 +- 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-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..b3f6160 --- /dev/null +++ b/checkpoint-96/config.json @@ -0,0 +1,60 @@ +{ + "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_scaling": null, + "rope_theta": 10000, + "sliding_window": null, + "tie_word_embeddings": false, + "transformers_version": "4.57.1", + "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..acaf452 --- /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": "4.57.1" +} diff --git a/checkpoint-96/model.safetensors b/checkpoint-96/model.safetensors new file mode 100644 index 0000000..c41c9c5 --- /dev/null +++ b/checkpoint-96/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a31b6fd8188d4f715795ebd360779551b7f6bc6b26389be8aaedccc7a41db2ab +size 3554214752 diff --git a/checkpoint-96/optimizer.pt b/checkpoint-96/optimizer.pt new file mode 100644 index 0000000..75a8ffb --- /dev/null +++ b/checkpoint-96/optimizer.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e05ef43bc51970c4be97c15872c11f1729731154a6602968df8f6d4f1cbd5f3f +size 7108649420 diff --git a/checkpoint-96/rng_state_0.pth b/checkpoint-96/rng_state_0.pth new file mode 100644 index 0000000..245c10b --- /dev/null +++ b/checkpoint-96/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c213a373f3e5d95993ad095a3790a902d821a1b4b93a10cc7d382c8726fcb9d +size 15429 diff --git a/checkpoint-96/rng_state_1.pth b/checkpoint-96/rng_state_1.pth new file mode 100644 index 0000000..d97adfe --- /dev/null +++ b/checkpoint-96/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fb125336725f7741cb4daa1e3d06e225bbacfde8d41c4dcabb6762c222e62c6 +size 15429 diff --git a/checkpoint-96/rng_state_2.pth b/checkpoint-96/rng_state_2.pth new file mode 100644 index 0000000..ee919d8 --- /dev/null +++ b/checkpoint-96/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:153c865f77c7129ba565bded50f334683d51c80f20e3cfec39e62f8737b86f0d +size 15429 diff --git a/checkpoint-96/rng_state_3.pth b/checkpoint-96/rng_state_3.pth new file mode 100644 index 0000000..40b15af --- /dev/null +++ b/checkpoint-96/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d017ce00fcebac7edc058ddd138f194eb0340f2d8ad0879bdab08f922ed0846e +size 15429 diff --git a/checkpoint-96/scheduler.pt b/checkpoint-96/scheduler.pt new file mode 100644 index 0000000..46f7699 --- /dev/null +++ b/checkpoint-96/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6b7ca0f5c6b0bb6d0c1dfeacab7eba3b70d0c96d4bf1319099d9ddda7e89b41 +size 1465 diff --git a/checkpoint-96/special_tokens_map.json b/checkpoint-96/special_tokens_map.json new file mode 100644 index 0000000..1d385d6 --- /dev/null +++ b/checkpoint-96/special_tokens_map.json @@ -0,0 +1,23 @@ +{ + "bos_token": { + "content": "<|begin▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|end▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "<|end▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-96/tokenizer.json b/checkpoint-96/tokenizer.json new file mode 100644 index 0000000..1a2db24 --- /dev/null +++ b/checkpoint-96/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e20ddafc659ba90242154b55275402edeca0715e5dbb30f56815a4ce081f4893 +size 11422778 diff --git a/checkpoint-96/tokenizer_config.json b/checkpoint-96/tokenizer_config.json new file mode 100644 index 0000000..d252dd4 --- /dev/null +++ b/checkpoint-96/tokenizer_config.json @@ -0,0 +1,194 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": null, + "added_tokens_decoder": { + "151643": { + "content": "<|end▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151644": { + "content": "<|User|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151645": { + "content": "<|Assistant|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151646": { + "content": "<|begin▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151647": { + "content": "<|EOT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151648": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151649": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151650": { + "content": "<|quad_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151651": { + "content": "<|quad_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151652": { + "content": "<|vision_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151653": { + "content": "<|vision_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151654": { + "content": "<|vision_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151655": { + "content": "<|image_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151656": { + "content": "<|video_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151657": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151658": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151659": { + "content": "<|fim_prefix|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151660": { + "content": "<|fim_middle|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151661": { + "content": "<|fim_suffix|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151662": { + "content": "<|fim_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151663": { + "content": "<|repo_name|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151664": { + "content": "<|file_sep|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "<|begin▁of▁sentence|>", + "clean_up_tokenization_spaces": false, + "eos_token": "<|end▁of▁sentence|>", + "extra_special_tokens": {}, + "legacy": true, + "model_max_length": 16384, + "pad_token": "<|end▁of▁sentence|>", + "sp_model_kwargs": {}, + "tokenizer_class": "LlamaTokenizerFast", + "unk_token": null, + "use_default_system_prompt": false +} diff --git a/checkpoint-96/trainer_state.json b/checkpoint-96/trainer_state.json new file mode 100644 index 0000000..f0715dd --- /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": 500, + "global_step": 96, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "entropy": 0.4163570161908865, + "epoch": 0.32, + "grad_norm": 0.4453125, + "learning_rate": 6e-05, + "loss": 0.427, + "mean_token_accuracy": 0.879430927336216, + "num_tokens": 459017.0, + "step": 10 + }, + { + "entropy": 0.3372706573456526, + "epoch": 0.64, + "grad_norm": 0.447265625, + "learning_rate": 6e-05, + "loss": 0.3233, + "mean_token_accuracy": 0.9003406524658203, + "num_tokens": 912954.0, + "step": 20 + }, + { + "entropy": 0.32121987249702216, + "epoch": 0.96, + "grad_norm": 0.380859375, + "learning_rate": 6e-05, + "loss": 0.3098, + "mean_token_accuracy": 0.9014183498919011, + "num_tokens": 1368462.0, + "step": 30 + }, + { + "entropy": 0.27086804344041926, + "epoch": 1.256, + "grad_norm": 0.34375, + "learning_rate": 6e-05, + "loss": 0.2439, + "mean_token_accuracy": 0.9211577402578818, + "num_tokens": 1793628.0, + "step": 40 + }, + { + "entropy": 0.2517373651266098, + "epoch": 1.576, + "grad_norm": 0.302734375, + "learning_rate": 6e-05, + "loss": 0.2284, + "mean_token_accuracy": 0.9240875385701657, + "num_tokens": 2249448.0, + "step": 50 + }, + { + "entropy": 0.2411576334387064, + "epoch": 1.896, + "grad_norm": 0.310546875, + "learning_rate": 6e-05, + "loss": 0.2257, + "mean_token_accuracy": 0.9256131462752819, + "num_tokens": 2701085.0, + "step": 60 + }, + { + "entropy": 0.21875436301972415, + "epoch": 2.192, + "grad_norm": 0.310546875, + "learning_rate": 6e-05, + "loss": 0.1978, + "mean_token_accuracy": 0.9344683112324895, + "num_tokens": 3115785.0, + "step": 70 + }, + { + "entropy": 0.1890676412731409, + "epoch": 2.512, + "grad_norm": 0.271484375, + "learning_rate": 6e-05, + "loss": 0.1723, + "mean_token_accuracy": 0.9410219177603721, + "num_tokens": 3578352.0, + "step": 80 + }, + { + "entropy": 0.17951820120215417, + "epoch": 2.832, + "grad_norm": 0.291015625, + "learning_rate": 6e-05, + "loss": 0.166, + "mean_token_accuracy": 0.9436265029013157, + "num_tokens": 4034155.0, + "step": 90 + } + ], + "logging_steps": 10, + "max_steps": 96, + "num_input_tokens_seen": 0, + "num_train_epochs": 3, + "save_steps": 500, + "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.961197133037568e+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..b17f8e7 --- /dev/null +++ b/checkpoint-96/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e94573a7ff1fac24dbcf711bb319e4c76911b176bf8be7a3332bd586a481c6ca +size 6417 diff --git a/config.json b/config.json new file mode 100644 index 0000000..b3f6160 --- /dev/null +++ b/config.json @@ -0,0 +1,60 @@ +{ + "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_scaling": null, + "rope_theta": 10000, + "sliding_window": null, + "tie_word_embeddings": false, + "transformers_version": "4.57.1", + "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..acaf452 --- /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": "4.57.1" +} diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..c41c9c5 --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a31b6fd8188d4f715795ebd360779551b7f6bc6b26389be8aaedccc7a41db2ab +size 3554214752 diff --git a/run_config.json b/run_config.json new file mode 100644 index 0000000..cb7c72d --- /dev/null +++ b/run_config.json @@ -0,0 +1,28 @@ +{ + "model_name_or_path": "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", + "repo_root": "/mnt/nlp/scratch/home/kopidaki/ThinkPRM/", + "hf_dataset": "launch/thinkprm-1K-verification-cots", + "hf_split": "train", + "eval_hf_split": null, + "eval_split_ratio": 0.0, + "output_dir": "/mnt/nlp/scratch/home/kopidaki/outputs/thinkprm-full-trl", + "num_train_epochs": 3.0, + "learning_rate": 6e-05, + "lr_scheduler_type": "constant", + "warmup_ratio": 0.0, + "per_device_train_batch_size": 1, + "per_device_eval_batch_size": 8, + "gradient_accumulation_steps": 8, + "max_length": 4096, + "dataloader_num_workers": 0, + "eval_strategy": "no", + "save_strategy": "steps", + "save_steps": 500, + "save_total_limit": null, + "logging_steps": 10, + "report_to": [ + "wandb" + ], + "seed": 42, + "gradient_checkpointing": true +} \ No newline at end of file diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..1d385d6 --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,23 @@ +{ + "bos_token": { + "content": "<|begin▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|end▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "<|end▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..1a2db24 --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e20ddafc659ba90242154b55275402edeca0715e5dbb30f56815a4ce081f4893 +size 11422778 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..d252dd4 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,194 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": null, + "added_tokens_decoder": { + "151643": { + "content": "<|end▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151644": { + "content": "<|User|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151645": { + "content": "<|Assistant|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151646": { + "content": "<|begin▁of▁sentence|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151647": { + "content": "<|EOT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151648": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151649": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151650": { + "content": "<|quad_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151651": { + "content": "<|quad_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151652": { + "content": "<|vision_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151653": { + "content": "<|vision_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151654": { + "content": "<|vision_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151655": { + "content": "<|image_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151656": { + "content": "<|video_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151657": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151658": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151659": { + "content": "<|fim_prefix|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151660": { + "content": "<|fim_middle|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151661": { + "content": "<|fim_suffix|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151662": { + "content": "<|fim_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151663": { + "content": "<|repo_name|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151664": { + "content": "<|file_sep|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "<|begin▁of▁sentence|>", + "clean_up_tokenization_spaces": false, + "eos_token": "<|end▁of▁sentence|>", + "extra_special_tokens": {}, + "legacy": true, + "model_max_length": 16384, + "pad_token": "<|end▁of▁sentence|>", + "sp_model_kwargs": {}, + "tokenizer_class": "LlamaTokenizerFast", + "unk_token": null, + "use_default_system_prompt": false +} diff --git a/trainer_state.json b/trainer_state.json new file mode 100644 index 0000000..588fc2e --- /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": 500, + "global_step": 96, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "entropy": 0.4163570161908865, + "epoch": 0.32, + "grad_norm": 0.4453125, + "learning_rate": 6e-05, + "loss": 0.427, + "mean_token_accuracy": 0.879430927336216, + "num_tokens": 459017.0, + "step": 10 + }, + { + "entropy": 0.3372706573456526, + "epoch": 0.64, + "grad_norm": 0.447265625, + "learning_rate": 6e-05, + "loss": 0.3233, + "mean_token_accuracy": 0.9003406524658203, + "num_tokens": 912954.0, + "step": 20 + }, + { + "entropy": 0.32121987249702216, + "epoch": 0.96, + "grad_norm": 0.380859375, + "learning_rate": 6e-05, + "loss": 0.3098, + "mean_token_accuracy": 0.9014183498919011, + "num_tokens": 1368462.0, + "step": 30 + }, + { + "entropy": 0.27086804344041926, + "epoch": 1.256, + "grad_norm": 0.34375, + "learning_rate": 6e-05, + "loss": 0.2439, + "mean_token_accuracy": 0.9211577402578818, + "num_tokens": 1793628.0, + "step": 40 + }, + { + "entropy": 0.2517373651266098, + "epoch": 1.576, + "grad_norm": 0.302734375, + "learning_rate": 6e-05, + "loss": 0.2284, + "mean_token_accuracy": 0.9240875385701657, + "num_tokens": 2249448.0, + "step": 50 + }, + { + "entropy": 0.2411576334387064, + "epoch": 1.896, + "grad_norm": 0.310546875, + "learning_rate": 6e-05, + "loss": 0.2257, + "mean_token_accuracy": 0.9256131462752819, + "num_tokens": 2701085.0, + "step": 60 + }, + { + "entropy": 0.21875436301972415, + "epoch": 2.192, + "grad_norm": 0.310546875, + "learning_rate": 6e-05, + "loss": 0.1978, + "mean_token_accuracy": 0.9344683112324895, + "num_tokens": 3115785.0, + "step": 70 + }, + { + "entropy": 0.1890676412731409, + "epoch": 2.512, + "grad_norm": 0.271484375, + "learning_rate": 6e-05, + "loss": 0.1723, + "mean_token_accuracy": 0.9410219177603721, + "num_tokens": 3578352.0, + "step": 80 + }, + { + "entropy": 0.17951820120215417, + "epoch": 2.832, + "grad_norm": 0.291015625, + "learning_rate": 6e-05, + "loss": 0.166, + "mean_token_accuracy": 0.9436265029013157, + "num_tokens": 4034155.0, + "step": 90 + }, + { + "entropy": 0.19678397405715214, + "epoch": 3.0, + "mean_token_accuracy": 0.9377535567397163, + "num_tokens": 4276695.0, + "step": 96, + "total_flos": 3.961197133037568e+16, + "train_loss": 0.2508960850536823, + "train_runtime": 226.1489, + "train_samples_per_second": 13.266, + "train_steps_per_second": 0.424 + } + ], + "logging_steps": 10, + "max_steps": 96, + "num_input_tokens_seen": 0, + "num_train_epochs": 3, + "save_steps": 500, + "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.961197133037568e+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..b17f8e7 --- /dev/null +++ b/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e94573a7ff1fac24dbcf711bb319e4c76911b176bf8be7a3332bd586a481c6ca +size 6417