Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
T
thaimassage-ellwangen
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI / CD
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
  • Klara Ruse
  • thaimassage-ellwangen
  • Issues
  • #1

Closed
Open
Opened Feb 09, 2025 by Klara Ruse@klaravlj758069
  • Report abuse
  • New issue
Report abuse New issue

Understanding DeepSeek R1


DeepSeek-R1 is an open-source language design developed 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 lots of criteria, but it likewise features totally MIT-licensed weights. This marks it as the first non-OpenAI/Google model to deliver strong reasoning abilities in an open and available way.

What makes DeepSeek-R1 especially amazing is its openness. Unlike the less-open approaches from some market leaders, DeepSeek has published a detailed training method in their paper. The design is likewise 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 typical knowledge was that better models required more information 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 presented several designs, but main among them were R1 and R1-Zero. Following these are a series of distilled designs that, while fascinating, I won't discuss here.

DeepSeek-R1 utilizes 2 significant concepts:

1. A multi-stage pipeline where a small set of cold-start information kickstarts the design, followed by massive RL. 2. Group Relative Policy Optimization (GRPO), a reinforcement knowing approach that depends on comparing several design outputs per timely to prevent the need for a different critic.

R1 and R1-Zero are both reasoning designs. This essentially means they do Chain-of-Thought before responding to. For the R1 series of designs, this takes form as thinking within a tag, before responding to with a last summary.

R1-Zero vs R1

R1-Zero uses Reinforcement Learning (RL) straight to DeepSeek-V3-Base without any monitored fine-tuning (SFT). RL is utilized to optimize the model's policy to optimize reward. R1-Zero attains outstanding accuracy but often produces complicated outputs, such as mixing numerous languages in a single response. R1 repairs that by integrating minimal monitored fine-tuning and several RL passes, which improves both correctness and readability.

It is interesting how some languages might reveal certain concepts better, which leads the design to select the most expressive language for the job.

Training Pipeline

The training pipeline that DeepSeek published in the R1 paper is profoundly interesting. It showcases how they produced such strong thinking models, and what you can expect from each phase. This consists of the problems that the resulting designs from each phase have, and how they fixed it in the next phase.

It's intriguing that their training pipeline differs from the typical:

The normal training technique: Pretraining on big 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 decent beginning point. This gives a great model to start RL. First RL Stage: Apply GRPO with rule-based benefits to enhance reasoning correctness and wiki.rolandradio.net format (such as requiring chain-of-thought into believing tags). When they were near convergence in the RL procedure, they moved to the next step. The outcome of this action is a strong thinking model but with weak general abilities, e.g., poor format and language mixing. Rejection Sampling + basic data: Create new SFT data through rejection tasting on the RL checkpoint (from action 2), combined with supervised data from the DeepSeek-V3-Base design. They collected around 600k top quality thinking samples. Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k overall samples (600k reasoning + 200k general tasks) for more comprehensive abilities. This action resulted in a strong reasoning design with basic capabilities. Second RL Stage: Add more reward signals (helpfulness, harmlessness) to fine-tune the last model, in addition to the thinking rewards. The outcome is DeepSeek-R1. They likewise did design distillation for a number of Qwen and Llama models on the reasoning traces to get distilled-R1 models.

Model distillation is a method where you use an instructor design to improve a trainee design by creating training information for the trainee design. The instructor is typically a bigger design than the trainee.

Group Relative Policy Optimization (GRPO)

The basic idea behind utilizing support knowing for LLMs is to tweak the design's policy so that it naturally produces more precise and helpful answers. They utilized a benefit system that checks not just for correctness but likewise for correct formatting and language consistency, so the model gradually finds out to favor responses that meet these quality criteria.

In this paper, they encourage the R1 design to generate chain-of-thought thinking through RL training with GRPO. Instead of adding a separate module at inference time, the training process itself pushes the model to produce detailed, detailed outputs-making the chain-of-thought an emerging habits of the enhanced policy.

What makes their technique especially interesting is its reliance on straightforward, rule-based benefit functions. Instead of depending upon expensive external designs or human-graded examples as in conventional RLHF, the RL utilized for R1 utilizes easy requirements: it may provide a higher benefit if the response is proper, if it follows the anticipated/ formatting, and if the language of the answer matches that of the timely. Not counting on a reward design likewise indicates you do not need to hang out and effort training it, and it does not take memory and calculate far from your main model.

