Back to paper library
arXiv 2025Nature 2025DeepSeekPaper notes

DeepSeek-R1

Insight in Reinforcement Learning

Original paper

DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning

Paper authors

DeepSeek-AI

Publication
Nature 2025Journal
First submitted to arXiv
arXiv:2501.12948
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{deepseekdeepseekr12025,
  title = {{DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning}},
  author = {DeepSeek-AI},
  year = {2025},
  eprint = {2501.12948},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.12948v1}
}
On this page

We went back and reviewed the first three generations of the DeepSeek architecture specifically to read this paper.

Each paper is as thick as a brick, and looking back now, it wasn’t easy at all.

Problem Definition

OpenAI's o1 series recently sparked a lot of discussions. The series showed how spending more inference-time compute on longer chains of thought can improve performance on complex reasoning tasks.

Other studies have attempted to enhance model reasoning abilities using "process reward models," "reinforcement learning," and "search algorithms (such as Monte Carlo Tree Search, Beam Search)," but none could achieve the same level of integrated theoretical reasoning performance as the o1 series models.

Does this mean it’s over?

Absolutely not! Researchers' stubbornness is not without reason.

In this paper, the DeepSeek research team attempts to use "pure reinforcement learning" to drive the reasoning ability of language models, without supervised fine-tuning as a reasoning cold start. DeepSeek-V3-Base itself was already pretrained. So, the authors use DeepSeek-V3-Base as the base model and, after thousands of RL steps, created the first version of the model, called DeepSeek-R1-Zero.

So, is the problem solved?

Not yet.

The story officially begins after DeepSeek-R1-Zero.

Solving the Problem

DeepSeek-R1-Zero

First, take DeepSeek-V3-Base as the base model, skip the supervised fine-tuning phase, and apply reinforcement learning algorithms directly.

To reduce the RL training cost, this paper adopts the GRPO method, which does not use a critic model the same size as the policy model, but instead estimates the baseline based on a set of scores.

In the GRPO algorithm, we want the model to "learn" how to produce better answers by itself. Its core process can be broken down into the following steps:

  • 1. Generate multiple answers from the old model

    • For each question qq: We use the old policy πθold\pi_{\theta_{\mathrm{old}}} to generate a set of answers

      {o1,o2,…,oG}\{o_1, o_2, \dots, o_G\}

      where GG is the number of answers.


  • 2. Evaluate the quality of the answers: Calculate the "advantage" AiA_i

    To measure the quality of the answers, each answer oio_i receives a reward rir_i.

    To compare which answer performs better, the authors define the advantage AiA_i as:

    Ai=ri−mean({r1,r2,…,rG})std({r1,r2,…,rG})A_i = \frac{r_i - \text{mean}(\{r_1, r_2, \dots, r_G\})}{\text{std}(\{r_1, r_2, \dots, r_G\})}

    This shows how a response’s reward compares with the group mean, normalized by the group standard deviation.

  • 3. Optimize the new model: Maximize the objective function

    We want the new model πθ\pi_\theta to learn to generate higher-scoring answers.

    To do this, the authors design an objective function:

    ρi=πθ(oi∣q)πθold(oi∣q),JGRPO(θ)=Eq,{oi}∼πθold[1G∑i=1G(min⁡(ρiAi,clip⁡(ρi,1−ϵ,1+ϵ)Ai)−βDKL(πθ∥πref))].\rho_i = \frac{\pi_\theta(o_i\mid q)}{\pi_{\theta_{\mathrm{old}}}(o_i\mid q)},\qquad J_{\mathrm{GRPO}}(\theta)=\mathbb{E}_{q,\{o_i\}\sim\pi_{\theta_{\mathrm{old}}}} \left[\frac{1}{G}\sum_{i=1}^{G} \left(\min\bigl(\rho_i A_i,\operatorname{clip}(\rho_i,1-\epsilon,1+\epsilon)A_i\bigr) -\beta D_{\mathrm{KL}}(\pi_\theta\|\pi_{\mathrm{ref}})\right)\right].

    Looking at this string of formulas, it might instinctively make you want to scroll away, but don’t worry, let’s go through it step by step:

    • Probability Ratio ρi=πθ(oi∣q)πθold(oi∣q)\rho_i=\frac{\pi_\theta(o_i\mid q)}{\pi_{\theta_{\mathrm{old}}}(o_i\mid q)} represents the change in probability of the new model generating answer oio_i compared to the old model.

    • Multiply by Advantage AiA_i If an answer performs better than average (AiA_i is high), the new model should increase the probability of generating that answer.

    • Clip Operation To limit the effect of large probability-ratio changes on the update objective, the ratio is clipped to [1−ϵ, 1+ϵ][1-\epsilon,\, 1+\epsilon] in one term before taking the minimum with the unclipped term. Here ϵ\epsilon is a hyperparameter, essentially setting a "seatbelt" on the update objective.

    • KL Divergence Penalty βDKL(πθ∥πref)\beta D_{KL}(\pi_\theta\|\pi_{ref}) is a penalty term used to measure the difference between the new model and the reference model πref\pi_{ref}, preventing the model from deviating too far from the original stable policy.

      For a sampled answer, the paper uses this KL penalty estimator; it is not an exhaustive KL calculation over every possible response:

      DKL(πθ∥πref)=πref(oi∣q)πθ(oi∣q)−log⁡πref(oi∣q)πθ(oi∣q)−1D_{KL}\big(\pi_\theta\|\pi_{ref}\big) = \frac{\pi_{ref}(o_i\mid q)}{\pi_\theta(o_i\mid q)} - \log\frac{\pi_{ref}(o_i\mid q)}{\pi_\theta(o_i\mid q)} - 1

