DeepSeek-R1 is an open-source language design built on DeepSeek-V3-Base that's been making waves in the AI neighborhood. Not only does it match-or even surpass-OpenAI's o1 design in numerous criteria, but it also features completely MIT-licensed weights. This marks it as the very first non-OpenAI/Google design to deliver strong reasoning abilities in an open and available manner.
What makes DeepSeek-R1 especially exciting is its transparency. Unlike the less-open approaches from some market leaders, DeepSeek has actually published a detailed training methodology in their paper.
The model is also extremely cost-effective, with input tokens costing simply $0.14-0.55 per million (vs o1's $15) and output tokens at $2.19 per million (vs o1's $60).
Until ~ GPT-4, the typical knowledge was that much better designs required more data and calculate. While that's still legitimate, models like o1 and R1 demonstrate an option: inference-time scaling through thinking.
The Essentials
The DeepSeek-R1 paper presented multiple designs, however main among them were R1 and R1-Zero. Following these are a series of distilled models that, while interesting, I won't go over here.
DeepSeek-R1 utilizes 2 major concepts:
1. A multi-stage pipeline where a little set of cold-start data kickstarts the design, followed by massive RL.
2. Group Relative Policy Optimization (GRPO), a reinforcement knowing technique that relies on comparing multiple model outputs per timely to avoid the requirement for a different critic.
R1 and R1-Zero are both thinking models. This basically means they do Chain-of-Thought before answering. For garagesale.es the R1 series of designs, this takes type as believing within a tag, before answering with a final summary.
R1-Zero vs R1
R1-Zero uses Reinforcement Learning (RL) straight to DeepSeek-V3-Base without any monitored fine-tuning (SFT). RL is used to enhance the design's policy to make the most of reward.
R1-Zero attains exceptional accuracy however in some cases produces complicated outputs, such as blending numerous languages in a single action. R1 repairs that by including restricted supervised fine-tuning and multiple RL passes, which improves both correctness and readability.
It is interesting how some languages may express certain ideas much better, which leads the model to select the most expressive language for the task.
Training Pipeline
The training pipeline that DeepSeek published in the R1 paper is exceptionally interesting. It showcases how they developed such strong reasoning designs, and what you can anticipate from each stage. This includes the issues that the resulting models from each stage have, and how they resolved it in the next phase.
It's fascinating that their training pipeline varies from the usual:
The typical training technique: Pretraining on large dataset (train to forecast next word) to get the base design → monitored fine-tuning → choice tuning by means of RLHF
R1-Zero: Pretrained → RL
R1: Pretrained → Multistage training pipeline with multiple SFT and RL stages
Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a few thousand Chain-of-Thought (CoT) samples to make sure the RL process has a decent beginning point. This gives a great model to start RL.
First RL Stage: Apply GRPO with rule-based benefits to enhance thinking accuracy and formatting (such as forcing chain-of-thought into thinking tags). When they were near convergence in the RL procedure, they moved to the next step. The outcome of this action is a strong reasoning model however with weak basic abilities, e.g., bad formatting and language mixing.
Rejection Sampling + general data: Create brand-new SFT data through rejection sampling on the RL checkpoint (from action 2), integrated with supervised data from the DeepSeek-V3-Base design. They collected around 600k top quality thinking samples.
Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k total samples (600k thinking + 200k basic jobs) for more comprehensive capabilities. This step led to a strong thinking model with general capabilities.
Second RL Stage: Add more reward signals (helpfulness, harmlessness) to fine-tune the final model, in addition to the reasoning rewards. The result is DeepSeek-R1.
They also did design distillation for numerous Qwen and Llama models on the reasoning traces to get distilled-R1 models.
Model distillation is a technique where you use a teacher design to improve a trainee design by generating training information for the trainee design.
The instructor is generally a bigger model than the trainee.
Group Relative Policy Optimization (GRPO)

The fundamental idea behind utilizing reinforcement knowing for LLMs is to fine-tune the model's policy so that it naturally produces more precise and beneficial responses.
They used a reward system that checks not only for correctness but also for correct formatting and language consistency, so the model slowly finds out to prefer responses that meet these quality requirements.
In this paper, they encourage the R1 model to create chain-of-thought thinking through RL training with GRPO.
Instead of including a separate module at reasoning time, the training procedure itself nudges the model to produce detailed, detailed outputs-making the chain-of-thought an emerging behavior of the enhanced policy.

What makes their method particularly fascinating is its dependence on straightforward, rule-based benefit functions.
Instead of depending upon expensive external models or human-graded examples as in traditional RLHF, the RL utilized for R1 utilizes basic requirements: it may offer a greater reward if the answer is appropriate, if it follows the anticipated/ format, and if the language of the response matches that of the timely.
Not depending on a benefit design also implies you don't need to hang out and effort training it, and it does not take memory and calculate far from your main model.
GRPO was presented in the DeepSeekMath paper. Here's how GRPO works:
1. For each input timely, the model creates various actions.
2. Each action receives a scalar benefit based upon aspects like precision, formatting, and language consistency.
3. Rewards are adjusted relative to the group's efficiency, basically determining just how much better each reaction is compared to the others.
4. The model updates its method a little to prefer actions with higher relative benefits. It just makes small adjustments-using techniques like clipping and a KL penalty-to guarantee the policy does not wander off too far from its original habits.
A cool aspect of GRPO is its versatility. You can use basic rule-based benefit functions-for instance, granting a bonus when the model correctly utilizes the syntax-to guide the training.
While DeepSeek used GRPO, you could use alternative methods instead (PPO or PRIME).
For those aiming to dive much deeper, Will Brown has written quite a great implementation of training an LLM with RL using GRPO. GRPO has actually also currently been included to the Transformer Reinforcement Learning (TRL) library, which is another good resource.
Finally, Yannic Kilcher has a great video explaining GRPO by going through the DeepSeekMath paper.
Is RL on LLMs the course to AGI?
As a final note on explaining DeepSeek-R1 and the approaches they've provided in their paper, I wish to highlight a passage from the DeepSeekMath paper, based on a point Yannic Kilcher made in his video.
These findings show that RL boosts the design's overall performance by rendering the output distribution more robust, simply put, links.gtanet.com.br it appears that the enhancement is attributed to boosting the appropriate reaction from TopK instead of the improvement of essential abilities.
To put it simply, RL fine-tuning tends to shape the output circulation so that the highest-probability outputs are most likely to be proper, although the general ability (as measured by the variety of appropriate responses) is mainly present in the pretrained design.

