Raymond UzwyshynIdeas · Research · Artificial Intelligence
Models, Benchmarks & Reliability

The Making of DeepSeek-R1: Model Architecture and Training

Large Language Models (LLMs) like OpenAI's GPT o1, Anthropic's Claude and Google's Gemini have revolutionized artificial intelligence by generating human-like text and solving complex problems. However, one area…

Cover graphic for The Making of DeepSeek-R1: Model Architecture and Training

Introduction & Overview

Large Language Models (LLMs) like OpenAI's GPT o1, Anthropic's Claude and Google's Gemini have revolutionized artificial intelligence by generating human-like text and solving complex problems. However, one area where these models often fall short is reasoning—the ability to think through problems step-by-step, like a human would. This is where DeepSeek-R1 comes in. DeepSeek is a project aimed at enhancing the reasoning capabilities of LLMs, making them more effective at solving complex problems without relying on massive amounts of pre-trained data.

The key innovation of DeepSeek is its use of Reinforcement Learning (RL) to teach models how to reason. Unlike traditional methods that rely heavily on Supervised Fine-Tuning (SFT)—where models are trained on large datasets of labeled examples—DeepSeek shows that RL can be used to develop reasoning skills from scratch. This is a big deal because it opens up new possibilities for creating smarter, more autonomous AI systems.


Core Problem: Why Reasoning Matters

Imagine asking an AI to solve a math problem. A traditional LLM might give you the correct answer but fail to explain how it got there. This lack of transparency makes it hard to trust the model's reasoning process. Chain-of-Thought (CoT) reasoning is a technique that addresses this issue by encouraging the model to "think out loud," breaking down its reasoning into smaller, logical steps before arriving at the final answer. DeepSeek takes this idea further by using RL to incentivize the model to develop these reasoning skills on its own, without needing a lot of pre-labeled data.


DeepSeek-R1-Zero: The First Step

The journey begins with DeepSeek-R1-Zero, a model built on DeepSeek-V3-Base, an existing LLM. The goal was to see if RL alone could teach the model to reason effectively. Here's how they did it:

  1. Reinforcement Learning (RL): RL is a type of machine learning where the model learns by trial and error. It gets rewarded for good behavior (like correct answers) and penalized for bad behavior. DeepSeek used a specific RL framework called Group Relative Policy Optimization (GRPO), which helps the model learn more efficiently by comparing its performance to a group of other models.
  2. Rule-Based Rewards: Instead of using complex neural networks to determine rewards, DeepSeek used simple, rule-based rewards. For example, the model was rewarded for producing accurate answers and for formatting its reasoning process correctly (using tags like <think> and </think> to mark its thought process).
  3. Self-Evolution: Over thousands of training steps, DeepSeek-R1-Zero started to show signs of self-improvement. It naturally increased its "thinking time," spending more steps on complex problems. It also began to exhibit behaviors like reflection (rethinking its approach) and self-verification (checking its own work). These are signs of advanced reasoning, similar to how humans solve problems.
  4. The "Aha Moment": At one point, the model had an "aha moment," where it reevaluated its initial approach to a problem and came up with a better solution. This was a significant milestone, showing that the model was capable of more advanced reasoning.

However, there were some issues. The model sometimes produced hard-to-read responses and mixed languages, which needed to be addressed.


Key Findings from DeepSeek-R1-Zero

  1. RL Without SFT is Viable: One of the biggest findings was that RL alone could effectively teach the model to reason, without needing any initial SFT. This is a major breakthrough because it shows that models can develop complex reasoning skills from scratch, without relying on large amounts of pre-labeled data.
  2. Self-Evolution: The model's ability to improve itself over time was another key finding. By increasing its thinking time and exploring more lengthy CoTs, the model showed that it could adapt and evolve its reasoning process.
  3. "Aha Moments": The fact that the model could reevaluate its initial approach and come up with a better solution was a clear sign of advanced reasoning. This is something that even state-of-the-art models like GPT-4 struggle with.

Comparing DeepSeek-R1-Zero to Other Models

When compared to OpenAI's GPT-4, DeepSeek-R1-Zero showed significant improvements in reasoning tasks. For example, on the AIME 2024 benchmark (a test of reasoning ability), DeepSeek-R1-Zero's performance jumped from 15.6% to 71.0%. This is a huge leap, showing that DeepSeek's approach to reasoning was effective.

