
DeepSeek-R1 is an open-source language model 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 standards, but it likewise comes with fully MIT-licensed weights. This marks it as the first non-OpenAI/Google design to provide strong thinking capabilities in an open and available manner.
What makes DeepSeek-R1 especially interesting is its transparency. Unlike the less-open techniques from some market leaders, DeepSeek has actually published a detailed training methodology in their paper.
The model is likewise extremely cost-effective, with input tokens costing just $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 common knowledge was that better designs required more data and compute. While that's still legitimate, designs like o1 and R1 demonstrate an alternative: inference-time scaling through reasoning.
The Essentials
The DeepSeek-R1 paper presented numerous models, but main amongst them were R1 and R1-Zero. Following these are a series of distilled designs that, while intriguing, I won't go over here.
DeepSeek-R1 uses 2 significant ideas:
1. A multi-stage pipeline where a small set of cold-start information kickstarts the model, followed by large-scale RL.
2. Group Relative Policy Optimization (GRPO), a support knowing approach that depends on comparing numerous model outputs per timely to avoid the need for a separate critic.
R1 and R1-Zero are both thinking designs. This basically means they do Chain-of-Thought before responding to. For the R1 series of designs, this takes type as believing within a tag, before responding to with a final summary.
R1-Zero vs R1
R1-Zero uses Reinforcement Learning (RL) straight to DeepSeek-V3-Base without any supervised fine-tuning (SFT). RL is utilized to enhance the design's policy to optimize reward.
R1-Zero attains exceptional precision however often produces confusing outputs, such as blending multiple languages in a single reaction. R1 repairs that by incorporating restricted monitored fine-tuning and numerous RL passes, which enhances both correctness and readability.
It is interesting how some languages may reveal certain ideas better, which leads the model to select the most expressive language for the job.
Training Pipeline
The training pipeline that DeepSeek published in the R1 paper is profoundly intriguing. It showcases how they developed such strong reasoning designs, and what you can get out of each stage. This includes the problems that the resulting models from each phase have, and how they solved it in the next phase.
It's interesting that their training pipeline differs from the usual:
The usual training method: Pretraining on large dataset (train to predict next word) to get the base model → monitored fine-tuning → choice tuning by means of RLHF
R1-Zero: Pretrained → RL
R1: Pretrained → Multistage training pipeline with numerous SFT and RL phases
Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a couple of thousand Chain-of-Thought (CoT) samples to guarantee the RL procedure has a good starting point. This provides a great model to begin RL.
First RL Stage: Apply GRPO with rule-based rewards to enhance thinking accuracy and format (such as forcing chain-of-thought into thinking tags). When they were near merging in the RL procedure, they transferred to the next action. The result of this action is a strong reasoning design but with weak general capabilities, e.g., poor formatting and language blending.
Rejection Sampling + basic data: Create new SFT information through rejection sampling on the RL checkpoint (from action 2), combined with supervised information from the DeepSeek-V3-Base design. They gathered around 600k high-quality thinking samples.
Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k total samples (600k reasoning + 200k basic jobs) for wider abilities. This step resulted in a strong thinking design with general capabilities.
Second RL Stage: Add more benefit signals (helpfulness, harmlessness) to improve the last design, online-learning-initiative.org in addition to the thinking benefits. The result is DeepSeek-R1.
They also did design distillation for numerous Qwen and Llama designs on the reasoning traces to get distilled-R1 designs.
Model distillation is a method where you utilize an instructor wiki.vst.hs-furtwangen.de model to improve a trainee design by generating training data for the trainee design.
The teacher is generally a bigger model than the trainee.
Group Relative Policy Optimization (GRPO)
The fundamental concept behind using reinforcement knowing for LLMs is to tweak the design's policy so that it naturally produces more precise and helpful responses.
They utilized a reward system that inspects not just for correctness however likewise for appropriate formatting and language consistency, higgledy-piggledy.xyz so the design gradually discovers to favor actions that meet these quality requirements.
In this paper, they motivate the R1 design to generate chain-of-thought thinking through RL training with GRPO.
Instead of adding a separate module at reasoning time, the training procedure itself nudges the model to produce detailed, detailed outputs-making the chain-of-thought an emergent behavior of the optimized policy.
What makes their technique particularly interesting is its dependence on straightforward, rule-based benefit functions.
Instead of depending upon costly external models or human-graded examples as in conventional RLHF, the RL utilized for R1 utilizes easy criteria: hb9lc.org it might give a greater reward if the answer is right, if it follows the anticipated/ formatting, and if the language of the answer matches that of the prompt.
Not depending on a benefit model likewise suggests you do not need to hang around and effort training it, and it doesn't take memory and calculate away from your main design.
GRPO was presented in the DeepSeekMath paper. Here's how GRPO works:
1. For each input timely, the design creates various actions.
2. Each response receives a scalar reward based on factors like accuracy, formatting, and language consistency.
3. Rewards are adjusted relative to the group's performance, basically determining how much better each action is compared to the others.
4. The model updates its method slightly to prefer actions with greater relative advantages. It just makes small adjustments-using strategies like clipping and a KL penalty-to make sure the policy doesn't stray too far from its initial habits.

