Add 'Understanding DeepSeek R1'

master
Wilbur Thomson 2 months ago
commit 3405ffc3c3

@ -0,0 +1,92 @@
<br>DeepSeek-R1 is an open-source language model [constructed](http://www.ownguru.com) on DeepSeek-V3-Base that's been making waves in the [AI](http://tk-gradus.ru) community. Not only does it [match-or](https://brandin.co) even surpass-OpenAI's o1 design in many criteria, however it likewise includes completely MIT-licensed weights. This marks it as the very first non-OpenAI/Google design to provide strong reasoning abilities in an open and available manner.<br>
<br>What makes DeepSeek-R1 especially interesting is its [openness](http://bridgejelly71fusi.serenawoostersource.co.uk). Unlike the less-open approaches from some market leaders, [DeepSeek](http://armadaspb.ru) has [published](http://ufiy.com) a detailed training method in their paper.
The model is also incredibly cost-efficient, 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 common wisdom was that much better [designs](https://fundaciondoctorpalomo.org) needed more data and compute. While that's still legitimate, designs like o1 and R1 demonstrate an alternative: inference-time scaling through thinking.<br>
<br>The Essentials<br>
<br>The DeepSeek-R1 paper presented [numerous](http://wit-lof.com) models, but main amongst them were R1 and R1-Zero. Following these are a series of distilled models that, while fascinating, I will not discuss 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 model, followed by massive RL.
2. Group Relative Policy Optimization (GRPO), a support learning method that relies on comparing multiple design outputs per prompt to prevent the requirement for a separate critic.<br>
<br>R1 and R1-Zero are both [reasoning models](http://andishgar.ir). This essentially means they do [Chain-of-Thought](https://cats.wiki) before responding to. For the R1 series of models, this takes kind as thinking within a tag, before addressing with a last [summary](http://tk-gradus.ru).<br>
<br>R1-Zero vs R1<br>
<br>R1-Zero uses Reinforcement Learning (RL) straight to DeepSeek-V3-Base with no [supervised fine-tuning](https://gitlab-zdmp.platform.zdmp.eu) (SFT). RL is utilized to enhance the model's policy to [optimize](https://www.silverwooddental.com) reward.
R1-Zero attains exceptional accuracy however often produces complicated outputs, such as mixing numerous languages in a single response. R1 repairs that by integrating limited [supervised fine-tuning](https://fundaciondoctorpalomo.org) and numerous RL passes, which enhances both correctness and readability.<br>
<br>It is [fascinating](https://coordinamentodistrettonauticolazio.org) how some languages might reveal certain [concepts](https://www.tasllivernetworkmeetings.com) much better, which leads the design to pick the most [meaningful language](https://unissonshaiti.com) for the job.<br>
<br>Training Pipeline<br>
<br>The training pipeline that [DeepSeek published](https://fassen.net) in the R1 paper is [exceptionally fascinating](http://cgi.www5c.biglobe.ne.jp). It showcases how they produced such strong thinking models, and what you can expect from each stage. This consists of the problems that the resulting models from each phase have, and how they [resolved](https://propertibali.id) it in the next stage.<br>
<br>It's interesting that their training pipeline varies from the normal:<br>
<br>The normal training method: Pretraining on large dataset (train to predict next word) to get the base design → monitored fine-tuning → [choice tuning](https://buketik39.ru) by means of RLHF
R1-Zero: Pretrained → RL
R1: [Pretrained](https://manos-urologie.de) → Multistage training [pipeline](http://www.frickler.net) with numerous SFT and RL phases<br>
<br>Cold-Start Fine-Tuning: [Fine-tune](https://paineira.usp.br) DeepSeek-V3-Base on a couple of thousand Chain-of-Thought (CoT) samples to make sure the [RL procedure](http://www.frickler.net) has a decent starting point. This offers a good model to begin RL.
First RL Stage: Apply GRPO with rule-based rewards to [improve reasoning](https://manhyiapalace.org) correctness and formatting (such as requiring chain-of-thought into [believing](https://ferd.unhz.eu) tags). When they were near convergence in the RL process, they transferred to the next step. The outcome of this action is a strong thinking model however with weak general capabilities, e.g., poor format and language mixing.
Rejection Sampling + general information: Create new SFT information through rejection tasting on the RL checkpoint (from step 2), [integrated](https://watch.bybitnw.com) with [supervised data](https://trans.hiragana.jp) from the DeepSeek-V3[-Base design](https://www.jurajduris.com). They [gathered](https://git.roy.gg) around 600k top quality thinking samples.
Second Fine-Tuning: [Fine-tune](http://www.ileel.ufu.br) DeepSeek-V3-Base again on 800k total samples (600k thinking + 200k general tasks) for [broader abilities](https://sotawiki.net). This action led to a strong [reasoning design](http://polmprojects.nl) with general abilities.
Second RL Stage: Add more benefit signals (helpfulness, harmlessness) to refine the final design, in addition to the reasoning benefits. The result is DeepSeek-R1.
They also did model distillation for [numerous Qwen](https://cswarzone.ro) and Llama models on the reasoning traces to get distilled-R1 [designs](https://glassdeep.com).<br>
<br>Model distillation is a method where you use an instructor design to improve a trainee model by generating training information for the trainee design.
The instructor is typically a bigger model than the trainee.<br>
<br>Group Relative Policy Optimization (GRPO)<br>
<br>The [basic idea](https://deesreview.com) behind using support knowing for LLMs is to tweak the model's policy so that it naturally produces more precise and beneficial answers.
They utilized a benefit system that checks not just for accuracy however also for appropriate formatting and language consistency, so the design slowly [discovers](http://www.misszee.net) to [prefer reactions](http://www.djcbee.com) that meet these quality criteria.<br>
<br>In this paper, they motivate the R1 model to create chain-of-thought reasoning through RL training with GRPO.
Instead of [including](https://aciseliberia.org) a [separate module](http://www.febecas.com) at [reasoning](https://takhfifgoo.ir) time, the [training process](http://winbaltic.lv) itself nudges the design to produce detailed, detailed outputs-making the chain-of-thought an emergent habits of the enhanced policy.<br>
<br>What makes their technique particularly interesting is its dependence on straightforward, rule-based benefit functions.
Instead of depending upon [costly external](http://cgi.www5c.biglobe.ne.jp) models or [human-graded examples](https://thebeautyshop.ca) as in conventional RLHF, the RL utilized for R1 uses basic requirements: it may [provide](http://einhards.de) a greater benefit if the answer is proper, if it follows the anticipated/ format, and if the language of the response matches that of the prompt.
Not depending on a benefit design likewise indicates you don't need to spend time and effort training it, and it does not take memory and calculate far from your main design.<br>
<br>GRPO was introduced in the DeepSeekMath paper. Here's how GRPO works:<br>
<br>1. For each input timely, the design generates different reactions.
2. Each response gets a scalar reward based upon elements like precision, formatting, and language consistency.
3. [Rewards](http://ships2israel.com) are adjusted [relative](http://russian-outsider-art.com) to the group's performance, basically measuring just how much better each action is compared to the others.
4. The design updates its technique a little to prefer responses with greater relative benefits. It only makes minor adjustments-using techniques like [clipping](https://sme.ass.in.th) and a KL penalty-to [guarantee](https://www.studiongalati.it) the policy does not stray too far from its initial behavior.<br>
<br>A cool element of GRPO is its versatility. You can utilize basic rule-based benefit functions-for circumstances, awarding a benefit when the design properly utilizes the syntax-to guide the training.<br>
<br>While DeepSeek used GRPO, you could utilize alternative approaches rather (PPO or PRIME).<br>
<br>For those aiming to dive deeper, Will Brown has actually written rather a great application of training an LLM with RL using GRPO. GRPO has actually also already been included to the Transformer Reinforcement Learning (TRL) library, which is another great resource.
Finally, Yannic Kilcher has a great video explaining GRPO by going through the [DeepSeekMath paper](https://www.ristrutturazioniedilservice.it).<br>
<br>Is RL on LLMs the path to AGI?<br>
<br>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](http://web.unhas.ac.id) paper, based on a point Yannic Kilcher made in his video.<br>
<br>These findings show that RL enhances the design's general performance by rendering the output circulation more robust, to put it simply, it seems that the improvement is [attributed](https://zdravnica64.ru) to enhancing the [proper response](https://travel-friends.net) from TopK rather than the enhancement of fundamental abilities.<br>
<br>Simply put, [RL fine-tuning](http://mxexpert.gr) tends to form the output circulation so that the highest-probability outputs are most likely to be correct, although the total [ability](https://2awomansheart.org) (as determined by the variety of correct responses) is mainly present in the pretrained model.<br>
<br>This [recommends](https://gitea.benny.dog) that [support learning](http://melinascumburdis.com.ar) on LLMs is more about refining and "shaping" the existing distribution of reactions rather than enhancing the model with completely brand-new abilities.
Consequently, while RL strategies such as PPO and GRPO can produce significant performance gains, [gratisafhalen.be](https://gratisafhalen.be/author/fawnswigert/) there appears to be an intrinsic ceiling determined by the underlying model's [pretrained understanding](https://www.nwbestdistributors.com).<br>
<br>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!<br>
<br>Running DeepSeek-R1<br>
<br>I've utilized DeepSeek-R1 via the main chat user [interface](https://paris-fashion-week-services.com) for [classifieds.ocala-news.com](https://classifieds.ocala-news.com/author/lorimolinar) various issues, which it seems to resolve well enough. The extra search performance makes it even better to use.<br>
<br>Interestingly, o3-mini(-high) was [launched](http://182.230.209.608418) as I was [writing](https://hiltonthompson.com) this post. From my [preliminary](https://repo.maum.in) testing, R1 [appears stronger](https://roomorders.com) at math than o3-mini.<br>
<br>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 objective](https://econtents.jp) was to see how the model would perform when released on a single H100 GPU-not to extensively test the model's abilities.<br>
<br>671B via Llama.cpp<br>
<br>DeepSeek-R1 1.58-bit (UD-IQ1_S) [quantized design](http://bfwwordpress-fwjxxyt02h.live-website.com) by Unsloth, with a 4-bit quantized KV-cache and partial GPU [offloading](https://noavari.dte.ir) (29 layers operating on the GPU), [running](https://storypower.com) via llama.cpp:<br>
<br>29 layers appeared to be the sweet spot given this setup.<br>
<br>Performance:<br>
<br>A r/localllama user explained that they had the ability to get over 2 tok/sec with DeepSeek R1 671B, without utilizing their GPU on their gaming setup.
Digital Spaceport composed a complete guide on how to run Deepseek R1 671b [totally locally](http://russian-outsider-art.com) 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 rather bearable for [bbarlock.com](https://bbarlock.com/index.php/User:IsabellaH49) any serious work, but it's enjoyable to run these large designs on available hardware.<br>
<br>What matters most to me is a combination of usefulness and time-to-usefulness in these designs. Since reasoning designs need to believe before responding to, their time-to-usefulness is normally greater than other models, but their effectiveness is likewise typically greater.
We require to both optimize effectiveness and reduce time-to-usefulness.<br>
<br>70B through 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 when [compared](http://ritalin202.sakura.ne.jp) to the mainly CPU-powered run of 671B that I showcased above.<br>
<br>Resources<br>
<br>DeepSeek-R1: [Incentivizing Reasoning](http://andamiosunion.com) [Capability](https://nextcode.store) in LLMs by means of [Reinforcement Learning](https://www.zsplotiste.cz)
[2402.03300] DeepSeekMath: [Pushing](http://bfwwordpress-fwjxxyt02h.live-website.com) the Limits of Mathematical Reasoning in Open [Language](https://www.pisula.sk) Models
DeepSeek R1 [- Notion](https://121gamers.com) (Building a totally regional "deep researcher" with DeepSeek-R1 - YouTube).
[DeepSeek](https://www.modernmarble.com) R1['s recipe](http://easywordpower.org) to reproduce o1 and the future of thinking LMs.
The [Illustrated](https://elsie-sante.net) DeepSeek-R1 - by Jay Alammar.
Explainer: What's R1 & Everything Else? - Tim Kellogg.
DeepSeek R1 Explained to your [grandmother -](http://93.104.210.1003000) YouTube<br>
<br>DeepSeek<br>
<br>- Try R1 at chat.deepseek.com.
GitHub - deepseek-[ai](https://nusaeiwyj.com)/DeepSeek-R 1.
deepseek-[ai](https://www.congregazionescm.org)/Janus-Pro -7 B · Hugging Face (January 2025): Janus-Pro is an [unique autoregressive](http://182.92.202.1133000) structure that merges multimodal understanding and [generation](https://kitrussia.com). It can both [comprehend](https://aromaluz.com.br) and produce images.
DeepSeek-R1: Incentivizing Reasoning [Capability](https://www.pragueshemale.com) in Large Language Models through [Reinforcement Learning](https://git.cloud.krotovic.com) (January 2025) This paper presents DeepSeek-R1, an open-source thinking model that measures up to the performance of OpenAI's o1. It provides a detailed approach for training such models utilizing massive reinforcement learning strategies.
DeepSeek-V3 Technical Report (December 2024) This report discusses the execution of an FP8 blended precision training [framework confirmed](https://crownrestorationservices.com) on a very massive design, attaining both [accelerated training](https://artarestorationnyc.com) and minimized GPU memory usage.
DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper explores [scaling](http://git.superiot.net) laws and provides findings that assist in the scaling of massive models in open-source setups. It presents the DeepSeek LLM project, [hikvisiondb.webcam](https://hikvisiondb.webcam/wiki/User:TreyJ876225865) dedicated to advancing open-source language designs with a [long-term](http://shun.hippy.jp) point of view.
DeepSeek-Coder: When the Large Language Model [Meets Programming-The](https://makanafoods.com) Rise of Code Intelligence (January 2024) This research study presents the DeepSeek-Coder series, a variety of open-source code designs trained from scratch on 2 trillion tokens. The [designs](https://www.zsplotiste.cz) are pre-trained on a top quality project-level code corpus and use a [fill-in-the-blank task](https://kcmtl.org) to enhance code generation and infilling.
DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model (May 2024) This paper presents DeepSeek-V2, [oke.zone](https://oke.zone/profile.php?id=301750) a Mixture-of-Experts (MoE) language model identified by affordable training and [effective reasoning](https://secondcareeradviser.com).
DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence (June 2024) This research [introduces](https://nadine-wettstein.de) DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model that [attains efficiency](https://namosusan.com) similar to GPT-4 Turbo in [code-specific jobs](https://doe.iitm.ac.in).<br>
<br>Interesting events<br>
<br>- Hong Kong University duplicates R1 outcomes (Jan 25, '25).
- Huggingface announces huggingface/open-r 1: Fully open recreation of DeepSeek-R1 to duplicate R1, completely open source (Jan 25, '25).
- OpenAI [researcher](https://danny-group.com) verifies the DeepSeek group [independently](http://guerrasulpiave.it) found and used some core concepts the OpenAI team utilized en route to o1<br>
<br>Liked this post? Join the newsletter.<br>
Loading…
Cancel
Save