This recommends that support knowing on LLMs is more about refining and "shaping" the existing circulation of reactions rather than endowing the model with totally new abilities.
Consequently, while RL strategies such as PPO and GRPO can produce substantial efficiency gains, there appears to be an inherent ceiling determined by the underlying model's pretrained understanding.
It is uncertain to me how far RL will take us. Perhaps it will be the stepping stone to the next big turning point. I'm delighted to see how it unfolds!

Running DeepSeek-R1
I've used DeepSeek-R1 by means of the main chat interface for different issues, which it seems to fix all right. The additional search performance makes it even better to use.
Interestingly, o3-mini(-high) was launched as I was composing this post. From my preliminary testing, R1 appears more powerful at math than o3-mini.
I also rented a single H100 via Lambda Labs for $2/h (26 CPU cores, 214.7 GB RAM, 1.1 TB SSD) to run some experiments.
The main goal was to see how the design would perform when deployed on a single H100 GPU-not to thoroughly evaluate the model's abilities.
671B through Llama.cpp
DeepSeek-R1 1.58-bit (UD-IQ1_S) quantized design by Unsloth, bphomesteading.com with a 4-bit quantized KV-cache and partial GPU offloading (29 layers working on the GPU), running via llama.cpp:
29 layers seemed to be the sweet area given this setup.
Performance:
A r/localllama user explained that they were able to get over 2 tok/sec with DeepSeek R1 671B, without using their GPU on their regional gaming setup.
Digital Spaceport wrote a full guide on how to run Deepseek R1 671b totally locally on a $2000 EPYC server, on which you can get ~ 4.25 to 3.5 tokens per second.
As you can see, the tokens/s isn't rather manageable for any serious work, however it's enjoyable to run these large models on available hardware.
What matters most to me is a combination of effectiveness and time-to-usefulness in these models. Since reasoning models require to believe before addressing, their time-to-usefulness is generally greater than other models, however their usefulness is likewise normally higher.
We require to both maximize effectiveness and minimize time-to-usefulness.
70B through Ollama
70.6 b params, 4-bit KM quantized DeepSeek-R1 running via Ollama:
GPU usage shoots up here, as anticipated when compared to the mainly CPU-powered run of 671B that I showcased above.

Resources
DeepSeek-R1: Incentivizing Reasoning Capability in LLMs by means of Reinforcement Learning
[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
DeepSeek R1 - Notion (Building a completely local "deep researcher" with DeepSeek-R1 - YouTube).
DeepSeek R1's recipe to duplicate o1 and the future of reasoning LMs.
The Illustrated DeepSeek-R1 - by Jay Alammar.
Explainer: What's R1 & Everything Else? - Tim Kellogg.
DeepSeek R1 Explained to your granny - YouTube
DeepSeek
- Try R1 at chat.deepseek.com.
GitHub - deepseek-ai/DeepSeek-R 1.
deepseek-ai/Janus-Pro -7 B · Hugging Face (January 2025): Janus-Pro is a novel autoregressive framework that combines multimodal understanding and generation. It can both understand and produce images.
DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models by means of Reinforcement Learning (January 2025) This paper presents DeepSeek-R1, an open-source thinking model that matches the performance of OpenAI's o1. It presents a detailed approach for training such designs using large-scale support knowing methods.
DeepSeek-V3 Technical Report (December 2024) This report talks about the execution of an FP8 combined precision training framework confirmed on an extremely massive design, attaining both sped up training and lowered GPU memory usage.
DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper looks into scaling laws and presents findings that help with the scaling of massive designs in open-source configurations. It presents the DeepSeek LLM task, committed to advancing open-source language designs with a long-term viewpoint.
DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research presents the DeepSeek-Coder series, a series of open-source code models trained from scratch on 2 trillion tokens. The designs are pre-trained on a top quality project-level code corpus and employ a fill-in-the-blank task to improve code generation and infilling.
DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model (May 2024) This paper provides DeepSeek-V2, a Mixture-of-Experts (MoE) language design identified by cost-effective training and effective inference.
DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence (June 2024) This research introduces DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model that attains efficiency similar to GPT-4 Turbo in code-specific tasks.

Interesting events
- Hong Kong University replicates R1 outcomes (Jan 25, '25).
- Huggingface reveals huggingface/open-r 1: Fully open reproduction of DeepSeek-R1 to duplicate R1, wiki.lafabriquedelalogistique.fr fully open source (Jan 25, '25).
- OpenAI researcher verifies the DeepSeek group individually discovered and utilized some core ideas the OpenAI group used on the method to o1
Liked this post? Join the newsletter.