Not so bad, right? Actually, it’s not that hard.

The model adjusts its parameters by maximizing JGRPO(θ)J_{GRPO}(\theta). This means the new model tends to generate answers that receive higher rewards (higher AiA_i), while maintaining the stability of changes.

The reward serves as the training signal in reinforcement learning, determining the optimization direction.

For DeepSeek-R1-Zero at this stage, the research team uses a rule-based reward system, which mainly includes two types of rewards:

  • Accuracy Reward: This evaluates whether the answer is correct. For example, in a math problem, the model is required to provide the final answer in a specific format (e.g., boxed answer), allowing for rule-based verification; for LeetCode problems, the compiler and predefined test cases can be used for validation.
  • Format Reward: This requires the model to place its reasoning process between <think> and </think> tags to ensure the output adheres to the expected format.

During the training of DeepSeek-R1-Zero, the authors designed a simple and clear template, guiding the base model to first generate the reasoning process and then provide the final answer, as shown in the table below:

Paper Table 1: the DeepSeek-R1-Zero training prompt specifies output structure, not a reasoning strategy.

This design only restricts the output structure, avoiding content-based biases (such as forcing reflective reasoning or specific problem-solving strategies), allowing observation of the model’s natural evolution during the RL process.

The following graph shows the training process, where DeepSeek-R1-Zero's average pass@1 score on AIME 2024 improved from 15.6% to 71.0%, approaching OpenAI-o1-0912's 74.4%. With majority voting, Table 2 reports 86.7% at cons@64, above o1-0912's 83.3% under that metric; Figure 2’s red curve uses cons@16. These are different sampling settings.

Paper Figure 2: R1-Zero AIME 2024 accuracy during training; blue is pass@1 and red is majority voting over 16 samples.

As training progressed, the model’s thinking time increased, as shown below.

Figure 3 measures mean response length on the training set as RL progresses. The paper separately describes inference-time reasoning tokens and output patterns such as revisiting steps or exploring alternatives. Length alone does not show how often the model reflects or whether each reasoning step is correct.

Paper Figure 3: mean R1-Zero response length on the training set, not test-set accuracy.

