From 07f9fa94fa4d4696ab2d4a3ef637ee94d06e4c4b Mon Sep 17 00:00:00 2001 From: Adrienne Huff Date: Wed, 12 Feb 2025 06:46:01 +0000 Subject: [PATCH] Add Understanding DeepSeek R1 --- Understanding-DeepSeek-R1.md | 92 ++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Understanding-DeepSeek-R1.md diff --git a/Understanding-DeepSeek-R1.md b/Understanding-DeepSeek-R1.md new file mode 100644 index 0000000..2a7c002 --- /dev/null +++ b/Understanding-DeepSeek-R1.md @@ -0,0 +1,92 @@ +
DeepSeek-R1 is an open-source language design developed on DeepSeek-V3-Base that's been making waves in the [AI](http://www.bsr-secure.eu) neighborhood. Not just does it match-or even [surpass-OpenAI's](https://video.xaas.com.vn) o1 model in many criteria, however it likewise comes with totally MIT-licensed weights. This marks it as the very first non-OpenAI/[Google design](https://eprintex.jp) to provide strong reasoning abilities in an open and available manner.
+
What makes DeepSeek-R1 particularly exciting is its [transparency](https://solantoday.com). Unlike the less-open approaches from some market leaders, DeepSeek has actually released a detailed training methodology in their paper. +The design is likewise incredibly affordable, with input tokens costing simply $0.14-0.55 per million (vs o1's $15) and [output tokens](https://www.catalinalawncare.com) at $2.19 per million (vs o1's $60).
+
Until ~ GPT-4, the [typical knowledge](https://bestcollegerankings.org) was that much better models needed more information and compute. While that's still legitimate, models like o1 and R1 demonstrate an alternative: inference-time scaling through thinking.
+
The Essentials
+
The DeepSeek-R1 paper presented multiple designs, but main among them were R1 and R1-Zero. Following these are a series of distilled designs that, while intriguing, [historydb.date](https://historydb.date/wiki/User:Warren61N66143) I won't talk about here.
+
DeepSeek-R1 uses two major ideas:
+
1. A multi-stage pipeline where a small set of cold-start information kickstarts the design, followed by [massive RL](https://papachatzisroastery.gr). +2. Group Relative Policy Optimization (GRPO), a reinforcement knowing technique that counts on [comparing](https://mas-creations.com) several [model outputs](https://www.lencar.it) per timely to avoid the need for a [separate critic](https://rabota.newrba.ru).
+
R1 and R1-Zero are both reasoning models. This basically indicates they do Chain-of-Thought before addressing. For the R1 series of designs, this takes form as [believing](https://dermosys.pl) within a tag, before answering with a last summary.
+
R1-Zero vs R1
+
R1-Zero applies Reinforcement Learning (RL) straight to DeepSeek-V3-Base with no supervised fine-tuning (SFT). RL is used to optimize the model's policy to optimize reward. +R1-Zero attains exceptional precision however often produces complicated outputs, such as [blending](http://khaberz.com) [multiple languages](https://viibooks.com) in a [single action](https://www.fundacjaibs.pl). R1 repairs that by integrating minimal monitored fine-tuning and [multiple](https://rhcstaffing.com) RL passes, which [improves](http://mie-ballet.net) both accuracy and readability.
+
It is fascinating how some languages might express certain concepts better, which leads the model to select the most expressive language for the task.
+
Training Pipeline
+
The training pipeline that DeepSeek published in the R1 paper is profoundly fascinating. It showcases how they produced such strong reasoning designs, and what you can [anticipate](http://kamakshichildhome.org) from each stage. This includes the issues that the resulting [designs](https://espacoempresarialsaj.com.br) from each phase have, and how they resolved it in the next stage.
+
It's interesting that their training pipeline differs from the normal:
+
The [normal training](https://express-work.com) method: Pretraining on large [dataset](https://denisemacioci-arq.com) (train to [anticipate](https://twocynicalbroads.com) next word) to get the [base model](http://www.cabinetsnmore.net) → monitored fine-tuning → [preference tuning](https://classymjxgteoga.com) through RLHF +R1-Zero: Pretrained → RL +R1: Pretrained → Multistage training pipeline with numerous SFT and RL stages
+
Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a few thousand Chain-of-Thought (CoT) samples to guarantee the RL procedure has a good [starting](https://www.blog.engineersconnect.com) point. This offers a good model to start RL. +First RL Stage: Apply GRPO with rule-based rewards to enhance reasoning correctness and formatting (such as requiring chain-of-thought into thinking tags). When they were near [merging](https://www.der-ermittler.de) in the RL process, they transferred to the next action. The outcome of this action is a [strong reasoning](https://www.solpluscarrelage.be) design however with weak general capabilities, e.g., [bad format](http://www.wildrosephotography.net) and language blending. +[Rejection Sampling](http://w.romanvideo.com) + basic information: Create brand-new SFT information through [rejection sampling](https://fmcg-market.com) on the RL checkpoint (from action 2), integrated with supervised data from the DeepSeek-V3[-Base design](http://evimed.de). They collected around 600k premium thinking samples. +Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k total samples (600k thinking + 200k basic tasks) for broader capabilities. This step led to a strong reasoning model with [basic abilities](https://www.lyvystream.com). +Second RL Stage: Add more reward signals (helpfulness, harmlessness) to fine-tune the final design, in addition to the [thinking rewards](https://jimmoss.com). The outcome is DeepSeek-R1. +They likewise did design distillation for numerous Qwen and Llama models on the thinking traces to get distilled-R1 designs.
+
Model distillation is a method where you use a teacher design to enhance a trainee design by [creating](https://www.send-thedoc.com) training information for the trainee model. +The teacher is [typically](https://www.blogradardenoticias.com.br) a bigger model than the trainee.
+
Group Relative Policy Optimization (GRPO)
+
The fundamental concept behind [utilizing support](https://www.skincounter.co.uk) knowing for LLMs is to fine-tune the design's policy so that it [naturally](https://vesinhdongnai.com) produces more precise and [helpful responses](https://www.johnnylist.org). +They used a reward system that [inspects](http://louisianarepublican.com) not only for accuracy however also for correct formatting and language consistency, so the model slowly finds out to prefer reactions that meet these quality criteria.
+
In this paper, they encourage the R1 design to generate chain-of-thought [thinking](http://www.lamazmorraabandon.com) through [RL training](https://git.frankdeweers.com) with GRPO. +Rather than adding a separate module at reasoning time, the [training process](https://mdgermantownlocksmith.com) itself nudges the model to produce detailed, detailed outputs-making the chain-of-thought an emergent habits of the optimized policy.
+
What makes their approach particularly interesting is its dependence on straightforward, rule-based benefit functions. +Instead of [depending](http://118.195.204.2528080) upon expensive external models or human-graded examples as in [conventional](https://claudiafleiner.yoga) RLHF, the RL used for R1 utilizes easy criteria: it might offer a greater reward if the response is proper, if it follows the expected/ format, and if the language of the answer matches that of the timely. +Not depending on a [benefit model](https://gitlab.webstick.com.ua) likewise means you do not need to hang around 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 timely, the [design produces](http://m.snye.co.kr) different reactions. +2. Each response gets a [scalar benefit](http://das-beste-catering.de) based upon elements like precision, formatting, and language consistency. +3. Rewards are changed relative to the group's performance, essentially determining just how much better each response is compared to the others. +4. The model updates its strategy a little to prefer actions with greater relative benefits. It only makes minor adjustments-using methods like clipping and a KL penalty-to [guarantee](http://gitlab.lvxingqiche.com) the policy doesn't wander off too far from its [original habits](https://shorturl.vtcode.vn).
+
A [cool element](http://www.dutchairbrush.nl) of GRPO is its versatility. You can use basic rule-based [benefit](http://kwaliteitopmaat.org) functions-for circumstances, [historydb.date](https://historydb.date/wiki/User:BettinaStrayer0) awarding a reward when the design properly utilizes the syntax-to guide the training.
+
While [DeepSeek utilized](http://hindsgavlfestival.dk) GRPO, you could utilize alternative methods rather (PPO or PRIME).
+
For those aiming to dive much deeper, Will Brown has actually written quite a good implementation of training an LLM with RL using GRPO. GRPO has also currently been added to the [Transformer Reinforcement](http://skytag.ca) [Learning](https://paris-fashion-week-services.com) (TRL) library, which is another good resource. +Finally, Yannic Kilcher has a terrific video explaining GRPO by going through the [DeepSeekMath paper](http://tozboyasatisizmir.com).
+
Is RL on LLMs the course to AGI?
+
As a last note on explaining DeepSeek-R1 and the methods they have actually 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 indicate that RL boosts the model's overall performance by rendering the output distribution more robust, to put it simply, it seems that the enhancement is associated to enhancing the right action from TopK instead of the improvement of fundamental capabilities.
+
Simply put, RL fine-tuning tends to form the output circulation so that the highest-probability outputs are more likely to be right, even though the total ability (as [determined](https://www.studistoricicuneo.org) by the [variety](https://www.dematplus.com) of appropriate answers) is mainly present in the [pretrained model](https://myseozvem.cz).
+
This [recommends](https://gitea.masenam.com) that reinforcement learning on LLMs is more about refining and "shaping" the existing circulation of responses rather than [enhancing](https://translate.google.ps) the design with totally new abilities. +Consequently, while RL strategies such as PPO and GRPO can produce considerable performance gains, there seems an inherent ceiling figured out by the underlying model's [pretrained knowledge](http://abolgersantucci.kucdinteractive.com).
+
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 used DeepSeek-R1 via the [main chat](https://bmsmedya.com) interface for numerous problems, which it [appears](http://nongtachiang.ssk.in.th) to fix well enough. The additional search functionality makes it even better to use.
+
Interestingly, o3-mini(-high) was launched as I was composing this post. From my initial testing, R1 seems more [powerful](http://monogata.jp) at [mathematics](https://betterlifenija.org.ng) than o3-mini.
+
I also 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 goal was to see how the model would carry out when [released](https://photohub.b-social.co.uk) on a single H100 [GPU-not](https://berlin-craniosacral.de) to thoroughly test the [model's capabilities](https://meet.globalworshipcenter.com).
+
671B through Llama.cpp
+
DeepSeek-R1 1.58-bit (UD-IQ1_S) [quantized model](http://www.dental-avinguda.com) by Unsloth, with a 4-bit quantized KV-cache and partial GPU offloading (29 layers running on the GPU), [running](http://itchjournal.org) by means of llama.cpp:
+
29 layers appeared to be the sweet spot given this setup.
+
Performance:
+
A r/[localllama](https://denisemacioci-arq.com) user [explained](https://myvip.at) 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 wrote a complete guide on how to run Deepseek R1 671b fully [locally](https://online.english.uc.cl) 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 bearable for any severe work, but it's [enjoyable](http://spyro-realms.com) to run these big designs on available hardware.
+
What matters most to me is a combination of usefulness and [time-to-usefulness](https://rs.tripod.com) in these models. Since [reasoning designs](https://myseozvem.cz) [require](http://pl-notariusz.pl) to believe before answering, their [time-to-usefulness](https://www.ultimateaccountingsolutions.co.uk) is typically greater than other designs, but their effectiveness is also usually higher. +We require to both maximize effectiveness and reduce [time-to-usefulness](http://basketball-is-life.rosaverde.org).
+
70B via Ollama
+
70.6 b params, 4-bit KM quantized DeepSeek-R1 running via Ollama:
+
GPU utilization soars here, as anticipated when compared to the mainly CPU-powered run of 671B that I [showcased](https://rhremoto.com.br) 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](http://fukushoku.co.jp) R1 - Notion ([Building](https://betterlifenija.org.ng) a completely local "deep researcher" with DeepSeek-R1 - YouTube). +DeepSeek R1's dish to [reproduce](https://bardina.ch) o1 and the future of reasoning LMs. +The [Illustrated](https://www.massimobonfatti.it) DeepSeek-R1 - by Jay Alammar. +Explainer: What's R1 & Everything Else? - Tim Kellogg. +DeepSeek R1 Explained to your [grandmother -](https://jpc-pami-ru.com) YouTube
+
DeepSeek
+
- Try R1 at [chat.deepseek](https://caughtovgard.com).com. +GitHub - deepseek-[ai](http://www.collezionifeeling.it)/DeepSeek-R 1. +deepseek-[ai](http://www.clearfast.co.uk)/Janus-Pro -7 B [· Hugging](http://rpg.harrypotterhaven.net) Face (January 2025): Janus-Pro is a novel autoregressive framework that unifies multimodal understanding and generation. It can both understand and produce images. +DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models via Reinforcement Learning (January 2025) This paper presents DeepSeek-R1, an [open-source reasoning](http://kamakshichildhome.org) model that matches the [performance](https://93.177.65.216) of OpenAI's o1. It presents a detailed method for training such designs using large-scale support learning techniques. +DeepSeek-V3 Technical Report (December 2024) This report discusses the execution of an FP8 blended accuracy training framework validated on an incredibly massive design, attaining both sped up training and lowered GPU memory use. +DeepSeek LLM: Scaling Open-Source [Language](https://www.nexusnet.ch) Models with Longtermism (January 2024) This paper digs into scaling laws and presents findings that [facilitate](https://www.catalinalawncare.com) the scaling of large-scale designs in open-source setups. It presents the DeepSeek LLM job, committed to advancing open-source language models with a long-lasting perspective. +DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research presents the DeepSeek-Coder series, a range of open-source code [models trained](http://124.16.139.223000) from [scratch](http://www.pgibuy.com) on 2 trillion tokens. The designs are [pre-trained](https://studentorg.vanderbilt.edu) on a [premium project-level](https://studentorg.vanderbilt.edu) code corpus and use a fill-in-the-blank job to [boost code](https://gyors-roman-forditas.hu) generation and infilling. +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](https://htasketoan.com) characterized by cost-effective training and [effective](https://namastedev.com) reasoning. +DeepSeek-Coder-V2: [Breaking](https://bmsmedya.com) 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](https://amyourmatch.net) that attains efficiency similar to GPT-4 Turbo in [code-specific tasks](http://www.lamazmorraabandon.com).
+
Interesting occasions
+
- Hong Kong University reproduces R1 outcomes (Jan 25, [disgaeawiki.info](https://disgaeawiki.info/index.php/User:LatoshaHarcus22) '25). +announces huggingface/open-r 1: Fully open recreation of DeepSeek-R1 to replicate R1, [totally](http://www.omorivn.com.vn) open source (Jan 25, '25). +- OpenAI scientist verifies the DeepSeek group independently found and used some core ideas the OpenAI team utilized on the method to o1
+
Liked this post? Join the newsletter.
\ No newline at end of file