A cool aspect of GRPO is its versatility. You can utilize easy rule-based reward functions-for circumstances, granting a perk when the design properly utilizes the syntax-to guide the training.
While DeepSeek used GRPO, you could use alternative approaches instead (PPO or PRIME).
For those aiming to dive much deeper, Will Brown has actually written quite a great execution of training an LLM with RL utilizing GRPO. GRPO has also already been contributed to the Transformer Reinforcement Learning (TRL) library, which is another good resource.
Finally, Yannic Kilcher has a terrific video explaining GRPO by going through the DeepSeekMath paper.
Is RL on LLMs the path to AGI?
As a final note on explaining DeepSeek-R1 and the methods they've presented in their paper, I wish to highlight a passage from the DeepSeekMath paper, based upon a point Yannic Kilcher made in his video.
These findings show that RL boosts the model's overall efficiency by rendering the output circulation more robust, in other words, it seems that the enhancement is credited to boosting the right response from TopK instead of the improvement of essential capabilities.
In other words, RL fine-tuning tends to shape the output circulation so that the highest-probability outputs are more most likely to be proper, even though the total ability (as measured by the diversity of proper responses) is mainly present in the pretrained design.
This suggests that reinforcement knowing on LLMs is more about refining and "forming" the existing circulation of reactions instead of enhancing the model with totally new abilities.
Consequently, while RL techniques such as PPO and GRPO can produce significant efficiency gains, there appears to be a fundamental ceiling identified by the underlying design'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 milestone. I'm thrilled to see how it unfolds!
Running DeepSeek-R1
I've used DeepSeek-R1 by means of the main chat interface for various problems, which it seems to fix all right. The extra search functionality makes it even nicer to use.
Interestingly, o3-mini(-high) was released as I was writing this post. From my preliminary testing, R1 seems stronger at math than o3-mini.
I also leased a single H100 through 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 capabilities.
671B via Llama.cpp
DeepSeek-R1 1.58-bit (UD-IQ1_S) quantized model by Unsloth, with a 4-bit quantized KV-cache and partial GPU offloading (29 layers running on the GPU), running by means of llama.cpp:
29 layers appeared to be the sweet spot offered this configuration.
Performance:
(1).pngL.jpg)
A r/localllama user explained that they had the ability to overcome 2 tok/sec with DeepSeek R1 671B, without using their GPU on their local video gaming setup.
Digital Spaceport composed a full guide on how to run Deepseek R1 671b fully in your area 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 quite manageable for any serious work, gratisafhalen.be but it's enjoyable to run these large models on available hardware.
What matters most to me is a mix of effectiveness and time-to-usefulness in these designs. Since thinking models require to believe before answering, their time-to-usefulness is typically higher than other designs, however their usefulness is likewise generally greater.
We need to both maximize effectiveness and decrease time-to-usefulness.
70B via Ollama
70.6 b params, bryggeriklubben.se 4-bit KM quantized DeepSeek-R1 running via Ollama:
GPU usage soars 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 via Reinforcement Learning
[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
DeepSeek R1 - Notion (Building a totally regional "deep researcher" with DeepSeek-R1 - YouTube).
DeepSeek R1's dish 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 merges multimodal understanding and generation. It can both understand and generate images.
DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models via Reinforcement Learning (January 2025) This paper introduces DeepSeek-R1, an open-source thinking design that rivals the efficiency of OpenAI's o1. It provides a detailed method for training such models using large-scale reinforcement knowing strategies.
DeepSeek-V3 Technical Report (December 2024) This report goes over the application of an FP8 mixed accuracy training structure validated on an extremely large-scale model, attaining both accelerated training and minimized GPU memory usage.
DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper dives into scaling laws and provides findings that facilitate the scaling of massive models in open-source configurations. It presents the DeepSeek LLM task, devoted to advancing open-source language models 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 models are pre-trained on a high-quality project-level code corpus and utilize a fill-in-the-blank job 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 model defined by affordable training and efficient reasoning.
DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence (June 2024) This research presents DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model that attains efficiency equivalent to GPT-4 Turbo in code-specific jobs.
Interesting occasions
- Hong Kong University reproduces R1 results (Jan 25, '25).
- Huggingface reveals huggingface/open-r 1: asteroidsathome.net Fully open recreation of DeepSeek-R1 to replicate R1, fully open source (Jan 25, '25).
- OpenAI researcher confirms the DeepSeek team separately found and utilized some core ideas the OpenAI team utilized en route to o1
Liked this post? Join the newsletter.
