Преглед

  • Дата на основаване септември 11, 2013
  • Сектори Селско и горско стопанство
  • Публикувани работни места 0
  • Разгледано 24

Описание на компанията

Understanding DeepSeek R1

DeepSeek-R1 is an open-source language design constructed on DeepSeek-V3-Base that’s been making waves in the AI neighborhood. Not just does it match-or even surpass-OpenAI’s o1 design in many standards, but it likewise includes totally MIT-licensed weights. This marks it as the very first non-OpenAI/Google model to deliver strong thinking abilities in an open and it-viking.ch available manner.

What makes DeepSeek-R1 especially interesting is its openness. Unlike the less-open approaches from some industry leaders, DeepSeek has actually published a detailed training in their paper.
The design is likewise remarkably affordable, 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 wisdom was that much better models needed more data and compute. While that’s still legitimate, models like o1 and R1 demonstrate an alternative: inference-time scaling through reasoning.

The Essentials

The DeepSeek-R1 paper provided several designs, however main amongst them were R1 and R1-Zero. Following these are a series of distilled models that, while intriguing, I will not go over here.

DeepSeek-R1 uses two significant concepts:

1. A multi-stage pipeline where a little set of cold-start information kickstarts the design, followed by large-scale RL.
2. Group Relative Policy Optimization (GRPO), a support knowing technique that counts on comparing numerous model outputs per prompt to avoid the need for a separate critic.

R1 and R1-Zero are both thinking models. This essentially suggests they do Chain-of-Thought before responding to. For the R1 series of models, this takes kind 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 model’s policy to maximize reward.
R1-Zero attains outstanding precision however sometimes produces confusing outputs, such as mixing multiple languages in a single response. R1 repairs that by integrating limited monitored fine-tuning and several RL passes, which enhances both accuracy and readability.

It is intriguing how some languages might express certain concepts much better, which leads the design to pick the most expressive language for the task.

Training Pipeline

The training pipeline that DeepSeek released in the R1 paper is tremendously interesting. It showcases how they created such strong reasoning models, and what you can expect from each phase. This includes the problems that the resulting designs from each phase have, and how they solved it in the next phase.

It’s interesting that their training pipeline varies from the usual:

The typical training method: Pretraining on large dataset (train to anticipate next word) to get the base design → supervised fine-tuning → choice tuning via 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 couple of thousand Chain-of-Thought (CoT) samples to make sure the RL procedure has a good starting point. This gives an excellent 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 thinking tags). When they were near convergence in the RL process, they relocated to the next step. The result of this step is a strong reasoning model however with weak basic abilities, e.g., poor format and language blending.
Rejection Sampling + basic data: Create brand-new SFT information through rejection sampling on the RL checkpoint (from step 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 general jobs) for more comprehensive abilities. This step resulted in a strong reasoning design with general abilities.
Second RL Stage: Add more reward signals (helpfulness, harmlessness) to improve the final model, in addition to the thinking rewards. The outcome is DeepSeek-R1.
They also did model distillation for a number of Qwen and Llama models on the thinking traces to get distilled-R1 models.

Model distillation is a strategy where you utilize a teacher model to enhance a trainee model by producing training data for the trainee design.
The instructor is normally a bigger design than the trainee.

Group Relative Policy Optimization (GRPO)

The basic concept behind utilizing support learning for LLMs is to fine-tune the model’s policy so that it naturally produces more accurate and useful answers.
They utilized a benefit system that inspects not only for accuracy but likewise for appropriate formatting and disgaeawiki.info language consistency, so the model slowly learns to favor reactions that fulfill these quality criteria.

In this paper, they encourage the R1 design to create chain-of-thought reasoning through RL training with GRPO.
Instead of including a different module at inference time, the training process itself nudges the model to produce detailed, detailed outputs-making the chain-of-thought an emerging habits of the optimized policy.

What makes their technique particularly intriguing is its reliance on straightforward, rule-based reward functions.
Instead of depending upon expensive external designs or human-graded examples as in standard RLHF, the RL utilized for R1 utilizes easy requirements: it may provide a greater reward if the response is proper, if it follows the anticipated/ format, and if the language of the response matches that of the timely.
Not relying on a reward design likewise indicates you don’t need to spend time and effort training it, and it does not take memory and calculate far from your main design.

GRPO was introduced in the DeepSeekMath paper. Here’s how GRPO works:

1. For each input timely, the design creates different responses.
2. Each reaction gets a scalar benefit based on elements like precision, format, and language consistency.
3. Rewards are changed relative to the group’s efficiency, essentially determining just how much better each action is compared to the others.
4. The design updates its technique a little to favor actions with greater relative advantages. It only makes minor adjustments-using strategies like clipping and a KL penalty-to ensure the policy does not wander off too far from its original behavior.

A cool element of GRPO is its versatility. You can utilize basic rule-based reward functions-for circumstances, awarding a bonus offer when the model properly utilizes the syntax-to guide the training.

