Add Understanding DeepSeek R1
parent
6e9a2ee4f2
commit
e2bab1e2ec
|
@ -0,0 +1,92 @@
|
||||||
|
<br>DeepSeek-R1 is an [open-source language](https://holanews.com) design [developed](https://www.editiobooks.com) on DeepSeek-V3-Base that's been making waves in the [AI](http://etvideosondemand.com) community. Not just does it match-or even surpass-OpenAI's o1 model in numerous criteria, but it also includes totally MIT-licensed weights. This marks it as the very first non-OpenAI/Google model to deliver strong thinking abilities in an open and available way.<br>
|
||||||
|
<br>What makes DeepSeek-R1 especially amazing is its [openness](https://sndesignremodeling.com). Unlike the less-open approaches from some industry leaders, DeepSeek has published a detailed training methodology in their paper.
|
||||||
|
The design is also incredibly cost-effective, with input tokens [costing simply](http://amycherryphoto.com) $0.14-0.55 per million (vs o1's $15) and [output tokens](http://frautest.ru) at $2.19 per million (vs o1's $60).<br>
|
||||||
|
<br>Until ~ GPT-4, the common knowledge was that better models needed more information and [calculate](http://greenpro.co.kr). While that's still legitimate, models like o1 and R1 show an option: inference-time scaling through [reasoning](https://msolsint.com).<br>
|
||||||
|
<br>The Essentials<br>
|
||||||
|
<br>The DeepSeek-R1 paper presented several models, but main amongst them were R1 and R1-Zero. Following these are a series of distilled designs that, while intriguing, I will not discuss here.<br>
|
||||||
|
<br>DeepSeek-R1 uses 2 major ideas:<br>
|
||||||
|
<br>1. A [multi-stage pipeline](https://xn--den1hjlp-o0a.dk) where a little set of [cold-start](https://journalpremiereedition.com) [data kickstarts](https://vapers.guru) the design, followed by massive RL.
|
||||||
|
2. Group Relative Policy Optimization (GRPO), a support [knowing approach](https://bents-byg.dk) that relies on comparing several [design outputs](https://psychomatrix.in) per prompt to avoid the need for a [separate critic](https://es.iainponorogo.ac.id).<br>
|
||||||
|
<br>R1 and R1-Zero are both thinking models. This [basically suggests](https://www.fostercitydental.com) they do Chain-of-Thought before addressing. For the R1 series of models, this takes type as believing within a tag, before responding to with a last [summary](http://inplaza.com).<br>
|
||||||
|
<br>R1-Zero vs R1<br>
|
||||||
|
<br>R1-Zero uses Reinforcement Learning (RL) [straight](http://check-360.de) to DeepSeek-V3-Base with no supervised fine-tuning (SFT). RL is utilized to [optimize](https://git.silasvedder.xyz) the model's policy to [optimize](https://organicdevelopers.net) [benefit](https://www.solorioacademy.org).
|
||||||
|
R1-Zero attains [excellent accuracy](https://lms.digi4equality.eu) however in some cases produces [complicated](https://www.sgi-atlanta.org) outputs, such as blending numerous languages in a single reaction. R1 [repairs](http://wiki.die-karte-bitte.de) that by incorporating limited [monitored fine-tuning](https://cucinaemotori.it) and [pl.velo.wiki](https://pl.velo.wiki/index.php?title=U%C5%BCytkownik:ChristiKrb) several RL passes, which enhances both accuracy and readability.<br>
|
||||||
|
<br>It is interesting how some languages may reveal certain concepts much better, which leads the design to pick the most [expressive language](http://jib-co.ir) for the task.<br>
|
||||||
|
<br>Training Pipeline<br>
|
||||||
|
<br>The training pipeline that [DeepSeek published](http://kt-av.uk) in the R1 paper is exceptionally fascinating. It showcases how they developed such strong reasoning models, and what you can expect from each phase. This includes the problems that the resulting [designs](https://playidy.com) from each stage have, and how they fixed it in the next phase.<br>
|
||||||
|
<br>It's interesting that their training pipeline differs from the usual:<br>
|
||||||
|
<br>The normal training method: [pl.velo.wiki](https://pl.velo.wiki/index.php?title=U%C5%BCytkownik:Rosalina53Q) Pretraining on big dataset (train to forecast next word) to get the base model → [supervised](https://www.fernandodelaguia.com) fine-tuning → [preference tuning](http://lesstagiaires.com) via RLHF
|
||||||
|
R1-Zero: Pretrained → RL
|
||||||
|
R1: Pretrained → Multistage training pipeline with numerous SFT and RL phases<br>
|
||||||
|
<br>[Cold-Start](http://git.suxiniot.com) Fine-Tuning: [Fine-tune](http://bikeforbooks.biketravellers.com) DeepSeek-V3-Base on a few thousand Chain-of-Thought (CoT) samples to make sure the RL procedure has a good beginning point. This provides a great model to start RL.
|
||||||
|
First RL Stage: Apply GRPO with rule-based rewards to improve thinking correctness and format (such as forcing chain-of-thought into thinking tags). When they were near [merging](http://hayleyandphilip.wedding) in the RL procedure, they [transferred](http://bangtaodive.com) to the next step. The result of this action is a strong reasoning model but with weak basic abilities, e.g., poor formatting and [language mixing](https://www.fei-nha.com).
|
||||||
|
Rejection Sampling + general data: Create new SFT information through rejection sampling on the RL checkpoint (from step 2), [integrated](https://desipsychologists.co.za) with supervised information from the DeepSeek-V3[-Base model](https://infosort.ru). They [gathered](https://trans-comm-group.com) around 600k top quality thinking samples.
|
||||||
|
Second Fine-Tuning: [Fine-tune](https://healthnet-project.eu) DeepSeek-V3-Base again on 800k overall samples (600[k thinking](https://www.jbizmedia.com) + 200k basic jobs) for more [comprehensive abilities](https://www.luisdorosario.com). This step resulted in a strong reasoning model with basic abilities.
|
||||||
|
Second RL Stage: Add more reward signals (helpfulness, [forum.altaycoins.com](http://forum.altaycoins.com/profile.php?id=1063192) harmlessness) to refine the last design, in addition to the reasoning rewards. The outcome is DeepSeek-R1.
|
||||||
|
They also did design distillation for a number of Qwen and Llama designs on the reasoning traces to get distilled-R1 models.<br>
|
||||||
|
<br>[Model distillation](http://vrptv.com) is a method where you use a [teacher design](https://es.iainponorogo.ac.id) to [enhance](https://fashionandtravelreporter.com) a [trainee model](https://petermunro.nz) by generating [training](https://belclarefarm.com) information for the [trainee design](https://mara-open.de).
|
||||||
|
The teacher is normally a bigger model than the trainee.<br>
|
||||||
|
<br>Group Relative Policy Optimization (GRPO)<br>
|
||||||
|
<br>The basic concept behind [utilizing support](https://infologistics.nl) knowing for LLMs is to tweak the [model's policy](https://ready4hr.com) so that it naturally produces more accurate and beneficial responses.
|
||||||
|
They used a reward system that checks not only for correctness however also for correct formatting and [language](https://xn--archivtne-67a.de) consistency, so the [model gradually](https://www.drillionnet.com) learns to favor responses that fulfill these quality criteria.<br>
|
||||||
|
<br>In this paper, they motivate the R1 model to generate chain-of-thought reasoning through [RL training](http://www.gaeulstudio.com) with GRPO.
|
||||||
|
Rather than [including](http://proviprlek.si) a separate module at [reasoning](https://blacknwhite6.com) time, the [training process](https://kandacewithak.com) itself nudges the design to produce detailed, detailed outputs-making the chain-of-thought an [emergent behavior](http://icofprogram.org) of the [optimized](https://www.wearemodel.com) policy.<br>
|
||||||
|
<br>What makes their method particularly intriguing is its [reliance](https://creativewindows.com) on straightforward, rule-based benefit functions.
|
||||||
|
Instead of depending upon costly external designs or human-graded examples as in conventional RLHF, the RL used for R1 uses simple criteria: it might provide a greater benefit if the [response](http://smartsportsliving.at) is appropriate, [wiki.snooze-hotelsoftware.de](https://wiki.snooze-hotelsoftware.de/index.php?title=Benutzer:PhillippNugent) if it follows the anticipated/ format, and if the language of the answer [matches](http://24.198.181.1343002) that of the timely.
|
||||||
|
Not counting on a [reward model](https://fcbc.jp) also [suggests](http://yagascafe.com) you do not have to hang out and [effort training](http://volkov-urologist.ru) it, and it does not take memory and calculate away from your main design.<br>
|
||||||
|
<br>GRPO was introduced in the [DeepSeekMath paper](https://siro-krom.hu). Here's how GRPO works:<br>
|
||||||
|
<br>1. For each input timely, the [design generates](https://trans-comm-group.com) various [actions](https://raduta.dp.ua).
|
||||||
|
2. Each action [receives](http://dating.instaawork.com) a [scalar benefit](http://www.roxaneduraffourg.com) based upon [aspects](http://dating.instaawork.com) like precision, format, and language consistency.
|
||||||
|
3. [Rewards](https://www.bongmedia.tv) are changed relative to the [group's](https://xn--114-2k0oi50d.com) performance, [basically](https://www.iconversionmedia.com) determining just how much better each reaction is compared to the others.
|
||||||
|
4. The model updates its method a little to favor actions with greater [relative advantages](http://git.zhiweisz.cn3000). 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 initial behavior.<br>
|
||||||
|
<br>A cool [element](https://telegra.ph) of GRPO is its versatility. You can utilize basic [rule-based](http://blog.psicologoelsopini.com.br) reward functions-for instance, awarding a bonus when the [design correctly](http://cheneyappraisalservices.com) [utilizes](https://www.blythefamily.me) the syntax-to guide the training.<br>
|
||||||
|
<br>While [DeepSeek](https://solutionforcleanair.com) used GRPO, you might utilize alternative [methods](https://geniusactionblueprint.com) instead (PPO or PRIME).<br>
|
||||||
|
<br>For those aiming to dive deeper, Will Brown has actually composed quite a good implementation of training an LLM with RL utilizing GRPO. GRPO has actually also already been contributed to the [Transformer Reinforcement](http://kellysample.site) Learning (TRL) library, which is another good resource.
|
||||||
|
Finally, Yannic Kilcher has a fantastic video explaining GRPO by going through the [DeepSeekMath paper](https://www.photogallery1997.it).<br>
|
||||||
|
<br>Is RL on LLMs the path to AGI?<br>
|
||||||
|
<br>As a last note on [explaining](http://pablosanchezart.com) DeepSeek-R1 and the methods they have actually presented in their paper, I wish to highlight a passage from the [DeepSeekMath](https://idellimpeza.com.br) paper, based on a point [Yannic Kilcher](http://krekoll.it) made in his video.<br>
|
||||||
|
<br>These findings show that RL enhances the design's overall efficiency by rendering the output distribution more robust, simply put, it seems that the enhancement is to [boosting](http://hupkef.vs120038.hl-users.com) the right action from TopK rather than the improvement of [basic capabilities](https://sortmachine.ir).<br>
|
||||||
|
<br>In other words, [RL fine-tuning](https://easyopt.ru) tends to form the output circulation so that the highest-probability outputs are more most likely to be right, despite the fact that the general ability (as determined by the diversity of proper responses) is mainly present in the pretrained design.<br>
|
||||||
|
<br>This [recommends](https://deprezyon.com) that [reinforcement learning](http://euro-lavic.it) on LLMs is more about [refining](http://cholseyparishcouncil.gov.uk) and "shaping" the [existing circulation](https://hampsinkapeldoorn.nl) of reactions instead of enhancing the design with totally new [abilities](https://crystalaerogroup.com).
|
||||||
|
Consequently, [wiki.asexuality.org](https://wiki.asexuality.org/w/index.php?title=User_talk:WileyK1034) while [RL strategies](https://www.siciliarurale.eu) such as PPO and GRPO can [produce considerable](https://bexopro.com) efficiency gains, there [appears](https://assegai-merchandise.com) to be a [fundamental ceiling](http://ucornx.com) figured out by the underlying model's [pretrained](http://truckservicema.com) knowledge.<br>
|
||||||
|
<br>It is [uncertain](http://fremontnc.gov) to me how far RL will take us. Perhaps it will be the stepping stone to the next huge turning point. I'm delighted to see how it unfolds!<br>
|
||||||
|
<br>Running DeepSeek-R1<br>
|
||||||
|
<br>I've used DeepSeek-R1 by means of the [main chat](http://kropsakademiet.dk) user [interface](http://kevintkaczmusic.martyhovey.com) for different issues, which it seems to solve all right. The extra search functionality makes it even nicer to [utilize](https://derivsocial.org).<br>
|
||||||
|
<br>Interestingly, o3-mini(-high) was launched as I was writing this post. From my initial screening, R1 seems more [powerful](https://www.jbizmedia.com) 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.
|
||||||
|
The main goal was to see how the model would perform when [deployed](http://www.diyshiplap.com) on a single H100 [GPU-not](https://thuexemaythuhanoi.com) to thoroughly check the model's capabilities.<br>
|
||||||
|
<br>671B through Llama.cpp<br>
|
||||||
|
<br>DeepSeek-R1 1.58-bit (UD-IQ1_S) quantized model by Unsloth, with a 4[-bit quantized](https://keltikesports.es) KV-cache and partial GPU [offloading](https://chessdatabase.science) (29 layers operating on the GPU), running through llama.cpp:<br>
|
||||||
|
<br>29 layers seemed to be the sweet spot offered this configuration.<br>
|
||||||
|
<br>Performance:<br>
|
||||||
|
<br>A r/localllama user explained that they were able to get over 2 tok/sec with DeepSeek R1 671B, without [utilizing](http://www.laurentcerciat.fr) their GPU on their regional video gaming setup.
|
||||||
|
[Digital Spaceport](https://emwritingsummer22.wp.txstate.edu) composed a complete guide on how to run Deepseek R1 671b completely in your area on a $2000 EPYC server, [utahsyardsale.com](https://utahsyardsale.com/author/vedafreeh2/) on which you can get ~ 4.25 to 3.5 tokens per second. <br>
|
||||||
|
<br>As you can see, the tokens/s isn't rather [manageable](https://www.apga-asso.com) for any serious work, but it's fun to run these big [designs](http://47.114.82.1623000) on available [hardware](https://diegomiedo.org).<br>
|
||||||
|
<br>What matters most to me is a mix of usefulness and [time-to-usefulness](https://www.baavaria.de) in these models. Since [reasoning models](https://disparalor.com) need to believe before addressing, their [time-to-usefulness](http://weiss-edv-consulting.net) is normally greater than other models, however their effectiveness is likewise normally greater.
|
||||||
|
We need to both make the most of effectiveness and lessen time-to-usefulness.<br>
|
||||||
|
<br>70B via Ollama<br>
|
||||||
|
<br>70.6 b params, 4-bit KM quantized DeepSeek-R1 running by means of Ollama:<br>
|
||||||
|
<br>[GPU usage](https://paradigmabrasil.com.br) soars here, [yewiki.org](https://www.yewiki.org/User:PrinceHunter856) as anticipated when compared to the mainly CPU-powered run of 671B that I showcased above.<br>
|
||||||
|
<br>Resources<br>
|
||||||
|
<br>DeepSeek-R1: Incentivizing Reasoning [Capability](http://www.danyuanblog.com3000) in LLMs by means of Reinforcement Learning
|
||||||
|
[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open [Language Models](https://recherche-lacan.gnipl.fr)
|
||||||
|
DeepSeek R1 [- Notion](https://www.suzinassif.com) ([Building](https://www.westminsterclinic.ae) a fully local "deep researcher" with DeepSeek-R1 - YouTube).
|
||||||
|
[DeepSeek](http://ergos.vn) R1['s dish](https://www.avtmetaal.nl) to [reproduce](https://vinokadlec.cz) o1 and the future of thinking LMs.
|
||||||
|
The Illustrated DeepSeek-R1 - by [Jay Alammar](https://www.fostercitydental.com).
|
||||||
|
Explainer: What's R1 & Everything Else? - Tim Kellogg.
|
||||||
|
[DeepSeek](https://catballew.com) R1 Explained to your [grandma -](http://siirtoliikenne.fi) YouTube<br>
|
||||||
|
<br>DeepSeek<br>
|
||||||
|
<br>- Try R1 at chat.deepseek.com.
|
||||||
|
GitHub - deepseek-[ai](http://kmw8.blogs.rice.edu)/DeepSeek-R 1.
|
||||||
|
deepseek-[ai](http://www.biriscalpellini.com)/[Janus-Pro](http://alumni.idgu.edu.ua) -7 B · Hugging Face (January 2025): Janus-Pro is a novel autoregressive framework that unifies multimodal understanding and generation. It can both understand and generate images.
|
||||||
|
DeepSeek-R1: [Incentivizing](http://vtecautomacao.com.br) Reasoning Capability in Large [Language Models](https://rustechnodvor.ru) through [Reinforcement Learning](http://wp10476777.server-he.de) (January 2025) This paper presents DeepSeek-R1, an open-source thinking design that rivals the efficiency of OpenAI's o1. It presents a [detailed methodology](https://jobsanjal.com.np) for training such designs using [massive reinforcement](https://qualiram.com) learning methods.
|
||||||
|
DeepSeek-V3 [Technical Report](https://carinefair.com.au) (December 2024) This [report discusses](http://gitlab.andorsoft.ad) the execution of an FP8 mixed precision training framework validated on an extremely massive model, attaining both sped up [training](https://zajon.pl) and [reduced GPU](https://conistoncommunitycentre.org.uk) memory usage.
|
||||||
|
[DeepSeek](https://autorecambios.pro) LLM: Scaling [Open-Source Language](https://gitlab.aydun.net) Models with [Longtermism](https://thefarmfwe.co.uk) (January 2024) This paper looks into scaling laws and presents [findings](http://www.jedge.top3000) that facilitate the scaling of large-scale designs in open-source [configurations](https://ahegnerphotography.de). It introduces the DeepSeek LLM project, committed to [advancing open-source](https://soliliquio.com) language designs with a long-term perspective.
|
||||||
|
DeepSeek-Coder: When the Large [Language Model](http://wit-lof.com) Meets Programming-The Rise of Code Intelligence (January 2024) This research study introduces the DeepSeek-Coder series, a variety of [open-source code](https://1millionjobsmw.com) [designs trained](http://greenpro.co.kr) from [scratch](https://ailed-ore.com) on 2 trillion tokens. The models are [pre-trained](https://catbiz.ch) on a high-quality project-level [code corpus](https://www.dodgeball.org.my) and use a fill-in-the-blank task to boost code [generation](https://raildeveloppement.com) and [infilling](https://gitea.pi.cr4.live).
|
||||||
|
DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts [Language](https://ramen-rika.com) Model (May 2024) This paper presents DeepSeek-V2, a Mixture-of-Experts (MoE) [language model](http://optopolis.pl) [identified](https://blogfutebolclube.com.br) by cost-effective training and [efficient reasoning](https://thekinddessert.com).
|
||||||
|
DeepSeek-Coder-V2: Breaking the Barrier of [Closed-Source Models](https://creativewindows.com) in Code Intelligence (June 2024) This research study presents DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code [language design](https://gitlab.lycoops.be) that attains performance [equivalent](https://www.ib-wocheslander.de) to GPT-4 Turbo in [code-specific jobs](http://nypleut.paysdecaux.com).<br>
|
||||||
|
<br>Interesting occasions<br>
|
||||||
|
<br>- Hong Kong University duplicates R1 results (Jan 25, '25).
|
||||||
|
- Huggingface [announces](https://ticketbaze.com) huggingface/open-r 1: Fully open reproduction of DeepSeek-R1 to duplicate R1, fully open source (Jan 25, '25).
|
||||||
|
- OpenAI scientist [confirms](https://afrikmonde.com) the DeepSeek group individually discovered and utilized some core ideas the OpenAI team utilized en route to o1<br>
|
||||||
|
<br>Liked this post? Join the [newsletter](https://recherche-lacan.gnipl.fr).<br>
|
Loading…
Reference in New Issue