Преглед

  • Дата на основаване април 29, 1941
  • Сектори Медии
  • Публикувани работни места 0
  • Разгледано 18

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

Understanding DeepSeek R1

DeepSeek-R1 is an open-source language design constructed on DeepSeek-V3-Base that’s been making waves in the AI community. Not just does it match-or even surpass-OpenAI’s o1 model in lots of standards, however it also includes fully MIT-licensed weights. This marks it as the first non-OpenAI/Google model to provide strong reasoning capabilities in an open and available manner.

What makes DeepSeek-R1 especially exciting is its transparency. Unlike the less-open approaches from some market leaders, DeepSeek has actually published a detailed training methodology in their paper.
The model is also incredibly 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 knowledge was that better models needed more data and compute. While that’s still legitimate, models like o1 and R1 show an alternative: inference-time scaling through reasoning.

The Essentials

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

DeepSeek-R1 uses two major concepts:

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

R1 and R1-Zero are both reasoning designs. This essentially implies they do Chain-of-Thought before answering. For the R1 series of designs, this takes form as believing within a tag, before addressing with a last summary.

R1-Zero vs R1

R1-Zero uses Reinforcement Learning (RL) straight to DeepSeek-V3-Base with no monitored fine-tuning (SFT). RL is utilized to optimize the design’s policy to make the most of reward.
R1-Zero attains outstanding precision however often produces complicated outputs, such as blending numerous languages in a single action. R1 repairs that by including limited monitored fine-tuning and multiple RL passes, which improves both correctness and readability.

It is interesting how some languages might reveal certain ideas better, which leads the model to select the most meaningful language for the task.

Training Pipeline

The training pipeline that DeepSeek released in the R1 paper is exceptionally intriguing. It showcases how they created such strong thinking designs, and what you can expect from each phase. This includes the issues that the resulting designs from each stage have, and how they resolved it in the next stage.

It’s fascinating that their training pipeline varies from the typical:

The usual training method: Pretraining on big dataset (train to anticipate next word) to get the base model → monitored fine-tuning → preference tuning by means of RLHF
R1-Zero: Pretrained → RL
R1: Pretrained → Multistage training pipeline with several SFT and RL stages

Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a couple of thousand Chain-of-Thought (CoT) samples to guarantee the RL process has a good starting point. This gives a good design to start RL.
First RL Stage: Apply GRPO with rule-based benefits to improve thinking 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 step. The result of this step is a strong reasoning model but with weak general abilities, e.g., christianpedia.com bad formatting and language blending.
Rejection Sampling + basic data: Create new SFT information through rejection tasting on the RL checkpoint (from action 2), combined with monitored information from the DeepSeek-V3-Base model. They collected around 600k high-quality reasoning samples.
Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k overall samples (600k reasoning + 200k basic tasks) for broader capabilities. This step led to a strong reasoning model with general abilities.
Second RL Stage: Add more reward signals (helpfulness, harmlessness) to improve the final design, in addition to the reasoning rewards. The result is DeepSeek-R1.
They likewise did model distillation for a number of Qwen and Llama designs on the thinking traces to get distilled-R1 models.

Model distillation is a technique where you use a teacher design to enhance a trainee model by producing training information for the trainee model.
The instructor is usually a larger design than the trainee.

Group Relative Policy Optimization (GRPO)

The basic concept behind utilizing reinforcement knowing for setiathome.berkeley.edu LLMs is to fine-tune the design’s policy so that it naturally produces more accurate and helpful responses.
They utilized a benefit system that inspects not only for accuracy but likewise for appropriate formatting and language consistency, so the model gradually learns to favor reactions that meet these quality criteria.

In this paper, they motivate the R1 model to create chain-of-thought reasoning through RL training with GRPO.
Rather than including a different module at reasoning time, the training procedure itself nudges the design to produce detailed, detailed outputs-making the chain-of-thought an emergent behavior of the optimized policy.

What makes their technique especially fascinating is its dependence on straightforward, rule-based reward functions.
Instead of depending upon costly external designs or human-graded examples as in conventional RLHF, the RL used for R1 utilizes simple requirements: it may provide a greater reward if the answer is right, if it follows the expected/ formatting, and if the language of the answer that of the timely.
Not counting on a reward model likewise indicates you do not need to hang around and effort training it, and it does not take memory and calculate away from your main model.

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

