{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/deepseekmath-pushing-the-limits-of","title":"DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models","arxiv_id":"2402.03300","date":"2024-02-05","proceeding":null,"authors":["Zhihong Shao","Peiyi Wang","Qihao Zhu","Runxin Xu","Junxiao Song","Xiao Bi","Haowei Zhang","Mingchuan Zhang","Y. K. Li","Y. Wu","Daya Guo"],"abstract":"Mathematical reasoning poses a significant challenge for language models due to its complex and structured nature. In this paper, we introduce DeepSeekMath 7B, which continues pre-training DeepSeek-Coder-Base-v1.5 7B with 120B math-related tokens sourced from Common Crawl, together with natural language and code data. DeepSeekMath 7B has achieved an impressive score of 51.7% on the competition-level MATH benchmark without relying on external toolkits and voting techniques, approaching the performance level of Gemini-Ultra and GPT-4. Self-consistency over 64 samples from DeepSeekMath 7B achieves 60.9% on MATH. The mathematical reasoning capability of DeepSeekMath is attributed to two key factors: First, we harness the significant potential of publicly available web data through a meticulously engineered data selection pipeline. Second, we introduce Group Relative Policy Optimization (GRPO), a variant of Proximal Policy Optimization (PPO), that enhances mathematical reasoning abilities while concurrently optimizing the memory usage of PPO.","url_abs":"https://arxiv.org/abs/2402.03300v3","url_pdf":"https://arxiv.org/pdf/2402.03300v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"deepseekmath-pushing-the-limits-of","repo_url":"https://github.com/deepseek-ai/deepseek-math","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"deepseekmath-pushing-the-limits-of","repo_url":"https://github.com/openpsi-project/realhf","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"deepseekmath-pushing-the-limits-of","repo_url":"https://github.com/shibing624/medicalgpt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"deepseekmath-pushing-the-limits-of","repo_url":"https://github.com/synthlabsai/big-math","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"deepseekmath-pushing-the-limits-of","repo_url":"https://github.com/yynil/rwkvinside","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"arithmetic-reasoning","task_name":"Arithmetic Reasoning"},{"task_slug":"math","task_name":"Math"},{"task_slug":"math-word-problem-solving","task_name":"Math Word Problem Solving"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"entropy-regularization","method_name":"Entropy Regularization"},{"method_slug":"gpt-4","method_name":"GPT-4"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"ppo","method_name":"PPO"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/arithmetic-reasoning-on-gsm8k","task":"Arithmetic Reasoning","dataset":"GSM8K","model":"DeepSeekMATH-RL-7B","rank_in_archive_order":29,"of":164,"metrics":{"Accuracy":"88.2","Parameters (Billion)":"7"},"uses_additional_data":true},{"leaderboard":"/sota/math-word-problem-solving-on-math","task":"Math Word Problem Solving","dataset":"MATH","model":"DeepSeekMATH-RL-7B (w/ code, greedy decoding)","rank_in_archive_order":28,"of":135,"metrics":{"Accuracy":"58.8","Parameters (Billions)":"7"},"uses_additional_data":true},{"leaderboard":"/sota/math-word-problem-solving-on-math","task":"Math Word Problem Solving","dataset":"MATH","model":"DeepSeekMATH-RL-7B (greedy decoding)","rank_in_archive_order":44,"of":135,"metrics":{"Accuracy":"51.7","Parameters (Billions)":"7"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.03300","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.03300"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/deepseek-ai/deepseek-math","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/openpsi-project/realhf","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yynil/rwkvinside","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shibing624/medicalgpt","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/synthlabsai/big-math","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":2,"ran_draft_wrong":2,"ran":4,"unverified":16},"by_repo_kind":{"official":{"samples":9,"ran":4,"repositories":1},"listed":{"samples":15,"ran":4,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"30d7eec482ebf6b1","entry":"repeat_kv","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rwkv_inside/modeling_arwkv.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rwkv_inside/modeling_arwkv.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":2,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"30d7eec482ebf6b1"}},{"code_sha256_prefix":"e2e940c65c7460d3","entry":"actor_loss_fn","repo":"openpsi-project/realhf","repo_kind":"listed","path":"realhf/impl/model/utils/ppo_functional.py","file_url":"https://github.com/openpsi-project/realhf/blob/HEAD/realhf/impl/model/utils/ppo_functional.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e2e940c65c7460d3"}},{"code_sha256_prefix":"bac65c3dafaec040","entry":"apply_rotary_pos_emb","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rwkv_inside/modeling_arwkv.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rwkv_inside/modeling_arwkv.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bac65c3dafaec040"}},{"code_sha256_prefix":"6390dea763ce122e","entry":"extract_boxed_answers","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/data_processing/answer_extraction.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/data_processing/answer_extraction.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6390dea763ce122e"}},{"code_sha256_prefix":"0772e5020f6b0849","entry":"extract_program_output","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/data_processing/answer_extraction.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/data_processing/answer_extraction.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0772e5020f6b0849"}},{"code_sha256_prefix":"b99eea6376d1e212","entry":"rotate_half","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rwkv_inside/modeling_arwkv.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rwkv_inside/modeling_arwkv.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b99eea6376d1e212"}},{"code_sha256_prefix":"1d4da55afb0377ec","entry":"shuffle","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/utils.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1d4da55afb0377ec"}},{"code_sha256_prefix":"5abed389274c4c03","entry":"strip_string","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/data_processing/answer_extraction.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/data_processing/answer_extraction.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5abed389274c4c03"}},{"code_sha256_prefix":"8b9e2baf73bb9a6f","entry":"aggregate_metrics","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/summarize_results.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/summarize_results.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8b9e2baf73bb9a6f"}},{"code_sha256_prefix":"33425041e7f88b7f","entry":"aggregate_predictions","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/summarize_results.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/summarize_results.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"33425041e7f88b7f"}},{"code_sha256_prefix":"8ddbdfd0041abedc","entry":"calculate_language_consistency_score","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/deepspeed_rl_train.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/deepspeed_rl_train.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8ddbdfd0041abedc"}},{"code_sha256_prefix":"93678d5fdf25571d","entry":"calculate_param_sizes","repo":"yynil/rwkvinside","repo_kind":"listed","path":"train_scripts/split_model_params.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/train_scripts/split_model_params.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"93678d5fdf25571d"}},{"code_sha256_prefix":"bc474830fb3ccd5d","entry":"calculate_tensor_size","repo":"yynil/rwkvinside","repo_kind":"listed","path":"train_scripts/split_model_params.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/train_scripts/split_model_params.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bc474830fb3ccd5d"}},{"code_sha256_prefix":"c59c51644b25a189","entry":"check_proof","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/unsafe_score_minif2f_isabelle.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/unsafe_score_minif2f_isabelle.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c59c51644b25a189"}},{"code_sha256_prefix":"620dc092b02e33f7","entry":"compare_latex_numbers","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/utilities.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/utilities.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"620dc092b02e33f7"}},{"code_sha256_prefix":"d0a5e652d9881e59","entry":"distribute_params","repo":"yynil/rwkvinside","repo_kind":"listed","path":"train_scripts/split_model_params.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/train_scripts/split_model_params.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d0a5e652d9881e59"}},{"code_sha256_prefix":"f9c058ca4549e9f6","entry":"grpo_loss_with_old_logps","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/grpo_trainer.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/grpo_trainer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f9c058ca4549e9f6"}},{"code_sha256_prefix":"de0231790ab22287","entry":"markup_question","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/run_subset_parallel.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/run_subset_parallel.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"de0231790ab22287"}},{"code_sha256_prefix":"eb7f513a0e05ec8b","entry":"parse_coordinate","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/utilities.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/utilities.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"eb7f513a0e05ec8b"}},{"code_sha256_prefix":"f7cc3a0c10540f2e","entry":"parse_latex_to_python","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/utilities.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/utilities.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f7cc3a0c10540f2e"}},{"code_sha256_prefix":"3deb39de933b985a","entry":"read_data","repo":"deepseek-ai/deepseek-math","repo_kind":"official","path":"evaluation/utils.py","file_url":"https://github.com/deepseek-ai/deepseek-math/blob/HEAD/evaluation/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3deb39de933b985a"}},{"code_sha256_prefix":"f872aa95062d3ac2","entry":"reward_function","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/train_rl_model.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/train_rl_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f872aa95062d3ac2"}},{"code_sha256_prefix":"7c05d945015e9e96","entry":"selective_log_softmax_old","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/grpo_trainer.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/grpo_trainer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7c05d945015e9e96"}},{"code_sha256_prefix":"b016e9b55d3c8dad","entry":"time_function","repo":"yynil/rwkvinside","repo_kind":"listed","path":"rl/profiler.py","file_url":"https://github.com/yynil/rwkvinside/blob/HEAD/rl/profiler.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b016e9b55d3c8dad"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}