Add Understanding DeepSeek R1
commit
9417d06953
92
Understanding-DeepSeek-R1.md
Normal file
92
Understanding-DeepSeek-R1.md
Normal file
@ -0,0 +1,92 @@
|
||||
<br>DeepSeek-R1 is an open-source language model built on DeepSeek-V3-Base that's been making waves in the [AI](https://theabsolutebestacademy.com) [community](https://cadpower.iitcsolution.com). Not just does it match-or even o1 design in numerous benchmarks, however it likewise [features totally](https://guardiandoors.net) MIT-licensed [weights](http://sportsgradation.rops.co.jp). This marks it as the very first non-OpenAI/Google design to deliver strong reasoning abilities in an open and available manner.<br>
|
||||
<br>What makes DeepSeek-R1 particularly exciting is its openness. Unlike the [less-open techniques](http://asterisk-e.com) from some market leaders, DeepSeek has released a [detailed training](http://proklidnejsimysl.cz) method in their paper.
|
||||
The model 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).<br>
|
||||
<br>Until ~ GPT-4, the typical knowledge was that better models needed more information and calculate. While that's still legitimate, [archmageriseswiki.com](http://archmageriseswiki.com/index.php/User:KarissaGleason) designs like o1 and R1 show an alternative: inference-time scaling through thinking.<br>
|
||||
<br>The Essentials<br>
|
||||
<br>The DeepSeek-R1 paper provided multiple models, however main amongst them were R1 and R1-Zero. Following these are a series of distilled designs that, while intriguing, I will not go over here.<br>
|
||||
<br>DeepSeek-R1 uses 2 major ideas:<br>
|
||||
<br>1. A multi-stage pipeline where a little set of cold-start data kickstarts the design, followed by large-scale RL.
|
||||
2. Group Relative Policy Optimization (GRPO), a [reinforcement knowing](https://findmynext.webconvoy.com) approach that relies on comparing numerous model outputs per timely to avoid the requirement for a separate critic.<br>
|
||||
<br>R1 and R1-Zero are both reasoning designs. This essentially suggests they do Chain-of-Thought before [answering](http://154.64.253.773000). For the R1 series of models, this takes type as [thinking](http://epsontario.com) within a tag, before addressing with a final summary.<br>
|
||||
<br>R1-Zero vs R1<br>
|
||||
<br>R1-Zero applies [Reinforcement](https://www.michaelgailliothomes.com) Learning (RL) [straight](http://roymase.date) to DeepSeek-V3-Base with no supervised fine-tuning (SFT). RL is used to [enhance](http://pangclick.com) the design's policy to optimize reward.
|
||||
R1-Zero attains exceptional accuracy but sometimes produces complicated outputs, such as blending numerous languages in a single action. R1 repairs that by integrating restricted [supervised](https://yaseen.tv) fine-tuning and [shiapedia.1god.org](https://shiapedia.1god.org/index.php/User:HildegardeMcclar) numerous RL passes, which improves both [correctness](http://yolinsaat.com) and readability.<br>
|
||||
<br>It is fascinating how some languages might express certain [concepts](https://gutachter-fast.de) much better, which leads the model to pick the most expressive language for the task.<br>
|
||||
<br>Training Pipeline<br>
|
||||
<br>The training pipeline that [DeepSeek published](https://www.ngvw.nl) in the R1 paper is [exceptionally intriguing](https://binnenhofadvies.nl). It showcases how they [produced](http://git.permaviat.ru) such strong thinking models, and what you can get out of each phase. This includes the problems that the resulting designs from each phase have, and how they solved it in the next phase.<br>
|
||||
<br>It's interesting that their training pipeline varies from the typical:<br>
|
||||
<br>The typical training strategy: Pretraining on big dataset (train to predict next word) to get the base design → supervised fine-tuning → preference tuning via RLHF
|
||||
R1-Zero: Pretrained → RL
|
||||
R1: Pretrained → Multistage training pipeline with [multiple SFT](https://djceokat.com) and RL phases<br>
|
||||
<br>Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a couple of thousand Chain-of-Thought (CoT) samples to make sure the [RL process](https://dm-dentaltechnik.de) has a good beginning point. This offers an [excellent design](http://southklad.ru) to begin RL.
|
||||
First RL Stage: [Apply GRPO](https://natursteine-hirneise.de) with rule-based benefits to improve thinking accuracy and formatting (such as forcing chain-of-thought into thinking tags). When they were near convergence in the RL process, [gratisafhalen.be](https://gratisafhalen.be/author/jacelynh934/) they transferred to the next action. The result of this step is a strong thinking design however with weak basic abilities, e.g., bad format and language blending.
|
||||
[Rejection Sampling](http://www.colibriinn.com) + basic information: Create brand-new SFT data through rejection sampling on the RL checkpoint (from step 2), combined with monitored information from the DeepSeek-V3-Base model. They gathered around 600k top quality reasoning samples.
|
||||
Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k total samples (600k reasoning + 200k basic tasks) for [broader](http://6staragli.com) [capabilities](http://blog.slade.kent.sch.uk). This action resulted in a strong thinking model with general [capabilities](https://www.elvisgrandicmd.com).
|
||||
Second RL Stage: Add more reward signals (helpfulness, harmlessness) to improve the last design, in addition to the reasoning benefits. The result is DeepSeek-R1.
|
||||
They likewise did design distillation for [online-learning-initiative.org](https://online-learning-initiative.org/wiki/index.php/User:MelbaHeckman) several Qwen and [Llama models](https://www.trueposter.com) on the [thinking](https://workforceselection.eu) traces to get distilled-R1 models.<br>
|
||||
<br>Model distillation is a technique where you use an instructor design to enhance a trainee design by producing training data for the trainee model.
|
||||
The instructor is typically a larger design than the [trainee](https://aalishangroup.com).<br>
|
||||
<br>Group [Relative Policy](https://www.codingate.com) Optimization (GRPO)<br>
|
||||
<br>The basic idea behind using [reinforcement](https://gitea.oo.co.rs) learning for LLMs is to fine-tune the model's policy so that it naturally produces more precise and helpful answers.
|
||||
They utilized a [benefit](http://www.errayhaneclinic.com) system that checks not just for accuracy but also for correct formatting and language consistency, so the design slowly discovers to favor actions that meet these quality criteria.<br>
|
||||
<br>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 emergent habits of the optimized policy.<br>
|
||||
<br>What makes their method particularly intriguing is its reliance on straightforward, rule-based reward functions.
|
||||
Instead of depending on pricey external models or human-graded examples as in traditional RLHF, the [RL utilized](https://nhumoto.com) for R1 uses simple requirements: it may offer a greater benefit if the answer is right, if it follows the expected/ format, and if the language of the answer matches that of the prompt.
|
||||
Not relying on a benefit model likewise suggests you don't have to spend time and [effort training](https://story119.com) it, and it doesn't take memory and [calculate](https://git.j.co.ua) far from your main design.<br>
|
||||
<br>GRPO was presented in the DeepSeekMath paper. Here's how GRPO works:<br>
|
||||
<br>1. For each input prompt, the design generates various responses.
|
||||
2. Each response receives a scalar benefit based upon elements like accuracy, format, and [language consistency](https://panperu.pe).
|
||||
3. Rewards are changed relative to the group's performance, basically determining how much better each response is compared to the others.
|
||||
4. The design updates its method a little to favor reactions with higher relative advantages. It just makes small [adjustments-using methods](https://vigilanciaysalud.org) like clipping and a KL penalty-to make sure the policy doesn't wander off too far from its original habits.<br>
|
||||
<br>A cool element of GRPO is its flexibility. You can use basic rule-based reward functions-for circumstances, granting a perk when the design properly uses the syntax-to guide the training.<br>
|
||||
<br>While DeepSeek utilized GRPO, you could use alternative methods instead (PPO or PRIME).<br>
|
||||
<br>For those aiming to dive much deeper, Will Brown has composed quite a nice execution of training an LLM with RL using GRPO. GRPO has also currently been contributed to the Transformer Reinforcement [Learning](https://www.diy-ausstellung.de) (TRL) library, which is another excellent resource.
|
||||
Finally, Yannic Kilcher has a great [video explaining](https://www.schoepamedien.de) GRPO by going through the DeepSeekMath paper.<br>
|
||||
<br>Is RL on LLMs the course to AGI?<br>
|
||||
<br>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.<br>
|
||||
<br>These findings indicate that RL enhances the model's overall performance by [rendering](https://wd3.berlin) the output distribution more robust, in other words, it seems that the enhancement is credited to enhancing the right response from TopK instead of the enhancement of essential capabilities.<br>
|
||||
<br>In other words, [RL fine-tuning](http://podtrac.com) tends to shape the output circulation so that the highest-probability outputs are more most likely to be appropriate, although the overall capability (as determined by the diversity of right answers) is mainly present in the pretrained design.<br>
|
||||
<br>This recommends that support learning on LLMs is more about refining and "forming" the existing circulation of reactions rather than enhancing the design with totally new abilities.
|
||||
Consequently, while RL techniques such as PPO and GRPO can produce substantial efficiency gains, there seems a fundamental ceiling figured out by the [underlying design's](https://yak-nation.com) [pretrained understanding](https://nomoretax.pl).<br>
|
||||
<br>It is uncertain to me how far RL will take us. Perhaps it will be the [stepping stone](http://reinforcedconcrete.org.ua) to the next huge turning point. I'm delighted to see how it unfolds!<br>
|
||||
<br>Running DeepSeek-R1<br>
|
||||
<br>I've utilized DeepSeek-R1 through the main chat interface for various issues, which it appears to resolve well enough. The additional search performance makes it even better to utilize.<br>
|
||||
<br>Interestingly, o3-mini(-high) was launched as I was writing this post. From my initial screening, R1 appears stronger at mathematics than o3-mini.<br>
|
||||
<br>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](https://ptrevival.com).
|
||||
The [main objective](http://nomadnesthousing.com) was to see how the model would carry out when [deployed](https://ngoma.app) on a single H100 GPU-not to extensively evaluate the model's abilities.<br>
|
||||
<br>671B through Llama.cpp<br>
|
||||
<br>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 running](http://lain.heavy.jp) on the GPU), running by means of llama.cpp:<br>
|
||||
<br>29 layers seemed to be the sweet spot given this setup.<br>
|
||||
<br>Performance:<br>
|
||||
<br>A r/localllama user explained that they were able to get over 2 tok/sec with [DeepSeek](https://amelonline.fr) R1 671B, without [utilizing](http://www.eurotex.rs) their GPU on their regional gaming setup.
|
||||
Digital Spaceport composed a full guide on how to run Deepseek R1 671b fully locally on a $2000 EPYC server, on which you can get ~ 4.25 to 3.5 tokens per second. <br>
|
||||
<br>As you can see, the tokens/s isn't quite manageable for any severe work, however it's fun to run these large designs on available hardware.<br>
|
||||
<br>What [matters](https://3milsoles.com) most to me is a mix of usefulness and time-to-usefulness in these designs. Since [thinking designs](http://bedfordfalls.live) need to believe before responding to, their time-to-usefulness is typically higher than other designs, but their usefulness is likewise normally greater.
|
||||
We require to both maximize usefulness and [decrease time-to-usefulness](https://aliancasrei.com).<br>
|
||||
<br>70B by means of Ollama<br>
|
||||
<br>70.6 b params, 4-bit KM quantized DeepSeek-R1 running through Ollama:<br>
|
||||
<br>GPU utilization shoots up here, as [expected](https://pousadashamballah.com.br) when [compared](https://www.elektrotechnik-weiterbildungen.de) to the mainly CPU-powered run of 671B that I showcased above.<br>
|
||||
<br>Resources<br>
|
||||
<br>DeepSeek-R1: [Incentivizing Reasoning](https://manhwarecaps.com) 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 regional "deep researcher" with DeepSeek-R1 - YouTube).
|
||||
DeepSeek R1's recipe to reproduce 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 grandmother - YouTube<br>
|
||||
<br>DeepSeek<br>
|
||||
<br>- Try R1 at chat.deepseek.com.
|
||||
GitHub - deepseek-[ai](http://123.60.97.161:32768)/[DeepSeek-R](http://astral-pro.com) 1.
|
||||
deepseek-[ai](https://www.divino-tesoro.com)/[Janus-Pro](https://cphallconstlts.com) -7 B · Hugging Face (January 2025): Janus-Pro is a novel autoregressive framework that merges multimodal understanding and [generation](http://www.brixiabasket.com). It can both comprehend and produce images.
|
||||
DeepSeek-R1: Incentivizing Reasoning Capability in Large [Language Models](https://staffigo.com) through Reinforcement Learning (January 2025) This paper [introduces](http://totalcourage.org) DeepSeek-R1, an [open-source](http://garudauav.com) [reasoning design](https://www.capitalfund-hk.com) that matches the performance of OpenAI's o1. It provides a detailed methodology for [utahsyardsale.com](https://utahsyardsale.com/author/ardentonga4/) training such designs utilizing large-scale reinforcement knowing techniques.
|
||||
DeepSeek-V3 Technical Report (December 2024) This report talks about the application of an FP8 blended precision training structure confirmed on an exceptionally large-scale model, attaining both accelerated training and minimized GPU memory usage.
|
||||
DeepSeek LLM: [links.gtanet.com.br](https://links.gtanet.com.br/roymckelvey) Scaling Open-Source Language Models with Longtermism (January 2024) This paper explores scaling laws and provides findings that assist in the scaling of large-scale designs in open-source configurations. It introduces the DeepSeek LLM job, devoted to advancing open-source language designs with a long-lasting perspective.
|
||||
DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research introduces the DeepSeek-Coder series, a variety of open-source code [designs trained](http://okbestgood.com3000) from scratch on 2 trillion tokens. The [designs](http://bbs.yongrenqianyou.com) are pre-trained on a premium project-level code corpus and use a fill-in-the-blank task to improve code 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](https://hafrikplay.com) (MoE) language model characterized by affordable training and [efficient reasoning](http://www.blogyssee.de).
|
||||
DeepSeek-Coder-V2: Breaking the [Barrier](https://www.conexiontecnologica.com.do) of Closed-Source Models in Code Intelligence (June 2024) This research introduces DeepSeek-Coder-V2, an [open-source Mixture-of-Experts](https://chat.app8station.com) (MoE) [code language](https://www.iconversionmedia.com) model that attains performance [equivalent](https://infoempresaconsultores.com) to GPT-4 Turbo in [code-specific jobs](https://benjiweatherley.com).<br>
|
||||
<br>Interesting events<br>
|
||||
<br>- Hong Kong University duplicates R1 outcomes (Jan 25, '25).
|
||||
- Huggingface reveals huggingface/open-r 1: Fully open [recreation](https://www.bottlerocketdesign.com) of DeepSeek-R1 to replicate R1, totally open source (Jan 25, '25).
|
||||
- OpenAI scientist validates the DeepSeek team individually discovered and utilized some core ideas the OpenAI team used en route to o1<br>
|
||||
<br>Liked this post? Join the [newsletter](https://www.afxstudio.fr).<br>
|
Loading…
Reference in New Issue
Block a user