GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
arXiv preprint

DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models

The paper that introduced GRPO: drop PPO's value model and score each answer against 63 others for the same question. With 120B math tokens mined from the web, a 7B model reached 51.7% on MATH.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2024
AUTHORS
Shao, Wang, Zhu, Xu et al.
FROM
DeepSeek-AI, Tsinghua University, Peking University
PUBLISHED
Feb 2024 · arXiv preprint
CITED BY
10,915Semantic Scholar · Nov 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 21% of this breakdown.

01

The paper in one minute

DeepSeekMath is remembered for GRPO, the reinforcement-learning method later used to train DeepSeek-R1, but the paper is a full recipe for a math-specialist model with three stages.

First, data. The team trained a fastText classifier on OpenWebMath pages as positives and random web pages as negatives, ran it over 40B deduplicated Common Crawl pages, and kept the highest-scoring ones. They then found domains where many pages had been selected, had people mark the math sections of those sites, added those pages to the positive set and retrained. After four rounds, the DeepSeekMath Corpus held 35.5M pages and 120B tokens. In a controlled test with a 1.3B model, it beat existing open math corpora on every benchmark. DeepSeek-Coder-Base-v1.5 7B was then trained on 500B tokens, 56% from this corpus. The result, DeepSeekMath-Base 7B, scored 64.2% on GSM8K and 36.2% on MATH, above the 540B Minerva.

Second, instruction tuning on 776K math problems with chain-of-thought, program-of-thought and tool-using solutions, which brought MATH to 46.8%. Third, GRPO. PPO, the usual RL algorithm for language models, trains a value model as large as the policy to judge how good each partial answer is. GRPO drops it: for each question it samples 64 answers, scores them with a reward model, and treats each answer's reward relative to the group's average and spread as its advantage. Trained on 144K GSM8K and MATH questions only, the model reached 88.2% on GSM8K and 51.7% on MATH, and it improved on Chinese math benchmarks it never saw during RL. The authors' analysis found that RL made correct answers more likely to be sampled but did not let the model solve problems it could not solve before.

THE IDEA, VISUALLY
PPO VS GRPO (SECTION 4.1, FIGURE 4) PPO question policy 1 answer value model advantage per token (GAE) critic as large as the policy GRPO question policy o1 o2 o3 o64 (r - mean) / std 64 answers, one reward each No value model: the group is the baseline. KL to a reference model is added to the loss (r - log r - 1 estimator), not to the reward. Settings: 144K GSM8K/MATH questions, 64 samples each, KL weight 0.04, policy learning rate 1e-6. When all 64 answers agree, std = 0: no signal. RL raised Maj@K but not Pass@K (Figure 7). CORPUS TEST, 1.3B MODEL, GSM8K (TABLE 1) MathPile (8.9B tokens) 2.7% OpenWebMath (13.6B) 11.5% Proof-Pile-2 (51.9B) 14.3% DeepSeekMath Corpus (120B) 23.8% fastText classifier over 40B Common Crawl pages, 4 rounds MATH ACCURACY, 7B (TABLES 2, 5) DeepSeekMath-Base 36.2% + instruction tuning (776K) 46.8% + GRPO 51.7% GPT-4 (reported) 52.9% DeepSeekMath 7B, maj@64 60.9% GRPO also lifted untrained benchmarks: CMATH 84.6 -> 88.8, MGSM-zh 73.2 -> 79.6; chain-of-thought format only arXiv 2402.03300, DeepSeek-AI, Tsinghua, Peking University
PPO estimates each token's advantage with a value model as large as the policy. GRPO drops it: for each question it samples 64 answers, scores them, and uses each answer's reward relative to the group's mean and spread as its advantage, with the KL penalty moved into the loss. On the data side, a classifier mined 120B math tokens from Common Crawl that beat other open math corpora. A 7B model went from 36.2% on MATH after pretraining to 46.8% after instruction tuning and 51.7% after GRPO.
Research notes: the problem, approach and results
51.7%

MATH accuracy for DeepSeekMath-RL 7B without tools or voting, against 52.9% reported for GPT-4 (Table 5)

120B

tokens of math web pages mined from 40B deduplicated Common Crawl pages in four rounds (Section 2.1)

64

answers sampled per question to form each GRPO group, which replaces the value model (Section 4.2)

THE PROBLEM

Open models trailed GPT-4 and Gemini-Ultra on competition math by a wide margin. Math pretraining data on the open web was thought to be scarce, and reinforcement learning with PPO needed a second, policy-sized value model, roughly doubling training memory.

THE IDEA

Mine Common Crawl for math pages with an iteratively retrained fastText classifier, continue pretraining a code model on the result, instruction-tune, then apply Group Relative Policy Optimization: sample a group of answers per question and use their normalized rewards as advantages instead of a learned value function.

THE RESULT

DeepSeekMath-Base 7B scored 64.2% on GSM8K and 36.2% on MATH, above Minerva 540B. After instruction tuning and GRPO on only GSM8K and MATH questions, the 7B model reached 88.2% and 51.7% and also improved on benchmarks it was not trained on. RL raised majority-vote accuracy but not Pass@K.

02

Why it matters to an FDE

GRPO is now the default starting point for reinforcement learning on language models with checkable answers, so customers asking about fine-tuning with rewards are usually asking about this paper's method.

GRPO halves the models you have to train. Dropping the value model removes a policy-sized network and its optimizer state. By a standard accounting, training memory for a 7B model falls from about 252GB to 140GB before activations. That puts RL fine-tuning within reach of teams with a few GPUs and a reward they can compute.

RL sharpens, it does not teach. The model's majority-vote accuracy rose while its Pass@K (whether any of K samples is right) did not. RL made the model more reliably produce answers it could already reach. If a customer's base model never solves a class of problems, RL on outcome rewards is unlikely to fix it; better data or a stronger base model will.

Domain data can be mined, iteratively. The corpus pipeline (seed classifier, score the web, find the domains that light up, have people label the right URL paths, retrain) works for any domain with a seed set: legal filings, clinical guidelines, internal wikis. The 1.3B comparison shows quality and quantity together beat smaller curated sets.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 290 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The corpus method, starting from code, GRPO's mechanics, the RL findings and two misreadings

    Free account
  2. 04How it works

    The corpus pipeline, pretraining, instruction tuning, GRPO's objective and the RL setup

    Premium
  3. 05The numbers that matter

    The corpus comparison, base model results, Table 5 after RL, and the Pass@K finding

    Premium
  4. 06Try it yourself

    Recheck Table 5, GRPO advantages, PPO's memory, the KL estimator and a model of Figure 7

    Premium
  5. 07Where it breaks

    Math-only scope, learned rewards, capability limits, comparisons with closed models and gaps

    Premium
  6. 08Using it on a deployment

    When to use GRPO, building rewards, filtering prompts, and mining domain data

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →