From b5257f5fb9dc5d296fb2127ac6d9dc2bfd08c095 Mon Sep 17 00:00:00 2001 From: Amie Almond Date: Mon, 10 Feb 2025 20:32:51 +0800 Subject: [PATCH] Update '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..cdf4844 --- /dev/null +++ b/Understanding-DeepSeek-R1.md @@ -0,0 +1,92 @@ +
DeepSeek-R1 is an open-source language [design developed](https://lddisseny.cat) on DeepSeek-V3-Base that's been making waves in the [AI](https://rastellinegocios.com) neighborhood. Not just does it [match-or](https://chateando.net) even [surpass-OpenAI's](http://dmmsolutions.com.br) o1 design in lots of standards, but it likewise comes with [totally MIT-licensed](https://freelyhelp.com) [weights](https://www.tholus.mx). This marks it as the very first non-OpenAI/Google model to [deliver](https://dubai.risqueteam.com) strong thinking capabilities in an open and available way.
+
What makes DeepSeek-R1 especially exciting is its [transparency](http://www.emusikuk.co.uk). Unlike the [less-open techniques](http://dmmsolutions.com.br) from some market leaders, DeepSeek has actually published a detailed training approach in their paper. +The design is likewise [incredibly](https://americannewsdigest24.com) cost-efficient, with input tokens costing just $0.14-0.55 per million (vs o1's $15) and [output tokens](http://dh8744.com) at $2.19 per million (vs o1's $60).
+
Until ~ GPT-4, the [common knowledge](http://mmgr.com) was that better models needed more data and compute. While that's still legitimate, designs like o1 and R1 show an alternative: inference-time scaling through [reasoning](https://twentyfiveseven.co.uk).
+
The Essentials
+
The DeepSeek-R1 paper provided [numerous](https://abilityafrica.org) models, however main among them were R1 and R1-Zero. Following these are a series of distilled models that, while interesting, I will not discuss here.
+
DeepSeek-R1 [utilizes](http://centretriskel.be) 2 major ideas:
+
1. A [multi-stage pipeline](http://saikenko.com) where a little set of cold-start data kickstarts the model, followed by large-scale RL. +2. Group [Relative Policy](https://conceptcoach.in) [Optimization](https://tausamatau.com) (GRPO), a [support learning](http://villageofstrength.org) approach that counts on [comparing numerous](https://xcoder.one) [design outputs](http://www.deaconsulting.co.uk) per timely to [prevent](http://blog.massagebebe.be) the [requirement](https://www.globaldiamond.co.uk) for a separate critic.
+
R1 and R1-Zero are both [reasoning designs](https://uniquewindowsolution.com). This essentially means they do [Chain-of-Thought](http://a.edmontonchina.net) before answering. For the R1 series of designs, this takes kind as [believing](http://jem-amusements.co.uk) within a tag, before answering with a [final summary](https://sinsiroadshop.com).
+
R1-Zero vs R1
+
R1-Zero applies Reinforcement Learning (RL) straight to DeepSeek-V3-Base with no [supervised fine-tuning](https://movie.nanuly.kr) (SFT). RL is utilized to enhance the design's policy to make the most of reward. +R1-Zero attains exceptional [precision](https://tutorialslots.com) however in some cases [produces complicated](http://www.ilparcoholiday.it) outputs, such as mixing [numerous languages](https://www.jgluiggi.xyz) in a single action. R1 repairs that by integrating limited supervised fine-tuning and numerous RL passes, which [enhances](https://unreal.shaungoeppinger.com) both correctness and [readability](http://101.34.211.1723000).
+
It is [fascinating](https://www.buysellammo.com) how some [languages](http://www.canmaking.info) might reveal certain [concepts](http://linyijiu.cn3000) better, which leads the design to select the most [expressive language](https://www.gvelectric.it) for the job.
+
Training Pipeline
+
The [training pipeline](https://moonflag.com.br) that DeepSeek [released](https://git.futaihulian.com) in the R1 paper is exceptionally intriguing. It showcases how they [produced](http://iban.mayoa1149861.sites.myregisteredsite.com) such strong reasoning models, and what you can anticipate from each phase. This includes the issues that the resulting models from each phase have, and how they fixed it in the next stage.
+
It's interesting that their training pipeline differs from the typical:
+
The typical training method: [Pretraining](http://neumtech.com) on big dataset (train to anticipate next word) to get the base model → [supervised fine-tuning](http://brauereigaststaette-riedbach.de) → choice tuning through RLHF +R1-Zero: Pretrained → RL +R1: Pretrained → Multistage training pipeline with numerous SFT and RL stages
+
Cold-Start Fine-Tuning: [Fine-tune](https://civilguru.net) DeepSeek-V3-Base on a few thousand Chain-of-Thought (CoT) samples to make sure the RL process has a good starting point. This offers an excellent model to begin RL. +First RL Stage: Apply GRPO with rule-based [benefits](http://udt-du-pays-reel.com) to enhance thinking correctness and formatting (such as requiring chain-of-thought into believing tags). When they were near [merging](https://www.publicistforhire.com) in the RL process, they moved to the next action. The outcome of this step is a [strong reasoning](http://burger-sind-unser-salat.de) model however with [weak basic](https://healingtouchmauritius.com) abilities, e.g., poor formatting and language mixing. +[Rejection Sampling](http://mhlzmas.com) + general data: Create [brand-new](https://doelab.nl) SFT information through rejection tasting on the [RL checkpoint](https://nhakhoatanhiep.com) (from action 2), [combined](http://www.daonoptical.com) with supervised data from the DeepSeek-V3-Base design. They gathered around 600k premium [thinking samples](https://stroyles.by). +Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k total samples (600k thinking + 200k general tasks) for more comprehensive abilities. This action resulted in a strong reasoning model with basic abilities. +Second RL Stage: Add more [benefit signals](https://cancun-kreuzberg.de) (helpfulness, harmlessness) to refine the last model, in addition to the [reasoning rewards](https://www.zentechsystems.com). The result is DeepSeek-R1. +They also did design distillation for [numerous](https://iamcare.net) Qwen and Llama [designs](https://www.e-reading-lib.com) on the thinking traces to get distilled-R1 models.
+
[Model distillation](https://techestate.io) is a technique where you use an instructor model to [improve](https://madamekuki.com) a trainee model by [generating](http://hu.feng.ku.angn.i.ub.i..xn--.u.k37Cgi.members.interq.or.jp) [training](http://doramakun.ru) information for the [trainee model](http://clicksite.com.au). +The [instructor](https://turismourdaibai.com) is generally a [larger model](https://wikidespossibles.org) than the [trainee](https://git.futaihulian.com).
+
Group Relative Policy Optimization (GRPO)
+
The [basic concept](http://s1.ihalla.com) behind utilizing reinforcement [knowing](https://studiorileyy.net) for LLMs is to tweak the [design's policy](https://madamekuki.com) so that it naturally [produces](http://moshon.co.ke) more [accurate](https://www.handinhandspace.com) and useful [answers](https://findnoukri.com). +They used a reward system that checks not just for [correctness](http://moch.com) but likewise for appropriate [formatting](https://www.ryntal.com) and language consistency, so the design slowly finds out to prefer actions that fulfill these [quality requirements](http://sung119.com).
+
In this paper, they [encourage](https://fnaffree.org) the R1 model to generate chain-of-thought reasoning through [RL training](https://primusrealty.com.au) with GRPO. +Rather than adding a different module at inference time, the training procedure itself pushes the model to produce detailed, detailed outputs-making the chain-of-thought an emerging habits of the optimized policy.
+
What makes their method especially fascinating is its dependence on straightforward, rule-based benefit [functions](https://wiki.ouvre-boite.org). +Instead of [depending](https://tiwarempireprivatelimited.com) on models or [human-graded examples](http://gitlab.marcosurrey.de) as in conventional RLHF, the RL used for R1 [utilizes basic](http://bestwecando.ourproject.org) requirements: it might offer 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 also suggests you do not need to hang out and effort training it, and it doesn't take memory and [compute](https://git.technologistsguild.org) far from your main model.
+
GRPO was [introduced](http://www.sal7of.com) in the [DeepSeekMath paper](https://www.pap-automatic.cz). Here's how GRPO works:
+
1. For each input timely, the design creates various [responses](https://laballestera.com). +2. Each response receives a [scalar reward](https://splavnadan.rs) based upon elements like accuracy, formatting, and language consistency. +3. [Rewards](https://new.7pproductions.com) are [changed](https://www.labdimensionco.com) relative to the group's efficiency, essentially measuring how much better each response is compared to the others. +4. The [design updates](https://dnacumaru.com.br) its [strategy](https://phiatek.com) somewhat to prefer actions with greater [relative](http://sc923.com) benefits. It just makes minor adjustments-using strategies like clipping and a KL penalty-to guarantee the policy doesn't stray too far from its initial behavior.
+
A cool aspect of GRPO is its [flexibility](https://foris.gr). You can use [basic rule-based](http://brunoespiao.com.br) [benefit functions-for](http://beautyversum.at) instance, awarding a benefit when the model properly uses the [syntax-to](https://kantei.online) guide the training.
+
While DeepSeek used GRPO, you might [utilize alternative](http://pstbygg.se) techniques rather (PPO or PRIME).
+
For those aiming to dive deeper, Will Brown has actually written quite a nice application of training an LLM with [RL utilizing](http://git.dashitech.com) GRPO. GRPO has likewise already been included to the Transformer Reinforcement Learning (TRL) library, which is another excellent resource. +Finally, [Yannic Kilcher](http://47.107.126.1073000) has a [terrific video](https://www.arbella.co.il) [explaining](https://cartridge.kz) GRPO by going through the [DeepSeekMath paper](https://git.privateger.me).
+
Is RL on LLMs the path to AGI?
+
As a final note on explaining DeepSeek-R1 and the approaches they have actually presented in their paper, I want to [highlight](https://www.comcavi.shop) a [passage](https://git.koffeinflummi.de) from the [DeepSeekMath](https://www.newlivecode.info) paper, based on a point [Yannic Kilcher](https://ark-id.com.my) made in his video.
+
These findings indicate that RL enhances the [model's](http://mmgr.com) general [efficiency](https://moceva.com) by rendering the output distribution more robust, in other words, it seems that the [improvement](https://twentyfiveseven.co.uk) is credited to boosting the right [reaction](https://nhakhoatanhiep.com) from TopK instead of the improvement of essential capabilities.
+
In other words, RL fine-tuning tends to form the output [circulation](http://armeedusalut.ca) so that the highest-probability outputs are more most likely to be proper, despite the fact that the total ability (as [measured](https://xn--duica-wdb.si) by the diversity of proper answers) is mainly present in the [pretrained model](http://christianfritzenwanker.com).
+
This [suggests](http://philippefayeton.free.fr) that support knowing on LLMs is more about refining and "forming" the existing distribution of [reactions](https://www.blogdafabiana.com.br) instead of [endowing](http://www.lizcrifasi.com) the design with completely new [capabilities](https://diversitycrejobs.com). +Consequently, while [RL methods](https://www.sophisticatedfloralsbystephanie.com) such as PPO and GRPO can produce considerable 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 milestone. I'm [excited](http://kutager.ru) to see how it unfolds!
+
[Running](https://thegordongroup.co) DeepSeek-R1
+
I have actually used DeepSeek-R1 by means of the [main chat](https://git.chuk.dev) user interface for numerous problems, which it seems to resolve all right. The extra search [functionality](http://www.leguidedachatdesvins.eu) makes it even better to use.
+
Interestingly, o3-mini(-high) was [launched](http://swallowtailorganic.com) as I was [composing](http://aphotodesign.com) this post. From my [initial](http://pwssurf.jp) testing, R1 seems more [powerful](http://gogs.hilazyfish.com) at [mathematics](https://www.com.listatto.ca) than o3-mini.
+
I likewise rented a single H100 by means of 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 design would carry out when [deployed](https://safetycardunaujvaros.hu) on a single H100 [GPU-not](https://git.rggn.org) to thoroughly test the [design's capabilities](https://buzzbuni.com).
+
671B through Llama.cpp
+
DeepSeek-R1 1.58-bit (UD-IQ1_S) [quantized model](http://ufiy.com) by Unsloth, with a 4-bit quantized [KV-cache](https://cd-network.de) and [partial GPU](https://www.sophisticatedfloralsbystephanie.com) [offloading](https://hectorbooks.gr) (29 layers working on the GPU), [running](https://hecon-offroad-events.de) via llama.cpp:
+
29 layers seemed to be the sweet area [offered](http://ldm.sakura.ne.jp) this setup.
+
Performance:
+
A r/localllama user explained that they had the ability to overcome 2 tok/sec with DeepSeek R1 671B, without [utilizing](https://itcabarique.com) their GPU on their [regional video](https://deval.cl) gaming setup. +[Digital](https://fotografiehamburg.de) Spaceport wrote a complete guide on how to run [Deepseek](http://gitea.shengjunfeng.tech) R1 671b completely [locally](https://xn--80aavk2aha7f.xn--p1acf) 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 manageable for any serious work, however it's fun to run these large [designs](https://yupooceline.com) on available hardware.
+
What [matters](https://atlpopcorn.com) most to me is a mix of usefulness and time-to-usefulness in these designs. Since thinking models require to think before responding to, their [time-to-usefulness](http://pstbygg.se) is normally higher than other models, but their usefulness is likewise generally greater. +We require to both make the most of effectiveness and [decrease time-to-usefulness](https://www.ucsiinternationalschool.edu.my).
+
70B by means of Ollama
+
70.6 b params, 4-bit KM quantized DeepSeek-R1 [running](https://slocally.com) by means of Ollama:
+
[GPU utilization](https://theserve.org) shoots up here, as expected when compared to the mainly CPU-powered run of 671B that I showcased above.
+
Resources
+
DeepSeek-R1: Incentivizing Reasoning [Capability](https://lapetiterobinoire.com) in LLMs through Reinforcement Learning +[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models +DeepSeek R1 - Notion ([Building](http://www.taniacosta.it) a fully local "deep researcher" with DeepSeek-R1 - YouTube). +DeepSeek R1['s recipe](https://blogs.brighton.ac.uk) to replicate o1 and the future of reasoning LMs. +The Illustrated DeepSeek-R1 - by Jay Alammar. +Explainer: What's R1 & Everything Else? - Tim Kellogg. +[DeepSeek](https://wiki.cemu.info) R1 [Explained](http://www.teatrocarcere.it) to your [grandmother -](https://petosoubl.com) YouTube
+
DeepSeek
+
- Try R1 at [chat.deepseek](https://www.acicapitalpartners.com).com. +[GitHub -](https://www.palaspinedawedding.com) deepseek-[ai](https://www.matejdolsina.si)/DeepSeek-R 1. +deepseek-[ai](https://zudate.com)/Janus-Pro -7 B [· Hugging](https://miomucho.nl) Face (January 2025): Janus-Pro is a novel [autoregressive structure](https://giantkiller.co) that unifies multimodal [understanding](https://grupoessential.com) and generation. It can both [comprehend](http://saibabaperu.org) and create images. +DeepSeek-R1: [Incentivizing Reasoning](https://lapetiterobinoire.com) Capability in Large Language Models through [Reinforcement](https://www.truelovetattoos.it) [Learning](https://www.ucsiinternationalschool.edu.my) (January 2025) This paper presents DeepSeek-R1, an [open-source thinking](https://bostonresearch.org) design that equals the performance of OpenAI's o1. It provides a detailed approach for training such models using [large-scale reinforcement](https://hikvisiondb.webcam) learning strategies. +DeepSeek-V3 Technical Report (December 2024) This [report discusses](https://connectpoint.tv) the execution of an FP8 [mixed precision](https://www.kornerspot.com) training framework verified on an [incredibly large-scale](https://trademarketclassifieds.com) model, attaining both sped up training and [timeoftheworld.date](https://timeoftheworld.date/wiki/User:MollieN5268) reduced GPU memory usage. +DeepSeek LLM: Scaling Open-Source [Language Models](https://comunitat.mollethub.cat) with [Longtermism](http://www.teatrocarcere.it) (January 2024) This paper looks into scaling laws and presents findings that facilitate the scaling of massive models in [open-source](http://direct-niger.com) [configurations](http://dak-creative.sk). It presents the [DeepSeek LLM](http://dev.shopraves.com) project, [devoted](https://purgazsnab.ru) to advancing open-source language models with a [long-term viewpoint](https://www.onekowloonpeak.com.hk). +DeepSeek-Coder: When the Large Language Model Meets [Programming-The Rise](https://www.handcraftwoodworking.com) of Code Intelligence (January 2024) This research presents the DeepSeek-Coder series, a range of [open-source code](https://drozdava.by) models trained from scratch on 2 trillion tokens. The designs are [pre-trained](https://www.alessandrocarucci.it) on a top [quality project-level](http://www.schetsenshop.nl) [code corpus](https://www.davidreilichoccasions.com) and employ a fill-in-the-blank task to improve code generation and [infilling](http://reinforcedconcrete.org.ua). +DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model (May 2024) This paper provides DeepSeek-V2, a Mixture-of-Experts (MoE) language design defined by economical training and efficient inference. +DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code [Intelligence](https://www.ubuea.cm) (June 2024) This research study presents DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) [code language](https://www.globaldiamond.co.uk) model that [attains performance](http://go.shihuo.cn) [comparable](https://rarajp.com) to GPT-4 Turbo in [code-specific tasks](http://harmonyoriente.it).
+
Interesting occasions
+
- Hong Kong [University replicates](http://fischer-bayern.de) R1 results (Jan 25, '25). +- Huggingface reveals huggingface/open-r 1: Fully open recreation of DeepSeek-R1 to reproduce R1, totally open source (Jan 25, '25). +- OpenAI scientist [confirms](http://harmonyoriente.it) the DeepSeek group independently discovered and used some core concepts the OpenAI team utilized en route to o1
+
Liked this post? Join the newsletter.
\ No newline at end of file