DeepSeek-R1 is an open-source language design developed on DeepSeek-V3-Base that's been making waves in the AI community. Not only does it match-or even surpass-OpenAI's o1 model in lots of benchmarks, however it likewise features totally MIT-licensed weights. This marks it as the first non-OpenAI/Google model to provide strong thinking abilities in an open and available way.
![](https://images.theconversation.com/files/160728/original/image-20170314-10741-11bu9ke.jpg?ixlib\u003drb-4.1.0\u0026rect\u003d0%2C35%2C1000%2C485\u0026q\u003d45\u0026auto\u003dformat\u0026w\u003d1356\u0026h\u003d668\u0026fit\u003dcrop)
What makes DeepSeek-R1 particularly interesting is its transparency. Unlike the less-open approaches from some market leaders, DeepSeek has 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 typical wisdom was that much better models required more data and compute. While that's still valid, models like o1 and R1 show an alternative: inference-time scaling through reasoning.
The Essentials
The DeepSeek-R1 paper provided multiple models, but main amongst them were R1 and R1-Zero. Following these are a series of distilled models that, while interesting, I will not talk about here.
DeepSeek-R1 uses two major concepts:
1. A multi-stage pipeline where a small set of cold-start data kickstarts the design, followed by massive RL.
2. Group Relative Policy Optimization (GRPO), a reinforcement learning technique that counts on comparing numerous model outputs per timely to avoid the need for a separate critic.
R1 and R1-Zero are both thinking models. This essentially implies they do Chain-of-Thought before responding to. For the R1 series of models, this takes type as believing within a tag, before addressing with a final summary.
R1-Zero vs R1
R1-Zero uses Reinforcement Learning (RL) straight to DeepSeek-V3-Base with no supervised fine-tuning (SFT). RL is utilized to enhance the design's policy to take full advantage of reward.
R1-Zero attains outstanding accuracy however sometimes produces confusing outputs, such as blending numerous languages in a single response. R1 repairs that by integrating minimal monitored fine-tuning and several RL passes, which enhances both accuracy and readability.
It is intriguing how some languages may express certain concepts 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 profoundly intriguing. It showcases how they produced such strong reasoning models, and what you can get out of each phase. This includes the issues that the resulting models from each phase have, and how they resolved it in the next stage.
It's fascinating that their training pipeline differs from the typical:
The usual training method: Pretraining on large dataset (train to predict next word) to get the base design → monitored fine-tuning → preference tuning by means of RLHF
R1-Zero: Pretrained → RL
R1: Pretrained → Multistage training pipeline with numerous SFT and RL stages
Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a couple of thousand Chain-of-Thought (CoT) samples to ensure the RL procedure has a decent beginning point. This gives an excellent design to begin RL.
First RL Stage: Apply GRPO with rule-based rewards to enhance reasoning accuracy and format (such as forcing chain-of-thought into believing tags). When they were near convergence in the RL procedure, they relocated to the next step. The result of this action is a strong thinking design but with weak basic abilities, e.g., poor format and language mixing.
Rejection Sampling + basic data: Create new SFT information through rejection sampling on the RL checkpoint (from step 2), integrated with supervised information from the DeepSeek-V3-Base model. They collected around 600k premium reasoning samples.
Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k overall samples (600k reasoning + 200k general tasks) for wider capabilities. This action resulted in a strong thinking design with general capabilities.
Second RL Stage: Add more reward signals (helpfulness, harmlessness) to fine-tune the last model, in addition to the thinking rewards. The result is DeepSeek-R1.
They also did model distillation for numerous Qwen and Llama designs on the reasoning traces to get distilled-R1 models.
Model distillation is a strategy where you utilize a teacher model to improve a trainee design by generating training information for the trainee model.
The instructor is normally a larger model than the trainee.
Group Relative Policy Optimization (GRPO)
The fundamental idea behind utilizing reinforcement learning for LLMs is to tweak the design's policy so that it naturally produces more precise and beneficial responses.
They used a benefit system that checks not just for correctness however likewise for correct formatting and language consistency, so the design slowly finds out to favor reactions that satisfy these quality requirements.
In this paper, they encourage the R1 design to create chain-of-thought reasoning through RL training with GRPO.
Instead of adding a different module at reasoning time, the training procedure itself nudges the model to produce detailed, detailed outputs-making the chain-of-thought an emergent habits of the optimized policy.
What makes their approach particularly fascinating is its reliance on straightforward, rule-based reward functions.
Instead of depending on costly external designs or human-graded examples as in traditional RLHF, the RL utilized for R1 utilizes easy criteria: it may provide a greater benefit if the response is proper, if it follows the anticipated/ formatting, and if the language of the answer matches that of the prompt.
Not depending on a reward model also indicates you do not have to hang out and effort training it, and it doesn't take memory and compute far from your main design.
GRPO was introduced in the DeepSeekMath paper. Here's how GRPO works:
1. For each input timely, the model generates different reactions.
2. Each response receives a scalar benefit based upon elements like precision, formatting, and language consistency.
3. Rewards are adjusted relative to the group's performance, essentially measuring how much better each reaction is compared to the others.
4. The model updates its strategy slightly to prefer actions with greater relative advantages. It just makes small adjustments-using methods like clipping and a KL penalty-to make sure the policy does not stray too far from its original behavior.
A cool aspect of GRPO is its flexibility. You can use easy rule-based benefit functions-for circumstances, awarding a bonus offer when the model properly uses the syntax-to guide the training.
While DeepSeek utilized GRPO, you might utilize alternative techniques instead (PPO or PRIME).
For those aiming to dive deeper, Will Brown has actually written quite a nice execution of training an LLM with RL using GRPO. GRPO has actually likewise currently been added to the Transformer Reinforcement Learning (TRL) library, which is another excellent 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 last note on explaining DeepSeek-R1 and accc.rcec.sinica.edu.tw the methods they've provided in their paper, I desire to highlight a passage from the DeepSeekMath paper, based on a point Yannic Kilcher made in his video.
These findings indicate that RL enhances the design's total performance by rendering the output circulation more robust, simply put, it seems that the enhancement is associated to increasing the right action from TopK rather than the enhancement of fundamental capabilities.
To put it simply, RL fine-tuning tends to shape the output distribution so that the highest-probability outputs are more most likely to be appropriate, although the total ability (as measured by the variety of proper responses) is mainly present in the pretrained design.
This recommends that support learning on LLMs is more about refining and "forming" the existing circulation of responses rather than enhancing the design with completely brand-new abilities.
Consequently, while RL methods such as PPO and GRPO can produce substantial efficiency gains, there seems an intrinsic 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 milestone. I'm thrilled to see how it unfolds!
Running DeepSeek-R1
I've utilized DeepSeek-R1 via the main chat user interface for numerous problems, which it appears to solve all right. The additional search functionality makes it even nicer to use.
Interestingly, o3-mini(-high) was released as I was composing this post. From my preliminary testing, R1 appears more powerful at math than o3-mini.
I likewise 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 model would perform when released on a single H100 GPU-not to thoroughly test the model's abilities.
671B by means of 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 operating on the GPU), running via llama.cpp:
29 layers seemed to be the sweet area offered this setup.
Performance:
A r/localllama user explained that they had the ability to get over 2 tok/sec with DeepSeek R1 671B, wiki.whenparked.com without using their GPU on their local video gaming setup.
Digital Spaceport composed a full guide on how to run Deepseek R1 671b fully 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 major work, however it's enjoyable to run these big designs on available hardware.
What matters most to me is a combination of effectiveness and time-to-usefulness in these models. Since thinking designs need to think before answering, their time-to-usefulness is typically higher than other models, however their effectiveness is likewise usually greater.
We require to both take full advantage of effectiveness and reduce time-to-usefulness.
70B via Ollama
70.6 b params, 4-bit KM quantized DeepSeek-R1 running through Ollama:
GPU usage shoots up here, as expected 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 scientist" with DeepSeek-R1 - YouTube).
DeepSeek R1's dish to replicate o1 and garagesale.es the future of thinking LMs.
The Illustrated DeepSeek-R1 - by Jay Alammar.
Explainer: What's R1 & Everything Else? - Tim Kellogg.
DeepSeek R1 Explained to your grandmother - 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 an unique autoregressive framework that unifies multimodal understanding and generation. It can both understand and create images.
DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models via Reinforcement Learning (January 2025) This paper introduces DeepSeek-R1, oke.zone an open-source reasoning design that rivals the performance of OpenAI's o1. It presents a detailed method for training such designs using large-scale support learning methods.
DeepSeek-V3 Technical Report (December 2024) This report goes over the application of an FP8 blended accuracy training framework validated on a very large-scale design, attaining both accelerated training and lowered GPU memory usage.
DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper explores scaling laws and presents findings that help with the scaling of massive models in open-source setups. It introduces the DeepSeek LLM job, dedicated to advancing open-source language designs with a long-term viewpoint.
DeepSeek-Coder: gdprhub.eu When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research study presents the DeepSeek-Coder series, a variety of open-source code models trained from scratch on 2 trillion tokens. The models are pre-trained on a premium project-level code corpus and employ a fill-in-the-blank task to enhance code generation and infilling.
DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model (May 2024) This paper presents DeepSeek-V2, a Mixture-of-Experts (MoE) language model characterized by affordable training and effective reasoning.
DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence (June 2024) This research study introduces 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 duplicates R1 outcomes (Jan 25, '25).
- Huggingface announces huggingface/open-r 1: Fully open reproduction of DeepSeek-R1 to replicate R1, totally open source (Jan 25, '25).
- OpenAI scientist confirms the DeepSeek team independently discovered and used some core ideas the OpenAI group utilized en route to o1
Liked this post? Join the newsletter.
![](https://dp-cdn-deepseek.obs.cn-east-3.myhuaweicloud.com/api-docs/ds_v3_benchmark_table_en.jpeg)