commit 45999e5392979c7c28cc9781fcc6cc5389ed61a2 Author: emely11t524013 Date: Tue Feb 11 16:43:05 2025 +0000 Add Understanding DeepSeek R1 diff --git a/Understanding-DeepSeek-R1.md b/Understanding-DeepSeek-R1.md new file mode 100644 index 0000000..aff644b --- /dev/null +++ b/Understanding-DeepSeek-R1.md @@ -0,0 +1,92 @@ +
DeepSeek-R1 is an open-source language model developed on DeepSeek-V3-Base that's been making waves in the [AI](https://qaq.com.au) community. Not only does it match-or even surpass-OpenAI's o1 model in lots of standards, but it also features completely MIT-licensed weights. This marks it as the first non-OpenAI/Google model to deliver strong thinking abilities in an open and available manner.
+
What makes DeepSeek-R1 particularly interesting is its transparency. Unlike the less-open approaches from some market leaders, DeepSeek has released a detailed training [methodology](https://vintagedoorware.com) in their paper. +The design is also remarkably economical, with input tokens [costing simply](https://jijimulembwe.regideso.bi) $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 much better designs required more data and compute. While that's still legitimate, models like o1 and R1 show an alternative: inference-time scaling through thinking.
+
The Essentials
+
The DeepSeek-R1 paper presented several models, however main amongst them were R1 and R1-Zero. Following these are a series of distilled designs that, while fascinating, I won't talk about here.
+
DeepSeek-R1 uses two major concepts:
+
1. A multi-stage pipeline where a little set of cold-start data kickstarts the model, followed by massive RL. +2. Group Relative Policy Optimization (GRPO), a support learning technique that counts on comparing numerous design outputs per timely to avoid the need for a [separate critic](https://www.emip.mg).
+
R1 and R1-Zero are both [reasoning models](https://git.mopsovi.cloud). This basically implies they do Chain-of-Thought before responding to. For the R1 series of designs, this takes type as thinking within a tag, before answering with a last summary.
+
R1-Zero vs R1
+
R1-Zero applies Reinforcement Learning (RL) straight to DeepSeek-V3-Base without any supervised fine-tuning (SFT). RL is used to optimize the model's policy to optimize benefit. +R1-Zero attains excellent precision but in some cases produces confusing outputs, such as mixing numerous languages in a single reaction. R1 repairs that by including minimal monitored fine-tuning and multiple RL passes, which improves both correctness and readability.
+
It is interesting how some [languages](https://www.amherstcommunitychildcare.org) may express certain ideas much better, which leads the model to choose the most expressive language for the job.
+
Training Pipeline
+
The training pipeline that DeepSeek released in the R1 paper is [profoundly](http://arcarchitectservice.co.za) interesting. It showcases how they produced such strong thinking models, and what you can anticipate from each phase. This includes the problems that the resulting models from each stage have, and how they resolved it in the next phase.
+
It's fascinating that their training pipeline varies from the usual:
+
The typical training technique: Pretraining on large dataset (train to predict next word) to get the base design → supervised [fine-tuning](http://cbsver.ru) → choice tuning via RLHF +R1-Zero: Pretrained → RL +R1: Pretrained → Multistage training pipeline with multiple SFT and RL stages
+
Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a few thousand Chain-of-Thought (CoT) samples to make sure the RL procedure has a good starting point. This offers a great design to begin RL. +First RL Stage: Apply GRPO with rule-based rewards to enhance thinking correctness and format (such as forcing chain-of-thought into thinking tags). When they were near merging in the RL process, they transferred to the next step. The outcome of this action is a strong thinking model but with weak general abilities, [bytes-the-dust.com](https://bytes-the-dust.com/index.php/User:GalenHolliday2) e.g., poor format and language blending. +[Rejection Sampling](http://www.tlc.com.pe) + basic information: Create new SFT data through tasting on the RL checkpoint (from action 2), integrated with supervised data from the DeepSeek-V3-Base design. They collected around 600k high-quality reasoning samples. +Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k overall samples (600[k thinking](https://viajesamachupicchuperu.com) + 200k general tasks) for wider abilities. This step resulted in a strong thinking design with general abilities. +Second RL Stage: Add more benefit signals (helpfulness, harmlessness) to improve the last design, in addition to the [thinking benefits](http://git.baige.me). The [outcome](https://smelyanskylaw.com) is DeepSeek-R1. +They likewise did model distillation for several Qwen and Llama designs on the thinking traces to get distilled-R1 designs.
+
Model distillation is a method where you utilize an instructor model to enhance a trainee model by producing training information for the trainee design. +The teacher is generally a larger model than the trainee.
+
Group Relative Policy Optimization (GRPO)
+
The standard idea behind using reinforcement knowing for LLMs is to tweak the model's policy so that it naturally produces more accurate and helpful responses. +They utilized a reward system that inspects not only for accuracy but likewise for appropriate formatting and language consistency, so the model gradually discovers to prefer reactions that fulfill these [quality criteria](https://www.ortho-dietzenbach.de).
+
In this paper, they motivate the R1 design to generate chain-of-thought reasoning through RL training with GRPO. +Rather than adding a separate module at inference time, the training procedure itself nudges the model to produce detailed, detailed outputs-making the chain-of-thought an emerging behavior of the optimized policy.
+
What makes their approach particularly interesting is its [reliance](http://deamoseguros.com.br) on straightforward, rule-based reward functions. +Instead of depending upon costly external designs or human-graded examples as in traditional RLHF, the RL used for R1 uses basic requirements: it may provide a greater benefit if the [response](https://geo-equestrian.co.uk) is correct, if it follows the anticipated/ formatting, and if the language of the answer matches that of the timely. +Not counting on a reward model likewise indicates you do not have to invest time and [effort training](http://www.ksi-italy.com) it, and it does not take memory and calculate away from your [main model](https://www.sharpiesrestauranttn.com).
+
GRPO was presented in the DeepSeekMath paper. Here's how GRPO works:
+
1. For each input timely, the model generates various actions. +2. Each action receives a scalar benefit based on elements like precision, format, and language consistency. +3. [Rewards](http://one-up.net) are [changed relative](https://hlhgraphicdesign.com) to the group's efficiency, basically measuring how much better each action is compared to the others. +4. The design updates its method slightly to prefer reactions with higher [relative](https://humanitarianweb.org) advantages. It just makes minor adjustments-using strategies like clipping and a KL penalty-to make sure the policy does not stray too far from its original habits.
+
A cool aspect of GRPO is its flexibility. You can utilize easy rule-based benefit functions-for instance, granting a bonus when the design properly utilizes the syntax-to guide the training.
+
While DeepSeek utilized GRPO, you might use alternative approaches rather (PPO or PRIME).
+
For those aiming to dive deeper, Will Brown has composed rather a great [execution](https://www.toplinetransport.com.au) of [training](https://giatsofa.net) an LLM with RL using GRPO. GRPO has likewise currently been contributed to the Transformer Reinforcement [Learning](http://doraclean.ro) (TRL) library, which is another good resource. +Finally, Yannic Kilcher has a terrific video [explaining](https://www.wikieduonline.com) GRPO by going through the [DeepSeekMath paper](https://akrs.ae).
+
Is RL on LLMs the course to AGI?
+
As a final note on explaining DeepSeek-R1 and the methodologies they've provided 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 show that RL improves the design's general efficiency by rendering the output distribution more robust, in other words, it appears that the improvement is associated to improving the correct reaction from TopK instead of the improvement of fundamental abilities.
+
Simply put, RL fine-tuning tends to form the output circulation so that the [highest-probability outputs](http://www.ursula-art.net) are most likely to be appropriate, although the general ability (as determined by the variety of proper answers) is mainly present in the pretrained model.
+
This recommends that [support knowing](https://www.alexanderskadberg.no) on LLMs is more about refining and "shaping" the existing distribution of responses instead of endowing the design with completely new abilities. +Consequently, while RL techniques such as PPO and GRPO can produce significant efficiency gains, there appears to be a fundamental ceiling figured out by the underlying design's pretrained understanding.
+
It is uncertain to me how far RL will take us. Perhaps it will be the stepping stone to the next huge turning point. I'm thrilled to see how it unfolds!
+
Running DeepSeek-R1
+
I have actually used DeepSeek-R1 by means of the main chat interface for different issues, which it appears to fix well enough. The extra search performance makes it even nicer to use.
+
Interestingly, o3-mini(-high) was launched as I was writing this post. From my preliminary screening, R1 seems more powerful at math than o3-mini.
+
I likewise leased 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 objective was to see how the design would carry out when deployed on a single H100 GPU-not to thoroughly evaluate the model's capabilities.
+
671B by means of 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 operating on the GPU), running by means of llama.cpp:
+
29 [layers appeared](http://hoveniersbedrijfhansrozeboom.nl) to be the sweet area offered this configuration.
+
Performance:
+
A r/localllama user explained that they had the ability to get over 2 tok/sec with [DeepSeek](http://www.therapywithroxanna.com) R1 671B, without utilizing their GPU on their regional gaming setup. +Digital Spaceport composed a full guide on how to run Deepseek R1 671b completely locally 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 models. Since reasoning designs need to believe before answering, their [time-to-usefulness](http://www.mediationfamilialedromeardeche.fr) is generally greater than other models, however their usefulness is also usually higher. +We need to both maximize usefulness and minimize time-to-usefulness.
+
70B via Ollama
+
70.6 b params, 4-bit KM quantized DeepSeek-R1 running through Ollama:
+
[GPU utilization](https://baytechrentals.com) shoots up here, as anticipated when compared to the mainly CPU-powered run of 671B that I showcased above.
+
Resources
+
DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning +[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models +DeepSeek R1 - Notion (Building a completely local "deep scientist" with DeepSeek-R1 - YouTube). +DeepSeek R1's dish to duplicate o1 and the future of reasoning LMs. +The Illustrated DeepSeek-R1 - by [Jay Alammar](https://kkgem.com). +Explainer: What's R1 & Everything Else? - Tim Kellogg. +DeepSeek R1 Explained to your granny - YouTube
+
DeepSeek
+
- Try R1 at chat.deepseek.com. +GitHub - deepseek-[ai](http://www.picar.gr)/DeepSeek-R 1. +deepseek-[ai](https://viajesamachupicchuperu.com)/Janus-Pro -7 B · Hugging Face (January 2025): [Janus-Pro](https://sbwiki.davnit.net) is a novel autoregressive framework that unifies 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 presents DeepSeek-R1, an open-source thinking design that rivals the efficiency of OpenAI's o1. It provides a detailed methodology for training such designs utilizing large-scale reinforcement learning methods. +DeepSeek-V3 Technical Report (December 2024) This report discusses the application of an FP8 blended accuracy training framework validated on a very massive design, [attaining](https://kidskonvoy.com) both sped up training and minimized GPU [memory usage](http://tent-161.ru). +DeepSeek LLM: Scaling Open-Source Language Models with [Longtermism](https://pleasanthillrealestate.com) (January 2024) This paper looks into scaling laws and presents findings that help with the scaling of [massive designs](https://www.epicskates.com) in open-source configurations. It introduces the DeepSeek LLM job, devoted to advancing open-source [language](https://mikegrant.me) models with a long-term perspective. +DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of [Code Intelligence](http://www.praisedancersrock.com) (January 2024) This research study presents the [DeepSeek-Coder](https://nubiantalk.site) series, a series of [open-source code](http://juliagorban.com) models trained from scratch on 2 trillion tokens. The models are pre-trained on a [high-quality project-level](https://www.dodgeball.org.my) code corpus and employ a fill-in-the-blank job to improve code generation and [infilling](https://www.ugvlog.fr). +DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model (May 2024) This paper presents DeepSeek-V2, a Mixture-of-Experts (MoE) language model characterized by affordable training and efficient reasoning. +DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence (June 2024) This research study introduces DeepSeek-Coder-V2, an [open-source Mixture-of-Experts](http://www.picar.gr) (MoE) code language design that attains performance similar to GPT-4 Turbo in [code-specific jobs](https://47.98.175.161).
+
Interesting occasions
+
- Hong Kong [University reproduces](https://rccgvcwalsall.org.uk) R1 outcomes (Jan 25, '25). +- Huggingface reveals huggingface/open-r 1: Fully open reproduction of DeepSeek-R1 to duplicate R1, completely open source (Jan 25, '25). +- OpenAI researcher confirms the DeepSeek team independently found and used some core ideas the OpenAI team [utilized](https://hygienegegenviren.de) en route to o1
+
Liked this post? Join the newsletter.
\ No newline at end of file