1. For each input prompt, the model generates various reactions.
2. Each action receives a scalar reward based upon factors like precision, format, and language consistency.
3. Rewards are changed relative to the group’s performance, basically determining just how much better each action is compared to the others.
4. The design updates its method a little to prefer actions with greater relative advantages. It only makes small 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 aspect of GRPO is its versatility. You can utilize simple rule-based reward functions-for circumstances, awarding a perk when the model correctly uses the syntax-to guide the training.

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

For those aiming to dive deeper, Will Brown has actually written rather a nice application of training an LLM with RL utilizing GRPO. GRPO has actually likewise already been contributed to the Transformer Reinforcement Learning (TRL) library, which is another great resource.
Finally, Yannic Kilcher has a fantastic 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 approaches they have actually 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 indicate that RL improves the design’s overall performance by rendering the output circulation more robust, in other words, it appears that the improvement is associated to boosting the appropriate action from TopK instead of the enhancement of fundamental abilities.

In other words, RL fine-tuning tends to shape the output circulation so that the highest-probability outputs are more likely to be proper, although the overall ability (as measured by the variety of proper answers) is mainly present in the pretrained design.

This suggests that support learning on LLMs is more about refining and „shaping“ the existing distribution of reactions rather than enhancing the design with entirely new abilities.
Consequently, lespoetesbizarres.free.fr while RL strategies such as PPO and GRPO can produce substantial efficiency gains, there appears to be a fundamental ceiling determined 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 big milestone. I’m excited to see how it unfolds!

Running DeepSeek-R1

I have actually utilized DeepSeek-R1 via the main chat user interface for various issues, which it seems to resolve all right. The extra search performance makes it even nicer to use.

Interestingly, o3-mini(-high) was launched as I was composing this post. From my initial screening, R1 seems more powerful at math than o3-mini.

I also rented a single H100 via 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 carry out when released on a single H100 GPU-not to extensively test 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 operating on the GPU), running via 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 utilizing their GPU on their regional gaming setup.
Digital Spaceport wrote a complete guide on how to run Deepseek R1 671b completely 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 severe work, but it’s fun 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 designs need to believe before addressing, their time-to-usefulness is generally higher than other designs, however their effectiveness is likewise generally greater.
We need to both optimize usefulness and reduce time-to-usefulness.

70B through Ollama

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

GPU usage 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 through Reinforcement Learning
[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
DeepSeek R1 – Notion (Building a fully local „deep scientist“ with DeepSeek-R1 – YouTube).
DeepSeek R1’s dish to replicate 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 unifies multimodal understanding and generation. It can both understand and produce images.
DeepSeek-R1: oke.zone Incentivizing Reasoning Capability in Large Language Models by means of Reinforcement Learning (January 2025) This paper introduces DeepSeek-R1, an open-source thinking model that equals the efficiency of OpenAI’s o1. It provides a detailed approach for training such models using large-scale reinforcement learning techniques.
DeepSeek-V3 Technical Report (December 2024) This report goes over the implementation of an FP8 combined accuracy training structure verified on an exceptionally large-scale model, attaining both accelerated training and reduced GPU memory use.
DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper delves into scaling laws and provides findings that facilitate the scaling of large-scale models in open-source configurations. It presents the DeepSeek LLM job, dedicated to advancing open-source language designs with a long-term point of view.
DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research study presents the DeepSeek-Coder series, a series of open-source code designs trained from scratch on 2 trillion tokens. The designs are pre-trained on a top quality project-level code corpus and raovatonline.org use 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 provides DeepSeek-V2, a Mixture-of-Experts (MoE) language model identified by cost-effective training and effective inference.
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 comparable 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 duplicate R1, fully open source (Jan 25, ’25).
– OpenAI scientist verifies the DeepSeek group individually found and used some core concepts the OpenAI group utilized on the way to o1

Liked this post? Join the newsletter.

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

LTU Sofia

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

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