During training, the authors observed an "Aha moment" in an intermediate version: one output revisits its initial problem-solving strategy. This example drew their attention to how RL training could produce such wording without an explicit instruction to reflect.

The authors present an example of an "Aha moment" in the paper:

Paper Table 3: self-reassessment language from an intermediate R1-Zero model on a math problem.

From this, we can learn several key points:

  1. Problem and Initial Derivation:

    The table presents a math problem, such as "If a>1a > 1, what is the sum of real solutions to the equation a−a+x=x\sqrt{a - \sqrt{a + x}} = x?"

    The model begins by deriving the solution, using squaring to eliminate square roots and attempting to transform the equation into polynomial form.

  2. Midway Doubts and Reflection:

    During the derivation, the model suddenly pauses and says:

    • "Wait, wait. Wait. That’s an aha moment I can flag here."

    The output pauses and returns to the original equation to check the derivation. The authors call this an “aha moment”; the excerpt does not show that the model actually found an error.

  3. Significance of the Aha Moment:

    • Self-checking output: The model repeats the original problem and revisits its derivation instead of continuing the previous text.
    • Scope of observation: This is one intermediate-model example.
    • Human-like wording: The tone makes the output feel reflective, though it is evidence of generated wording rather than human-like thought.

The example illustrates a self-checking pattern in generated reasoning. Evidence for improved capability comes from the earlier AIME results, rather than this single striking sample.

DeepSeek-R1

To overcome the readability and language mixing issues present in DeepSeek-R1-Zero, the research team further introduced the DeepSeek-R1 model, assisted by humanized cold-start data.

The core of this phase lies in a carefully designed multi-stage training pipeline, which allows the model to not only maintain strong performance in reasoning tasks but also generate answers that are structurally clear and easy to understand.

The training process of DeepSeek-R1 is divided into four stages, as we will look at sequentially:

  • Cold Start

    Unlike DeepSeek-R1-Zero, directly jumping into RL from the base model might encounter initial instability issues.

    To address this, the research team first collects a small amount of high-quality chain-of-thought (CoT) data to fine-tune DeepSeek-V3-Base, making it a stable initial value for RL training.

Data collection methods include:

  • Few-shot prompts: Using long CoT examples to demonstrate problem-solving, allowing the model to mimic generating detailed reasoning processes.
  • Direct prompt generation: Designing reflection and verification prompts to encourage the model to generate more structured responses.
  • Selecting quality outputs: Choosing the more coherent and readable answers from DeepSeek-R1-Zero.
  • Manual post-processing: Refining through manual work to remove poor or chaotic outputs.

To ensure readability, the authors define a fixed output format:

Code
|special_token|<reasoning_process>|special_token|<summary>

