DeepSeek-R1 is an open-source language model 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 design in many benchmarks, however it also comes with totally MIT-licensed weights. This marks it as the very first non-OpenAI/Google model to deliver strong thinking capabilities in an open and available way.
What makes DeepSeek-R1 particularly exciting is its openness. Unlike the less-open techniques from some industry leaders, DeepSeek has published a detailed training method in their paper.
The model is also remarkably 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 knowledge was that better models needed more data and calculate. While that's still legitimate, designs like o1 and R1 show an option: inference-time scaling through thinking.
The Essentials
The DeepSeek-R1 paper presented several designs, however 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 2 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 support learning approach that relies on comparing numerous design outputs per timely to prevent the need for a different critic.
R1 and R1-Zero are both reasoning models. This essentially indicates they do Chain-of-Thought before addressing. For the R1 series of models, this takes form as believing within a tag, before addressing with a final summary.
R1-Zero vs R1
R1-Zero applies Reinforcement Learning (RL) straight to DeepSeek-V3-Base with no monitored fine-tuning (SFT). RL is used to optimize the model's policy to optimize benefit.
R1-Zero attains outstanding accuracy however in some cases produces complicated outputs, such as mixing numerous languages in a single response. R1 repairs that by incorporating restricted monitored fine-tuning and multiple RL passes, which enhances both accuracy and readability.
It is fascinating how some languages may express certain ideas much better, which leads the design to select the most expressive language for the job.
Training Pipeline
The training pipeline that DeepSeek released in the R1 paper is tremendously fascinating. It showcases how they produced such strong thinking models, and what you can anticipate from each stage. This includes the issues that the resulting models from each stage have, and how they fixed it in the next phase.
It's fascinating that their training pipeline varies from the typical:
The typical training strategy: Pretraining on large dataset (train to predict next word) to get the base design → supervised fine-tuning → choice tuning by means of RLHF
R1-Zero: Pretrained → RL
R1: Pretrained → Multistage training pipeline with multiple SFT and RL phases
Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a few thousand Chain-of-Thought (CoT) samples to ensure the RL process has a decent beginning point. This provides a great design to start RL.
First RL Stage: Apply GRPO with rule-based benefits to improve reasoning correctness and formatting (such as requiring chain-of-thought into believing tags). When they were near convergence in the RL process, they relocated to the next action. The outcome of this step is a strong thinking model however with weak basic abilities, e.g., poor format and language blending.
Rejection Sampling + general data: Create brand-new SFT information through rejection tasting on the RL checkpoint (from action 2), combined with supervised information from the DeepSeek-V3-Base design. They collected around 600k premium thinking samples.
Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k overall samples (600k reasoning + 200k general tasks) for broader capabilities. This step led to a strong thinking model with basic abilities.
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 model distillation for several Qwen and Llama designs on the reasoning traces to get distilled-R1 models.
Model distillation is a method where you utilize an instructor model to enhance a trainee design by generating training information for the trainee design.
The instructor is usually a bigger design than the trainee.
Group Relative Policy Optimization (GRPO)
The fundamental concept behind utilizing support learning for asteroidsathome.net LLMs is to fine-tune the design's policy so that it naturally produces more accurate and beneficial answers.
They utilized a reward system that checks not only for correctness but also for proper formatting and language consistency, so the model slowly learns to prefer responses that fulfill these quality requirements.
In this paper, they motivate the R1 design to produce chain-of-thought thinking through RL training with GRPO.
Instead of including a separate module at reasoning time, the training procedure itself pushes the model to produce detailed, detailed outputs-making the chain-of-thought an emergent habits of the enhanced policy.
What makes their technique especially fascinating is its dependence on straightforward, rule-based reward functions.
Instead of depending upon pricey external models or human-graded examples as in standard RLHF, the RL utilized for R1 utilizes basic requirements: it may offer a greater benefit if the response is correct, if it follows the expected/ formatting, and if the language of the answer matches that of the timely.
Not relying on a reward model also you do not need to hang out and effort training it, and it doesn't take memory and calculate far 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 reaction receives a scalar benefit based on factors like accuracy, formatting, and language consistency.
3. Rewards are adjusted relative to the group's performance, essentially measuring how much better each action is compared to the others.
4. The model updates its strategy a little to favor reactions with greater relative benefits. It just makes small adjustments-using techniques like clipping and a KL penalty-to make sure the policy doesn't stray too far from its original habits.
A cool aspect of GRPO is its versatility. You can utilize easy rule-based reward functions-for circumstances, awarding a reward when the model correctly uses the syntax-to guide the training.
While DeepSeek used GRPO, you could utilize alternative approaches instead (PPO or PRIME).
For those aiming to dive much deeper, Will Brown has actually composed rather a great application of training an LLM with RL using GRPO. GRPO has actually also already been contributed to the Transformer Reinforcement Learning (TRL) library, which is another good resource.
Finally, Yannic Kilcher has a fantastic 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 have actually presented in their paper, I desire to highlight a passage from the DeepSeekMath paper, gratisafhalen.be based on a point Yannic Kilcher made in his video.
These findings indicate that RL enhances the model's overall performance by rendering the output circulation more robust, simply put, it appears that the improvement is credited to increasing the right reaction from TopK rather than the improvement of basic abilities.
To put it simply, RL fine-tuning tends to form the output distribution so that the highest-probability outputs are most likely to be proper, despite the fact that the general capability (as determined by the diversity of proper responses) is mainly present in the pretrained design.
This recommends that support knowing on LLMs is more about refining and "forming" the existing circulation of actions rather than endowing the model with completely new abilities.
Consequently, while RL techniques such as PPO and GRPO can produce significant 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 thrilled to see how it unfolds!
Running DeepSeek-R1
I have actually used DeepSeek-R1 through the main chat interface for various issues, which it seems to solve all right. The additional search functionality makes it even better to use.
Interestingly, o3-mini(-high) was released as I was composing this post. From my preliminary testing, R1 seems more powerful at mathematics than o3-mini.
I also rented a single H100 by means of Lambda Labs for $2/h (26 CPU cores, 214.7 GB RAM, 1.1 TB SSD) to run some experiments.
The main objective was to see how the design would carry out when released on a single H100 GPU-not to thoroughly evaluate the design's abilities.
671B through 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 by means of llama.cpp:
29 layers seemed to be the sweet spot given this configuration.
Performance:
A r/localllama user explained that they were able to overcome 2 tok/sec with DeepSeek R1 671B, without using their GPU on their regional video gaming setup.
Digital Spaceport wrote a complete guide on how to run Deepseek R1 671b totally 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 rather bearable for any severe work, but it's fun to run these large designs on available hardware.
What matters most to me is a combination of effectiveness and time-to-usefulness in these designs. Since reasoning designs need to think before addressing, their time-to-usefulness is usually greater than other models, but their effectiveness is likewise typically higher.
We need to both make the most of effectiveness and decrease time-to-usefulness.
70B by means of Ollama
70.6 b params, 4-bit KM quantized DeepSeek-R1 running through Ollama:
GPU utilization 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 through Reinforcement Learning
[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
DeepSeek R1 - Notion (Building a fully local "deep researcher" with DeepSeek-R1 - YouTube).
DeepSeek R1's dish to reproduce o1 and 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 structure that merges multimodal understanding and generation. It can both comprehend and create images.
DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models through Reinforcement Learning (January 2025) This paper introduces DeepSeek-R1, an open-source thinking design that matches the performance of OpenAI's o1. It presents a detailed method for training such designs using large-scale reinforcement knowing techniques.
DeepSeek-V3 Technical Report (December 2024) This report goes over the implementation of an FP8 combined accuracy training framework verified on an incredibly large-scale design, attaining both accelerated training and minimized 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 large-scale models in open-source setups. It introduces the DeepSeek LLM task, dedicated to advancing open-source language models with a long-term perspective.
DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research study introduces 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 top quality project-level code corpus and use a fill-in-the-blank job to boost 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 defined by affordable training and efficient reasoning.
DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence (June 2024) This research study 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 tasks.
Interesting occasions
- Hong Kong University reproduces R1 outcomes (Jan 25, '25).
- Huggingface reveals huggingface/open-r 1: Fully open recreation of DeepSeek-R1 to duplicate R1, totally open source (Jan 25, '25).
- OpenAI scientist verifies the DeepSeek group individually found and used some core ideas the OpenAI team used on the way to o1
Liked this post? Join the newsletter.
1
Understanding DeepSeek R1
Adela Groves edited this page 2025-02-09 16:39:02 +00:00