GRPO was presented in the DeepSeekMath paper. Here's how GRPO works:

1. For each input prompt, the design produces different responses. 2. Each reaction gets a scalar benefit based upon factors like accuracy, format, and language consistency. 3. Rewards are adjusted relative to the group's efficiency, essentially measuring how much better each reaction is compared to the others. 4. The design updates its method slightly to prefer reactions with greater relative benefits. It only makes slight adjustments-using methods like clipping and a KL penalty-to ensure the policy doesn't stray too far from its original habits.

A cool aspect of GRPO is its flexibility. You can use simple rule-based reward functions-for instance, granting a reward when the design properly uses the syntax-to guide the training.

While DeepSeek utilized GRPO, you might use alternative techniques instead (PPO or PRIME).

For those aiming to dive much deeper, Will Brown has actually composed rather a great implementation of training an LLM with RL utilizing GRPO. GRPO has also currently been contributed to the Transformer Reinforcement Learning (TRL) library, which is another excellent 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've presented in their paper, I wish to highlight a passage from the DeepSeekMath paper, based on a point Yannic Kilcher made in his video.

These findings suggest that RL boosts the design's total efficiency by rendering the output distribution more robust, simply put, it appears that the enhancement is associated to increasing the correct action from TopK rather than the enhancement of fundamental capabilities.

To put it simply, RL fine-tuning tends to form the output distribution so that the highest-probability outputs are more likely to be right, despite the fact that the total capability (as measured by the variety of proper responses) is mainly present in the pretrained model.

This recommends that reinforcement learning on LLMs is more about refining and "forming" the existing circulation of actions rather than endowing the design with totally brand-new abilities. Consequently, while RL methods such as PPO and GRPO can produce considerable performance gains, there appears to be a fundamental ceiling figured out by the underlying model'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 thrilled to see how it unfolds!

Running DeepSeek-R1

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

Interestingly, o3-mini(-high) was released as I was composing this post. From my preliminary screening, R1 appears stronger at math than o3-mini.

I also rented 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 objective was to see how the model would perform when deployed on a single H100 GPU-not to extensively check the model'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 running on the GPU), running via llama.cpp:

29 layers appeared to be the sweet spot given this configuration.

Performance:

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

What matters most to me is a combination of effectiveness and time-to-usefulness in these designs. Since thinking models need to think before addressing, their time-to-usefulness is normally higher than other models, however their effectiveness is also generally higher. We require to both maximize usefulness and minimize time-to-usefulness.

70B by means of 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 totally local "deep scientist" with DeepSeek-R1 - YouTube). DeepSeek R1's recipe to duplicate o1 and the future of reasoning 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 a novel autoregressive structure that merges multimodal understanding and generation. It can both comprehend and produce images. DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models through Reinforcement Learning (January 2025) This paper presents DeepSeek-R1, an open-source thinking model that matches the efficiency of OpenAI's o1. It presents a detailed approach for training such designs using massive support learning methods. DeepSeek-V3 Technical Report (December 2024) This report goes over the application of an FP8 blended accuracy training framework validated on an exceptionally large-scale model, attaining both accelerated training and minimized GPU memory use. DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper looks into scaling laws and provides findings that assist in the scaling of large-scale designs in open-source setups. It presents the DeepSeek LLM job, devoted to advancing open-source language models with a long-term viewpoint. DeepSeek-Coder: 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 models trained from scratch on 2 trillion tokens. The models are pre-trained on a high-quality project-level code corpus and employ a fill-in-the-blank job to enhance code generation and infilling. DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts (May 2024) This paper provides DeepSeek-V2, a Mixture-of-Experts (MoE) language design identified 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 design that attains efficiency similar to GPT-4 Turbo in code-specific jobs.

Interesting events

- Hong Kong University replicates R1 results (Jan 25, '25).

  • Huggingface announces huggingface/open-r 1: Fully open recreation of DeepSeek-R1 to reproduce R1, completely open source (Jan 25, '25).
  • OpenAI researcher validates the DeepSeek group separately found and used some core concepts the OpenAI group used on the method to o1

    Liked this post? Join the newsletter.
  • Discussion
  • Designs
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: klaravlj758069/thaimassage-ellwangen#1