Here, <reasoning_process> represents the detailed reasoning process, and <summary> summarizes the entire reasoning process. This format retains the full reasoning content while also allowing users to quickly grasp the key points.


  • Reasoning-Oriented RL

    With the help of cold-start data, the model begins RL training in a stable state. The main goal of this phase is to further enhance the model's ability in reasoning tasks such as mathematics, programming, science, and logic. Specific steps include:

    • Start large-scale RL training: Using the fine-tuned DeepSeek-V3-Base as the foundation, RL methods like the GRPO algorithm (similar to DeepSeek-R1-Zero) are employed for continuous training.

    • Address language mixing issues: It was found that when RL prompts involve multiple languages, the model tends to exhibit language mixing. To resolve this, the authors introduced a "language consistency reward," calculated based on the proportion of target language vocabulary in the CoT.

  • Final reward design: The reasoning accuracy reward and language consistency reward are directly added together to form the final training signal for model updates. The authors use this to improve readability while retaining reasoning performance; they note a slight accuracy trade-off.

  • Rejection Sampling and Supervised Fine-Tuning

    After the reasoning-oriented RL training converges, the research team further uses the model to generate more high-quality supervised data for a second round of fine-tuning to improve performance on general tasks.

    Data generation is divided into two categories:

    • Reasoning data:

      • For some prompts beyond rule-verifiable tasks, DeepSeek-V3 judges model outputs against ground truth as a generative reward model.
      • Using rejection sampling, correct and representative reasoning processes are selected from the answers generated in the RL training.
      • To ensure quality, the authors filter out outputs with language mixing, excessively long paragraphs, or code blocks.
      • In the end, approximately 600,000 reasoning-related samples are collected.
    • Non-reasoning data:

      • This includes tasks like writing, fact-based Q&A, self-awareness, and translation, with data from DeepSeek-V3’s supervised dataset.
      • For certain tasks, the authors let the model first generate potential CoT before producing the final answer. For simple queries, no CoT is generated.
      • This part includes approximately 200,000 samples.

    After merging these two data categories, a total of about 800,000 samples were used for two epochs of supervised fine-tuning on DeepSeek-V3-Base, improving the model’s performance in both reasoning and general tasks.


  • Full-Scenario Reinforcement Learning

    To make the model more aligned with user needs, the research team conducted a second phase of RL training, optimizing the model for all scenarios (not just reasoning tasks), enhancing its usefulness and safety.

    Reasoning data still uses rule-based accuracy rewards. General data uses reward models for human preferences: helpfulness is judged from the final summary only, reducing interference with reasoning, while harmlessness is judged on the full response, including reasoning and summary.

    This aims to preserve reasoning ability while improving helpfulness and safety.

    The authors evaluate the model across different tasks after this stage.

Discussion

Evaluation Results

Paper Figure 1: DeepSeek-R1 and comparators on six benchmarks with different metrics.
Paper Table 4: full DeepSeek-R1 benchmark comparison, including metrics and model versions.