While DeepSeek used GRPO, you could utilize alternative techniques rather (PPO or PRIME).

For those aiming to dive much deeper, Will Brown has written rather a good application of training an LLM with RL using GRPO. GRPO has also already been contributed to the Transformer Reinforcement Learning (TRL) library, which is another excellent resource.
Finally, Yannic Kilcher has an excellent 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 methods they have actually presented in their paper, I want 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 efficiency by rendering the output distribution more robust, simply put, it appears that the enhancement is credited to improving the correct response from TopK instead of the enhancement of basic abilities.

In other words, RL fine-tuning tends to shape the output distribution so that the highest-probability outputs are more likely to be right, although the overall capability (as measured by the diversity of correct answers) is mainly present in the pretrained model.

This suggests that support knowing on LLMs is more about refining and „shaping“ the existing circulation of actions instead of endowing the model with totally brand-new abilities.
Consequently, while RL methods such as PPO and GRPO can produce considerable efficiency gains, there appears to be a fundamental ceiling figured out by the underlying design’s pretrained knowledge.

It is uncertain to me how far RL will take us. Perhaps it will be the stepping stone to the next huge milestone. I’m delighted to see how it unfolds!

Running DeepSeek-R1

I’ve used DeepSeek-R1 via the main chat interface for different issues, which it seems to solve well enough. The additional search functionality makes it even nicer to utilize.

Interestingly, o3-mini(-high) was launched as I was writing this post. From my preliminary screening, R1 seems stronger at mathematics than o3-mini.

I also rented a single H100 through Lambda Labs for $2/h (26 CPU cores, valetinowiki.racing 214.7 GB RAM, 1.1 TB SSD) to run some experiments.
The main goal was to see how the design would perform when released on a single H100 GPU-not to extensively test the design’s capabilities.

671B through Llama.cpp

DeepSeek-R1 1.58-bit (UD-IQ1_S) quantized design by Unsloth, with a 4-bit quantized KV-cache and partial GPU offloading (29 layers working on the GPU), running by means of llama.cpp:

29 layers appeared to be the sweet area provided this configuration.

Performance:

A r/localllama user explained that they were able to get over 2 tok/sec with DeepSeek R1 671B, without utilizing their GPU on their local video gaming setup.
Digital Spaceport composed a full 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 manageable for any severe work, but it’s fun to run these big designs on available hardware.

What matters most to me is a combination of effectiveness and time-to-usefulness in these designs. Since thinking designs need to think before answering, their time-to-usefulness is typically higher than other models, but their usefulness is also generally higher.
We need to both take full advantage of effectiveness and decrease time-to-usefulness.

70B through Ollama

70.6 b params, 4-bit KM quantized DeepSeek-R1 running through Ollama:

GPU utilization soars 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 regional „deep scientist“ with DeepSeek-R1 – YouTube).
DeepSeek R1‘s recipe 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 grandma – 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 combines multimodal understanding and generation. It can both comprehend and create images.
DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models by means of Reinforcement Learning (January 2025) This paper introduces DeepSeek-R1, an open-source thinking design that rivals the performance of OpenAI’s o1. It provides a detailed method for training such designs utilizing massive reinforcement learning strategies.
DeepSeek-V3 Technical Report (December 2024) This report discusses the execution of an FP8 mixed accuracy training structure confirmed on an incredibly large-scale design, attaining both accelerated training and decreased GPU memory use.
DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper looks into scaling laws and provides findings that help with the scaling of large-scale designs in open-source configurations. It presents the DeepSeek LLM project, devoted to advancing open-source language designs with a long-term perspective.
DeepSeek-Coder: asteroidsathome.net When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research presents the DeepSeek-Coder series, a variety of open-source code designs trained from scratch on 2 trillion tokens. The designs 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 cost-effective training and efficient inference.
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 similar to GPT-4 Turbo in code-specific jobs.

Interesting events

– Hong Kong University duplicates R1 results (Jan 25, ’25).
– Huggingface announces huggingface/open-r 1: Fully open reproduction of DeepSeek-R1 to replicate R1, fully open source (Jan 25, ’25).
– OpenAI researcher confirms the DeepSeek group independently discovered and used some core ideas the OpenAI group utilized en route to o1

Liked this post? Join the newsletter.

„Проектиране и разработка на софтуерни платформи - кариерен център със система за проследяване реализацията на завършилите студенти и обща информационна мрежа на кариерните центрове по проект BG05M2ОP001-2.016-0022 „Модернизация на висшето образование по устойчиво използване на природните ресурси в България“, финансиран от Оперативна програма „Наука и образование за интелигентен растеж“, съфинансирана от Европейския съюз чрез Европейските структурни и инвестиционни фондове."

LTU Sofia

Отговаряме бързо!

Здравейте, Добре дошли в сайта. Моля, натиснете бутона по-долу, за да се свържите с нас през Viber.