However, GPT-4 still had an edge in general knowledge and versatility. DeepSeek-R1-Zero was more specialized, focusing primarily on reasoning tasks. This specialization is both a strength and a limitation. While it excels in reasoning, it may not be as versatile as GPT-4 in other areas.


Future Trajectories

Looking ahead, DeepSeek's approach could lead to even more advanced models capable of general reasoning—the ability to apply logical thinking across a wide range of tasks, not just specialized ones. This could make AI systems more useful in fields like medicine, law, and education, where complex reasoning is essential.


Part 2: DeepSeek-R1, Distillation, and Broader Implications

DeepSeek-R1: Refining the Model

Building on the success of DeepSeek-R1-Zero, the team developed DeepSeek-R1, a more refined version of the model. Here's how they improved it:

  1. Cold-Start Data: They collected a small amount of high-quality data consisting of long, detailed Chain-of-Thought examples. This data was used to fine-tune the base model, giving it a better starting point for reasoning tasks.
  2. Language Consistency Reward: To address the issue of language mixing, they introduced a reward for consistent language use. This helped the model produce more coherent and readable responses.
  3. Two-Phase Training: After the initial fine-tuning, the model underwent a second round of reinforcement learning. This time, it was trained on prompts from a wide variety of scenarios, making it more versatile.
  4. Rejection Sampling: They used a technique called rejection sampling to generate high-quality training data. This involved selecting only the best responses from the model and using them to further train the base model.

The result was DeepSeek-R1, a model that performed on par with OpenAI's o1-1217, one of the most advanced models at the time.


Distillation: Sharing the Knowledge

Once DeepSeek-R1 was developed, the team wanted to make its reasoning capabilities available to smaller, more accessible models. This process is called distillation, where a large, complex model (like DeepSeek-R1) is used to train smaller models. Here's how they did it:

  1. Data Collection: They used 800,000 data samples from DeepSeek-R1 to train smaller models like Qwen and Llama.
  2. Supervised Fine-Tuning (SFT): Instead of using reinforcement learning, they found that direct supervised fine-tuning worked better for smaller models. This involved training the smaller models on the high-quality data generated by DeepSeek-R1.
  3. Open-Sourcing: Multiple distilled models of different sizes were released to the public. These models showed strong performance on reasoning benchmarks, outperforming other open-source models.

Comparing DeepSeek-R1 to Other Models

DeepSeek-R1 is comparable to OpenAI's GPT-4 in terms of reasoning capabilities, but it has some unique advantages:

  1. Specialization: DeepSeek-R1 is highly specialized in reasoning tasks, making it potentially more effective in fields that require complex problem-solving.
  2. Accessibility: Through distillation, DeepSeek has made its reasoning capabilities available to smaller, more accessible models. This democratizes access to advanced AI, allowing smaller organizations and researchers to benefit from DeepSeek's innovations.
  3. Cost-Effectiveness: Training smaller models through distillation is more computationally efficient than training large models from scratch. This makes DeepSeek's approach more sustainable in the long run.

Future Trajectories

The success of DeepSeek-R1 and its distilled models opens up several exciting possibilities:

  1. General Reasoning: Future versions of DeepSeek could focus on general reasoning, applying logical thinking across a wide range of tasks. This would make AI systems more versatile and useful in real-world applications.
  2. Interdisciplinary Applications: DeepSeek's reasoning capabilities could be applied to fields like medicine, law, and education, where complex problem-solving is essential.
  3. Collaboration with Other Models: DeepSeek could be integrated with other models to create hybrid systems that combine the strengths of different approaches. For example, combining DeepSeek's reasoning capabilities with GPT-4's general knowledge could lead to even more powerful AI systems.

Conclusion

DeepSeek's journey from DeepSeek-R1-Zero to DeepSeek-R1 and beyond is a testament to the power of iterative improvement and focused innovation. By prioritizing reasoning and leveraging techniques like reinforcement learning and distillation, DeepSeek has created models that not only match but often surpass the capabilities of state-of-the-art systems. This narrative shows how AI can evolve to think more like humans, opening up new possibilities for solving complex problems.

#DeepSeekR1 #GenAI #LLM

Originally published January 27, 2025. View the original publication ↗