{"slug": "deepseekmath-pushing-the-limits-of-mathematical-reasoning", "title": "DeepSeekMath: Pushing the Limits of Mathematical Reasoning", "summary": "DeepSeek released DeepSeekMath 7B, a math-specialized model initialized from DeepSeek-Coder-v1.5 7B and pre-trained on 500B tokens, which scored 51.7% on the competition-level MATH benchmark without external toolkits or voting techniques. The base model outperforms existing open-source base models by more than 10% in absolute terms on MATH through few-shot chain-of-thought prompting and surpasses Minerva 540B, while DeepSeekMath-RL 7B, trained with the company's Group Relative Policy Optimization (GRPO) algorithm, approaches 60% accuracy on MATH with tool use. DeepSeek released base, instruct and RL checkpoints publicly with commercial use permitted, and built its training corpus from 35.5M mathematical web pages totaling 120B tokens collected over four iterations of FastText-based retrieval from Common Crawl.", "body_md": "[Model Download](#4-model-downloads) |\n  [Evaluation Results](#2-evaluation-results) |\n  [Quick Start](#5-quick-start) |\n  [License](#6-license) |\n  [Citation](#7-citation)\n\nDeepSeekMath is initialized with [DeepSeek-Coder-v1.5 7B](https://huggingface.co/deepseek-ai/deepseek-coder-7b-base-v1.5) and continues pre-training on math-related tokens sourced from Common Crawl, together with natural language and code data for 500B tokens. 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. For research purposes, we release [checkpoints](#4-model-downloads) of base, instruct, and RL models to the public.\n\nWe conduct a comprehensive assessment of the mathematical capabilities of DeepSeekMath-Base 7B, focusing on its ability to produce self-contained mathematical solutions without relying on external tools, solve math problems using tools, and conduct formal theorem proving. Beyond mathematics, we also provide a more general profile of the base model, including its performance of natural language understanding, reasoning, and programming skills.\n\n- **Mathematical problem solving with step-by-step reasoning**\n\n- **Mathematical problem solving with tool use**\n\n- **Natural Language Understanding, Reasoning, and Code**\n\nThe evaluation results from the tables above can be summarized as follows:\n\n- **Superior Mathematical Reasoning:** On the competition-level MATH dataset, DeepSeekMath-Base 7B outperforms existing open-source base models by more than 10% in absolute terms through few-shot chain-of-thought prompting, and also surpasses Minerva 540B.\n- **Strong Tool Use Ability:** Continuing pre-training with DeepSeekCoder-Base-7B-v1.5 enables DeepSeekMath-Base 7B to more effectively solve and prove mathematical problems by writing programs.\n- **Comparable Reasoning and Coding Performance:** DeepSeekMath-Base 7B achieves performance in reasoning and coding that is comparable to that of DeepSeekCoder-Base-7B-v1.5.\n\nDeepSeekMath-Instruct 7B is a mathematically instructed tuning model derived from DeepSeekMath-Base 7B, while DeepSeekMath-RL 7B is trained on the foundation of DeepSeekMath-Instruct 7B, utilizing our proposed Group Relative Policy Optimization (GRPO) algorithm.\n\nWe evaluate mathematical performance both without and with tool use, on 4 quantitative reasoning benchmarks in English and Chinese. As shown in Table, DeepSeekMath-Instruct 7B demonstrates strong performance of step-by-step reasoning, and DeepSeekMath-RL 7B approaches an accuracy of 60% on MATH with tool use, surpassing all existing open-source models.\n\n- Step 1:  Select [OpenWebMath](https://arxiv.org/pdf/2310.06786.pdf) , a collection of high-quality mathematical web texts, as our initial seed corpus for training a FastText model.\n- Step 2: Use the FastText model to retrieve mathematical web pages from the deduplicated Common Crawl database.\n- Step 3: Identify potential math-related domains through statistical analysis.\n- Step 4: Manually annotate URLs within these identified domains that are associated with mathematical content.\n- Step 5: Add web pages linked to these annotated URLs, but not yet collected, to the seed corpus. Jump to step 1 until four iterations.\n\nAfter four iterations of data collection, we end up with **35.5M** mathematical web pages, totaling **120B** tokens.\n\nWe release the DeepSeekMath 7B, including base, instruct and RL models, to the public. To support a broader and more diverse range of research within both academic and commercial communities. Please **note** that the use of this model is subject to the terms outlined in [License section](#6-license). Commercial usage is permitted under these terms.\n\n| Model | Sequence Length | Download | \n|---|---|---|\n| DeepSeekMath-Base 7B | 4096 | 🤗 [HuggingFace](https://huggingface.co/deepseek-ai/deepseek-math-7b-base) | \n| DeepSeekMath-Instruct 7B | 4096 | 🤗 [HuggingFace](https://huggingface.co/deepseek-ai/deepseek-math-7b-instruct) | \n| DeepSeekMath-RL 7B | 4096 | 🤗 [HuggingFace](https://huggingface.co/deepseek-ai/deepseek-math-7b-rl) | \n\nYou can directly employ [Huggingface's Transformers](https://github.com/huggingface/transformers) for model inference.\n\n**Text Completion**\n\n``` python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig\n\nmodel_name = \"deepseek-ai/deepseek-math-7b-base\"\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map=\"auto\")\nmodel.generation_config = GenerationConfig.from_pretrained(model_name)\nmodel.generation_config.pad_token_id = model.generation_config.eos_token_id\n\ntext = \"The integral of x^2 from 0 to 2 is\"\ninputs = tokenizer(text, return_tensors=\"pt\")\noutputs = model.generate(**inputs.to(model.device), max_new_tokens=100)\n\nresult = tokenizer.decode(outputs[0], skip_special_tokens=True)\nprint(result)\n```\n\n**Chat Completion**\n\n``` python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig\n\nmodel_name = \"deepseek-ai/deepseek-math-7b-instruct\"\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map=\"auto\")\nmodel.generation_config = GenerationConfig.from_pretrained(model_name)\nmodel.generation_config.pad_token_id = model.generation_config.eos_token_id\n\nmessages = [\n    {\"role\": \"user\", \"content\": \"what is the integral of x^2 from 0 to 2?\\nPlease reason step by step, and put your final answer within \\boxed{}.\"}\n]\ninput_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors=\"pt\")\noutputs = model.generate(input_tensor.to(model.device), max_new_tokens=100)\n\nresult = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)\nprint(result)\n```\n\nAvoiding the use of the provided function `apply_chat_template`, you can also interact with our model following the sample template. Note that `messages` should be replaced by your input.\n\n```\nUser: {messages[0]['content']}\n\nAssistant: {messages[1]['content']}<｜end▁of▁sentence｜>User: {messages[2]['content']}\n\nAssistant:\n```\n\n**Note:** By default (`add_special_tokens=True`), our tokenizer automatically adds a `bos_token` (`<｜begin▁of▁sentence｜>`) before the input text. Additionally, since the system prompt is not compatible with this version of our models, we DO NOT RECOMMEND including the system prompt in your input.\n\n❗❗❗ **Please use chain-of-thought prompt to test DeepSeekMath-Instruct and DeepSeekMath-RL:**\n\n- \nEnglish questions: **{question}\\nPlease reason step by step, and put your final answer within \\boxed{}.**\n- \nChinese questions: **{question}\\n请通过逐步推理来解答问题，并把最终答案放置于\\boxed{}中。**\n\nThis code repository is licensed under the MIT License. The use of DeepSeekMath models is subject to the Model License. DeepSeekMath supports commercial use.\n\nSee the [LICENSE-CODE](https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-CODE) and [LICENSE-MODEL](https://github.com/deepseek-ai/DeepSeek-Math/blob/main/LICENSE-MODEL) for more details.\n\n```\n@misc{deepseek-math,\n  author = {Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Mingchuan Zhang, Y.K. Li, Y. Wu, Daya Guo},\n  title = {DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models},\n  journal = {CoRR},\n  volume = {abs/2402.03300},\n  year = {2024},\n  url = {https://arxiv.org/abs/2402.03300},\n}\n```\n\nIf you have any questions, please raise an issue or contact us at [service@deepseek.com](mailto:service@deepseek.com).", "url": "https://wpnews.pro/news/deepseekmath-pushing-the-limits-of-mathematical-reasoning", "canonical_source": "https://github.com/deepseek-ai/deepseek-math", "published_at": "2026-11-26 17:21:14+00:00", "updated_at": "2026-11-26 19:13:24.973576+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "large-language-models", "ai-research", "ai-startups"], "entities": ["DeepSeek", "DeepSeekMath 7B", "DeepSeekMath-Base 7B", "DeepSeekMath-Instruct 7B", "DeepSeekMath-RL 7B", "DeepSeek-Coder-v1.5 7B", "Group Relative Policy Optimization", "Common Crawl"], "also_reported_by": [], "takeaway": "DeepSeekMath 7B reaches 51.7% on MATH without tools and about 60% with tool use after GRPO reinforcement learning, with base, instruct and RL checkpoints released for commercial use.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/deepseekmath-pushing-the-limits-of-mathematical-reasoning", "markdown": "https://wpnews.pro/news/deepseekmath-pushing-the-limits-of-mathematical-reasoning.md", "text": "https://wpnews.pro/news/deepseekmath-pushing-the-limits-of-mathematical-reasoning.txt", "jsonld": "https://wpnews.pro/news/deepseekmath-pushing-the-limits-of-mathematical-reasoning.jsonld"}}