IN THIS BREAKDOWN · 10 SECTIONS
You can read 21% of this breakdown.
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.
Research notes: the problem, approach and results
MATH accuracy for DeepSeekMath-RL 7B without tools or voting, against 52.9% reported for GPT-4 (Table 5)
tokens of math web pages mined from 40B deduplicated Common Crawl pages in four rounds (Section 2.1)
answers sampled per question to form each GRPO group, which replaces the value model (Section 4.2)
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.
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.
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.
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.
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
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
The corpus method, starting from code, GRPO's mechanics, the RL findings and two misreadings
Free account - 04How it works
The corpus pipeline, pretraining, instruction tuning, GRPO's objective and the RL setup
Premium - 05The numbers that matter
The corpus comparison, base model results, Table 5 after RL, and the Pass@K finding
Premium - 06Try it yourself
Recheck Table 5, GRPO advantages, PPO's memory, the KL estimator and a model of Figure 7
Premium - 07Where it breaks
Math-only scope, learned rewards, capability limits, comparisons with closed models and gaps
Premium - 08Using it on a deployment
When to use GRPO, building rewards, filtering prompts, and mining domain data
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