The tables above show the evaluation results of DeepSeek-R1 in various benchmark tests, with the results categorized by domain as follows:

  • English Knowledge and Reasoning Tasks

    • MMLU, MMLU-Redux, and MMLU-Pro These three metrics are primarily used to evaluate the model’s knowledge level in academic and general knowledge Q&A:

      • MMLU (Pass@1): R1 scores 90.8, above V3’s 88.5 but below o1-1217’s 91.8. Here pass@1 is estimated by averaging correctness over sampled responses.
      • MMLU-Redux (EM): DeepSeek-R1 scores 92.9, above other models with a reported score in the table; o1-1217 has no entry for this row.
      • MMLU-Pro (EM): On this more challenging multi-subject test, DeepSeek-R1 scores 84.0 versus V3's 75.9. The authors associate the knowledge gains with STEM-oriented RL, though this table does not isolate its contribution from other R1 training stages.
    • DROP (3-shot F1) and IF-Eval (Prompt Strict)

      • DROP: Tests the model’s abilities in reading comprehension and numerical reasoning, with DeepSeek-R1 achieving an F1 score of 92.2.
      • IF-Eval: This measures instruction and format adherence. R1’s 83.3 is below V3’s 86.1 and GPT-4o's 84.3, so this row does not support an across-the-board improvement claim.
    • GPQA Diamond and SimpleQA

      • GPQA Diamond (Pass@1): On expert-level knowledge questions, DeepSeek-R1 scores 71.5, above V3's 59.1 but below o1-1217's 75.7.
      • SimpleQA (Correct): On English factual Q&A, DeepSeek-R1 scores 30.1, above V3's 24.9 but below GPT-4o's 38.2 and o1-1217's 47.0. Chinese C-SimpleQA is a separate test.
    • FRAMES, AlpacaEval2.0, and ArenaHard These metrics assess the model’s capabilities in long-text understanding, open-domain Q&A, and writing tasks:

      • FRAMES (Acc.): On this long-context Q&A test, DeepSeek-R1 scores 82.5, above V3's 73.3 and GPT-4o's 80.5.
      • AlpacaEval2.0 (LC-winrate) and ArenaHard (GPT-4-1106): These use model judges to compare open-ended answers; the former reports a length-controlled win rate. R1 scores 87.6% and 92.3%, above V3's 70.0% and 85.5% under those settings.

  • Code Generation Tasks

    • LiveCodeBench (Pass@1-COT) and Codeforces These tests evaluate the model’s performance in code generation and algorithmic reasoning:

      • LiveCodeBench: DeepSeek-R1 scored 65.9, reflecting excellent performance when generating code using chain-of-thought (CoT).
      • Codeforces (Percentile and Rating): R1 reaches the 96.3 percentile and an estimated rating of 2029, close to but below o1-1217’s 96.6 and 2061. The paper evaluates problems from ten Div.2 contests with expert test cases.
    • Other Engineering-related Metrics

      • SWE Verified (Resolved): On this engineering task, R1 scores 49.2, near o1-1217's 48.9 but below Claude 3.5 Sonnet's 50.8.
      • Aider-Polyglot (Acc.): R1 scores 53.3, above V3’s 49.6 but below o1-1217’s 61.7; engineering tasks remain a gap.

  • Mathematics Tasks

    • AIME 2024, MATH-500, and CNMO 2024 These benchmarks focus on mathematical reasoning and problem-solving:
      • AIME 2024 (Pass@1): DeepSeek-R1 scored 79.8, comparable to OpenAI-o1-1217, indicating strong reasoning abilities in math competition problems.
      • MATH-500 (Pass@1): DeepSeek-R1 scores 97.3, close to o1-1217's 96.4 and above V3's 90.2.
      • CNMO 2024 (Pass@1): DeepSeek-R1 scores 78.8, above V3's 43.2; the table gives no o1-1217 result on this row.

  • Chinese Tasks

    • CLUEWSC, C-Eval, and C-SimpleQA In Chinese tasks, DeepSeek-R1 also demonstrates impressive capabilities:
      • CLUEWSC (EM): DeepSeek-R1 scored 92.8, showing strong understanding and reasoning abilities in the Chinese context.
      • C-Eval (EM): Scored 91.8, further validating its competitive strength in Chinese language evaluations.
      • C-SimpleQA (Correct): R1 scores 63.7, below V3's 68.0. The authors attribute some refusals to safety RL and state that removing that stage would put accuracy above 70%; the table does not report this ablation.

DeepSeek-R1 scores above V3 on education-oriented tests such as MMLU, MMLU-Pro, and GPQA Diamond. The authors relate STEM improvements to large-scale RL, but R1 also used cold-start data and later SFT; this table cannot measure the separate contribution of RL.

FRAMES tests long-context Q&A, while AlpacaEval2.0 and ArenaHard use model judges for open-ended answers. R1 scores above V3 under each test's settings. The authors suggest later instruction-following data helps, but these rows cannot separate the effects of each training stage.

R1 is close to OpenAI-o1-1217 on AIME 2024 and MATH-500 and slightly higher on LiveCodeBench; its Codeforces 96.3 percentile and 2029 rating are slightly lower. Engineering-related coding tasks such as Aider still leave room for improvement, and the authors propose adding relevant RL data.

The model-generated final summaries average 689 tokens on ArenaHard and 2,218 characters on AlpacaEval2.0. The paper sends only these final summaries to the judge to reduce bias from lengthy reasoning.

Overall, after large-scale reinforcement learning and multi-stage training, DeepSeek-R1 scores above V3 on many knowledge, math, code, and Chinese tests. R1-Zero's training curve directly shows gains from RL on the base model; R1's cross-task results reflect the complete pipeline and cannot be attributed to RL alone.

Comparison of Distillation and Reinforcement Learning

The paper also fine-tunes smaller Qwen and Llama models on roughly 800,000 curated examples. The distilled models listed here receive supervised fine-tuning only, without a subsequent RL stage; this is separate from the full four-stage R1 pipeline.

Paper Table 6: direct RL versus distillation from DeepSeek-R1 on Qwen-32B.

