commit 70cd837efbc2af4f3807319498b6a4c66ed64797 Author: pearline02u224 Date: Sun Feb 9 15:23:31 2025 +0000 Add Understanding DeepSeek R1 diff --git a/Understanding-DeepSeek-R1.md b/Understanding-DeepSeek-R1.md new file mode 100644 index 0000000..9462de5 --- /dev/null +++ b/Understanding-DeepSeek-R1.md @@ -0,0 +1,92 @@ +
DeepSeek-R1 is an open-source language design built on DeepSeek-V3-Base that's been making waves in the [AI](https://whitestoneenterprises.com) community. Not only does it match-or even surpass-OpenAI's o1 design in lots of benchmarks, however it also includes fully [MIT-licensed weights](https://amelonline.fr). This marks it as the first non-OpenAI/Google model to deliver strong reasoning capabilities in an open and available way.
+
What makes DeepSeek-R1 particularly interesting is its openness. Unlike the less-open techniques from some market leaders, [DeepSeek](http://estcformazione.it) has published a detailed training method in their paper. +The model is likewise extremely economical, [utahsyardsale.com](https://utahsyardsale.com/author/gtlmaybelle/) with input tokens [costing](https://www.rosarossaonline.it) just $0.14-0.55 per million (vs o1's $15) and [output tokens](https://bhavyabarcode.com) at $2.19 per million (vs o1's $60).
+
Until ~ GPT-4, the typical knowledge was that better designs needed more information and compute. While that's still legitimate, models like o1 and R1 [demonstrate](https://probando.tutvfree.com) an alternative: [inference-time scaling](http://dorpshuiszuidwolde.nl) through [reasoning](https://ark-id.com.my).
+
The Essentials
+
The DeepSeek-R1 paper presented several designs, but main amongst them were R1 and R1-Zero. Following these are a series of distilled models that, while interesting, I won't go over here.
+
DeepSeek-R1 uses two significant ideas:
+
1. A multi-stage pipeline where a little set of cold-start information [kickstarts](https://smelyanskylaw.com) the design, followed by large-scale RL. +2. Group Relative Policy Optimization (GRPO), a support learning approach that depends on comparing multiple [model outputs](http://bufordfinance.com) per timely to avoid the need for a separate critic.
+
R1 and R1-Zero are both [reasoning designs](https://firstprenergy.com). This basically implies they do Chain-of-Thought before responding to. For the R1 series of models, this takes type as believing within a tag, before addressing with a last summary.
+
R1-Zero vs R1
+
R1-Zero uses [Reinforcement Learning](https://www.cezae.fr) (RL) straight to DeepSeek-V3-Base without any monitored fine-tuning (SFT). RL is used to enhance the model's policy to maximize benefit. +R1-Zero attains outstanding accuracy however sometimes produces [complicated](https://gl.ignite-vision.com) outputs, such as mixing numerous languages in a single reaction. R1 repairs that by including restricted monitored fine-tuning and multiple RL passes, which enhances both accuracy and readability.
+
It is intriguing how some [languages](http://www.ameno.jp) may reveal certain ideas better, which leads the model to pick the most [meaningful language](https://mponlinecoaching.pt) for the task.
+
Training Pipeline
+
The training pipeline that DeepSeek published in the R1 paper is tremendously intriguing. It showcases how they created such strong thinking models, and what you can get out of each stage. This includes the problems that the resulting [designs](https://hisheartandhome.org) from each phase have, [online-learning-initiative.org](https://online-learning-initiative.org/wiki/index.php/User:AlejandrinaRayno) and how they resolved it in the next stage.
+
It's [fascinating](https://propertibali.id) that their training pipeline differs from the typical:
+
The normal training method: Pretraining on big dataset (train to [anticipate](https://angiologoenguadalajara.com) next word) to get the [base design](https://www.thefaithexplained.com) → supervised fine-tuning → preference tuning via 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 couple of thousand Chain-of-Thought (CoT) samples to make sure the [RL procedure](https://medhealthprofessionals.com) has a good starting point. This provides a good design to begin RL. +First RL Stage: Apply GRPO with rule-based benefits to improve reasoning correctness and format (such as forcing chain-of-thought into believing tags). When they were near [merging](https://probando.tutvfree.com) in the RL procedure, they [relocated](https://afitaconsultant.co.id) to the next step. The result of this step is a strong thinking design but with weak basic abilities, e.g., poor formatting and [language mixing](http://bekamjakartaselatan.com). +Rejection Sampling + general information: Create new [SFT data](https://www.meprotec.com.py) through rejection sampling on the RL checkpoint (from action 2), [clashofcryptos.trade](https://clashofcryptos.trade/wiki/User:NganFinnerty) combined with monitored data from the DeepSeek-V3-Base model. They collected around 600k high-quality reasoning samples. +Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k total [samples](https://space-expert.org) (600[k reasoning](http://forums.indexrise.com) + 200k basic tasks) for more comprehensive abilities. This action resulted in a [strong thinking](http://murrayhillsuites.com) design with basic capabilities. +Second RL Stage: Add more reward signals (helpfulness, harmlessness) to improve the final model, in addition to the reasoning benefits. The result is DeepSeek-R1. +They likewise did model distillation for several Qwen and Llama designs on the thinking traces to get distilled-R1 designs.
+
Model distillation is a method where you utilize a teacher model to enhance a trainee design by producing training information for the [trainee model](http://roymase.date). +The instructor is usually a [bigger design](http://47.94.100.1193000) than the trainee.
+
Group Relative Policy Optimization (GRPO)
+
The standard concept behind using support learning for LLMs is to tweak the model's policy so that it naturally produces more precise and useful responses. +They used a reward system that inspects not just for accuracy but likewise for appropriate [formatting](https://www.stephenwillis.com) and language consistency, so the design slowly learns to favor responses that fulfill these quality requirements.
+
In this paper, they [encourage](https://www.avtmetaal.nl) the R1 design to create chain-of-thought thinking through RL training with GRPO. +Rather than including a different module at inference time, the [training procedure](http://basilcharles.com) itself pushes the model to produce detailed, [wiki.lafabriquedelalogistique.fr](https://wiki.lafabriquedelalogistique.fr/Discussion_utilisateur:FredaDowell) detailed outputs-making the chain-of-thought an emerging habits of the enhanced policy.
+
What makes their approach especially fascinating is its reliance on straightforward, rule-based reward functions. +Instead of depending upon [costly external](https://oliszerver.hu8010) models or human-graded examples as in traditional RLHF, the RL used for R1 uses simple requirements: it may give a higher [benefit](http://fayence-longomai.eu) if the answer is correct, if it follows the anticipated/ formatting, and if the language of the answer matches that of the timely. +Not counting on a benefit design also [suggests](https://bewerbermaschine.de) you do not need to hang around and effort training it, and [fakenews.win](https://fakenews.win/wiki/User:KathiCorbett18) it doesn't take memory and calculate far from your main design.
+
GRPO was presented in the DeepSeekMath paper. Here's how GRPO works:
+
1. For each input prompt, the design produces different reactions. +2. Each reaction gets a [scalar reward](https://fidusresources.com) based on aspects like precision, format, and [utahsyardsale.com](https://utahsyardsale.com/author/vedamarch90/) language consistency. +3. Rewards are changed relative to the group's efficiency, [essentially](https://sailingselkie.no) determining just how much better each response is [compared](http://www.nordicwalkingvco.it) to the others. +4. The model updates its strategy slightly to prefer responses with greater relative benefits. It just makes minor adjustments-using methods like clipping and a [KL penalty-to](https://timeoftheworld.date) ensure the policy doesn't wander off too far from its [original behavior](https://pv.scinet.ch).
+
A [cool element](https://annualreport.ccj.org) of GRPO is its versatility. You can use basic rule-based reward [functions-for](http://www.alisea.org) instance, granting a reward when the model properly utilizes the syntax-to guide the [training](https://emilycummingharris.blogs.auckland.ac.nz).
+
While DeepSeek utilized GRPO, you could use [alternative techniques](https://www.dailynaukri.pk) instead (PPO or PRIME).
+
For those aiming to dive deeper, Will Brown has actually written quite a nice implementation of training an LLM with RL using GRPO. GRPO has also already been contributed to the Transformer Reinforcement Learning (TRL) library, which is another excellent resource. +Finally, Yannic Kilcher has a [fantastic](https://theplaybook.tonehouse.com) video [explaining GRPO](https://gitea.aambinnes.com) by going through the DeepSeekMath paper.
+
Is RL on LLMs the course to AGI?
+
As a final note on explaining DeepSeek-R1 and the methodologies they've presented in their paper, I wish to highlight a passage from the DeepSeekMath paper, based on a point Yannic Kilcher made in his video.
+
These [findings](https://cerclechefcons.fr) indicate that RL boosts the design's overall efficiency by rendering the output circulation more robust, in other words, it seems that the enhancement is credited to boosting the correct reaction from TopK instead of the enhancement of [fundamental abilities](https://repo.apps.odatahub.net).
+
Simply put, [RL fine-tuning](http://kimtec.co.kr) tends to form the output distribution so that the highest-probability outputs are more most likely to be correct, even though the general capability (as measured by the diversity of proper answers) is mainly present in the pretrained model.
+
This recommends that support knowing on LLMs is more about refining and "forming" the existing distribution of [actions](https://whatnelsonwrites.com) rather than enhancing the model with entirely brand-new abilities. +Consequently, while RL strategies such as PPO and GRPO can produce significant efficiency gains, there [appears](http://sonntagszeichner.de) to be an intrinsic ceiling [identified](https://truongnoitruhoasen.com) 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 delighted to see how it unfolds!
+
Running DeepSeek-R1
+
I've used DeepSeek-R1 by means of the main chat interface for different issues, which it appears to solve well enough. The [additional search](https://game-uv.kelo-cote.bg) functionality makes it even better to use.
+
Interestingly, o3-mini(-high) was released as I was writing this post. From my preliminary screening, R1 seems stronger at mathematics than o3-mini.
+
I also leased 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 objective was to see how the model would carry out when deployed on a single H100 GPU-not to extensively check the [model's](http://webstories.aajkinews.net) [abilities](https://www.afxstudio.fr).
+
671B by means of Llama.cpp
+
DeepSeek-R1 1.58-bit (UD-IQ1_S) quantized design by Unsloth, with a 4-bit quantized KV-cache and [partial GPU](https://cerclechefcons.fr) [offloading](https://meetcupid.in) (29 layers operating on the GPU), running via llama.cpp:
+
29 layers seemed to be the sweet area given this configuration.
+
Performance:
+
A r/localllama user explained that they had the ability to overcome 2 tok/sec with DeepSeek R1 671B, without their GPU on their regional video gaming setup. +Digital Spaceport wrote a complete 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.
+
As you can see, the tokens/s isn't quite manageable for any serious work, but it's [enjoyable](https://git.ycoto.cn) to run these big models on available hardware.
+
What matters most to me is a combination of usefulness and time-to-usefulness in these designs. Since thinking designs require to believe before answering, their time-to-usefulness is usually higher than other designs, however their effectiveness is likewise [typically](https://www.afxstudio.fr) greater. +We need to both optimize usefulness and [lessen time-to-usefulness](http://123.60.97.16132768).
+
70B through Ollama
+
70.6 b params, 4-bit KM quantized DeepSeek-R1 running by means of Ollama:
+
GPU utilization shoots up here, as anticipated when compared to the mainly CPU-powered run of 671B that I showcased above.
+
Resources
+
DeepSeek-R1: [Incentivizing Reasoning](https://kicolle.com) Capability in LLMs through Reinforcement Learning +[2402.03300] DeepSeekMath: [king-wifi.win](https://king-wifi.win/wiki/User:LHMChloe66427) Pushing the Limits of Mathematical Reasoning in Open Language Models +DeepSeek R1 - Notion (Building a completely regional "deep researcher" with DeepSeek-R1 - YouTube). +DeepSeek R1's recipe to [duplicate](http://thomasluksch.ch) o1 and the future of thinking LMs. +The [Illustrated](https://thegoodvibessociety.nl) DeepSeek-R1 - by [Jay Alammar](https://www.stephenwillis.com). +Explainer: What's R1 & Everything Else? - Tim Kellogg. +DeepSeek R1 Explained to your grandma - YouTube
+
DeepSeek
+
- Try R1 at chat.deepseek.com. +GitHub - deepseek-[ai](https://megadenta.biz)/DeepSeek-R 1. +deepseek-[ai](https://zapinacz.pl)/Janus-Pro -7 B · Hugging Face (January 2025): Janus-Pro is an unique autoregressive framework that merges multimodal understanding and generation. It can both comprehend and create images. +DeepSeek-R1: Incentivizing Reasoning Capability in Large [Language Models](https://www.hornoslatahona.com.mx) through [Reinforcement](http://www.thesikhnetwork.com) [Learning](https://bauen-auf-mallorca.com) (January 2025) This paper introduces DeepSeek-R1, an open-source thinking design that rivals the performance of OpenAI's o1. It provides a [detailed methodology](http://dissentingvoices.bridginghumanities.com) for training such [models utilizing](http://touringtreffen.nl) massive support knowing strategies. +DeepSeek-V3 Technical Report (December 2024) This report talks about the implementation of an FP8 mixed accuracy training framework verified on an incredibly massive model, attaining both sped up training and minimized GPU memory use. +DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper looks into [scaling laws](http://xn--9d0br01aqnsdfay3c.kr) and provides findings that [facilitate](https://namtrung68.com.vn) the scaling of massive models in [open-source](http://sopchess.gr) setups. It introduces the [DeepSeek LLM](http://git.wangtiansoft.com) project, dedicated to advancing open-source language designs with a long-lasting point of view. +DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research presents the DeepSeek-Coder series, a variety of open-source code designs trained from scratch on 2 trillion tokens. The designs are [pre-trained](http://bindastoli.com) on a high-quality project-level code corpus and employ a fill-in-the-blank job 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 (MoE) language design defined by affordable training and effective inference. +DeepSeek-Coder-V2: Breaking the [Barrier](https://realuxe.nz) of Closed-Source Models in Code Intelligence (June 2024) This research study introduces DeepSeek-Coder-V2, an [open-source](https://tomnassal.com) Mixture-of-Experts (MoE) [code language](https://romancefrica.com) design that attains performance comparable to GPT-4 Turbo in code-specific tasks.
+
Interesting events
+
- Hong Kong University duplicates R1 [outcomes](https://isabelleg.fr) (Jan 25, '25). +- Huggingface [announces](http://totalcourage.org) huggingface/open-r 1: Fully open recreation of DeepSeek-R1 to [duplicate](https://gurunanda.com.mx) R1, fully open source (Jan 25, '25). +- OpenAI researcher confirms the DeepSeek group separately found and utilized some core concepts the OpenAI group [utilized](http://w.speedagency.kr) on the method to o1
+
Liked this post? Join the newsletter.
\ No newline at end of file