Here, we have a topic comparing two scenarios:

  1. Distilling the reasoning patterns of a large model into a smaller model.
  2. Performing large-scale RL directly on the smaller model.

The experimental results on the Qwen-32B-Base model show that after more than 10K steps of RL training, it becomes DeepSeek-R1-Zero-Qwen-32B. Another version, DeepSeek-R1-Distill-Qwen-32B, is derived by distilling from DeepSeek-R1.

In Table 6, distillation beats direct RL on all five listed metrics in this Qwen-32B setting, including AIME pass@1 (72.6 versus 47.0) and LiveCodeBench (57.2 versus 40.2).

The authors draw two conclusions from this:

  1. Distillation works well here: In this Qwen-32B comparison, SFT on a stronger model’s reasoning examples raises all five scores. The authors suggest it is less resource-intensive, but Table 6 gives no matched compute or cost figures for the two paths.
  2. Limits of this direct RL run: The Qwen-32B model trained for more than 10K RL steps trails the distilled one. The authors propose stronger base models and large-scale RL as a direction for further work.

Failed Attempts

In the early stages of developing DeepSeek-R1, the research team also tried other methods that ultimately did not meet expectations.

This section covers two methods:

  • Process Reward Model (PRM): In theory, PRM could guide the model to adopt better strategies in solving reasoning problems, but faced three major challenges in practice:

    • Difficulty in fine-grained step definition: It is challenging to define each small step clearly in general reasoning tasks.
    • Correctness judgment of intermediate steps: Automated labeling is often insufficient, and manual labeling is hard to scale.
    • Reward hacking issue: Introducing a model-based PRM could lead to reward hacking, and retraining the reward model would require extra resources and increase the complexity of the entire training process.

    Although PRM showed some utility in reordering the top N outputs or assisting with search guidance, its computational overhead and application difficulties limited its advantages.

  • Monte Carlo Tree Search (MCTS)

    Inspired by AlphaGo and AlphaZero, the research team attempted to use MCTS to improve the computational scale and exploration capabilities during testing. The method was to break the answer into smaller parts, prompting the model to generate corresponding labels for each reasoning step, and then guide it using a pre-trained value model. However, this method faced two challenges:

    • Huge search space: Compared to games like chess, the search space for token generation grows exponentially, making the model prone to local optima even with node extension limits.
    • Difficulty in training value models: The quality of the value model plays a decisive role in each search step, and training a fine-grained value model is very difficult, which impacts the iterative improvement of the entire search process.

    The authors tried MCTS to improve reasoning-time search, but this experiment did not deliver the hoped-for results. Continually improving a model through self-search remains a significant challenge.

Conclusion

DeepSeek-R1 combines cold-start data with iterative reinforcement learning fine-tuning, ultimately achieving performance on par with OpenAI-o1-1217 across multiple tasks, fully demonstrating the potential of large-scale reinforcement learning in enhancing reasoning abilities.

However, there are still known drawbacks in DeepSeek-R1 during testing, and the authors clearly state in the final section of the paper:

  • General Capabilities: R1 still lags behind V3 on some tasks (e.g., function calls, multi-turn dialogues, complex role-playing, and JSON output).
  • Language Mixing Issues: R1 is primarily optimized for English and Chinese, and may exhibit language mixing when encountering queries in other languages.
  • Prompt Sensitivity: R1 is sensitive to prompts, particularly under few-shot settings. The authors recommend describing the problem directly and specifying the output format for best results in zero-shot settings.
  • Software Engineering Tasks: Due to the longer evaluation times for these tasks, RL training efficiency is affected, and R1 has not yet demonstrated significant advantages in this area.

Overall, while there remains a gap between open-source and closed-source models, DeepSeek-R1 has made substantial progress in closing this gap, opening up more possibilities for the future development of open-source models.

Perhaps the next breakthrough will not belong to a single lab or company, but rather to the collective efforts of the open-source community.