Le site communautaire où l'on discute des vélos à assistance électrique en copyleft, libre de tout bandeau publicitaire
Vous n'êtes pas identifié.
Pages: 1
DeepSeek-R1 is an open-source language design built on DeepSeek-V3-Base that's been making waves in the AI neighborhood. Not just does it match-or even surpass-OpenAI's o1 model in many criteria, but it also comes with completely MIT-licensed weights. This marks it as the first non-OpenAI/Google model to deliver strong thinking abilities in an open and available way.
What makes DeepSeek-R1 especially interesting is its openness. Unlike the less-open techniques from some industry leaders, DeepSeek has actually released a detailed training approach in their paper.
The model is likewise incredibly affordable, with input tokens costing simply $0.14-0.55 per million (vs o1's $15) and output tokens at $2.19 per million (vs o1's $60).
Until ~ GPT-4, the typical wisdom was that better models required more data and compute. While that's still legitimate, models like o1 and R1 demonstrate an option: inference-time scaling through thinking.
The Essentials
The DeepSeek-R1 paper presented multiple 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.
DeepSeek-R1 uses 2 major concepts:
1. A multi-stage pipeline where a little set of cold-start information kickstarts the model, followed by massive RL.
2. Group Relative Policy Optimization (GRPO), a reinforcement learning technique that depends on comparing multiple design outputs per timely to avoid the requirement for a separate critic.
R1 and R1-Zero are both thinking models. This essentially means they do Chain-of-Thought before addressing. For the R1 series of designs, this takes form as believing within a tag, before responding to with a last summary.
R1-Zero vs R1
R1-Zero applies Reinforcement Learning (RL) straight to DeepSeek-V3-Base with no monitored fine-tuning (SFT). RL is used to optimize the model's policy to optimize benefit.
R1-Zero attains exceptional accuracy but sometimes produces complicated outputs, such as mixing several languages in a single action. R1 repairs that by including restricted monitored fine-tuning and numerous RL passes, which improves both correctness and readability.
It is interesting how some languages might reveal certain ideas much better, which leads the model to pick the most meaningful language for the task.
Training Pipeline
The training pipeline that DeepSeek released in the R1 paper is exceptionally fascinating. It showcases how they produced such strong thinking models, and what you can get out of each stage. This includes the problems that the resulting designs from each phase have, and how they fixed it in the next phase.
It's interesting that their training pipeline differs from the typical:
The usual training strategy: Pretraining on big dataset (train to anticipate next word) to get the base design _ monitored fine-tuning _ preference tuning by means of RLHF
R1-Zero: Pretrained _ RL
R1: Pretrained _ Multistage training pipeline with several SFT and RL stages
Cold-Start Fine-Tuning: Fine-tune DeepSeek-V3-Base on a few thousand Chain-of-Thought (CoT) samples to make sure the RL process has a decent beginning point. This offers a great design to start RL.
First RL Stage: Apply GRPO with rule-based benefits to enhance reasoning accuracy and formatting (such as forcing chain-of-thought into thinking tags). When they were near merging in the RL procedure, they moved to the next action. The outcome of this step is a strong reasoning model however with weak general abilities, e.g., bad formatting and language blending.
Rejection Sampling + basic information: Create brand-new SFT information through rejection tasting on the RL checkpoint (from action 2), combined with supervised information from the DeepSeek-V3-Base design. They collected around 600k top quality reasoning samples.
Second Fine-Tuning: Fine-tune DeepSeek-V3-Base again on 800k total samples (600k thinking + 200k general jobs) for wider abilities. This step led to a strong reasoning model with general abilities.
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 also did model distillation for several Qwen and Llama designs on the thinking traces to get distilled-R1 designs.
Model distillation is a technique where you use an instructor model to enhance a trainee design by creating training data for the trainee design.
The instructor is usually a larger model than the trainee.
Group Relative Policy Optimization (GRPO)
The fundamental idea behind utilizing support learning for LLMs is to fine-tune the model's policy so that it naturally produces more accurate and helpful responses.
They utilized a benefit system that inspects not only for accuracy however also for appropriate formatting and language consistency, so the design gradually learns to favor reactions that fulfill these quality criteria.
In this paper, they encourage the R1 model to produce chain-of-thought thinking through RL training with GRPO.
Rather than including a separate module at inference time, the training process itself pushes the design to produce detailed, detailed outputs-making the chain-of-thought an emerging behavior of the enhanced policy.
What makes their approach particularly interesting is its reliance on straightforward, rule-based benefit functions.
Instead of depending upon expensive external models or human-graded examples as in traditional RLHF, the RL used for R1 utilizes simple requirements: it may offer a higher benefit if the answer is right, if it follows the expected/ formatting, and forum.kepri.bawaslu.go.id if the language of the response matches that of the timely.
Not counting on a benefit design likewise means you don't have to hang around and effort training it, and it doesn't take memory and calculate far from your main model.
GRPO was presented in the DeepSeekMath paper. Here's how GRPO works:
1. For each input prompt, the model generates various reactions.
2. Each action receives a scalar reward based upon aspects like precision, formatting, and language consistency.
3. Rewards are changed relative to the group's efficiency, essentially determining how much better each reaction is compared to the others.
4. The design updates its strategy a little to favor reactions with higher relative advantages. It just makes small adjustments-using methods like clipping and a KL penalty-to guarantee the policy doesn't wander off too far from its initial behavior.
A cool element of GRPO is its versatility. You can utilize simple rule-based benefit functions-for instance, granting a reward when the model correctly uses the syntax-to guide the training.
While DeepSeek used GRPO, you could use alternative methods rather (PPO or PRIME).
For those aiming to dive much deeper, Will Brown has actually composed rather a great application of training an LLM with RL using GRPO. GRPO has actually also already been added to the Transformer Reinforcement Learning (TRL) library, which is another good resource.
Finally, Yannic Kilcher has an excellent video explaining GRPO by going through the DeepSeekMath paper.
Is RL on LLMs the course to AGI?
As a last note on explaining DeepSeek-R1 and the methodologies they've provided in their paper, I wish to highlight a passage from the DeepSeekMath paper, based upon a point Yannic Kilcher made in his video.
These findings indicate that RL enhances the design's total efficiency by rendering the output distribution more robust, to put it simply, it appears that the improvement is associated to enhancing the right reaction from TopK instead of the enhancement of fundamental capabilities.
Simply put, RL fine-tuning tends to shape the output distribution so that the highest-probability outputs are most likely to be correct, even though the total capability (as determined by the variety of right responses) is mainly present in the pretrained model.
This recommends that support learning on LLMs is more about refining and "shaping" the existing distribution of actions rather than enhancing the model with totally brand-new abilities.
Consequently, while RL methods such as PPO and GRPO can produce considerable efficiency gains, there appears to be an intrinsic ceiling determined 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 big turning point. I'm delighted to see how it unfolds!
Running DeepSeek-R1
I've utilized DeepSeek-R1 through the main chat interface for various issues, which it appears to resolve all right. The additional search functionality makes it even nicer to utilize.
Interestingly, o3-mini(-high) was released as I was writing this post. From my initial testing, R1 seems more powerful at math 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 model would carry out when released on a single H100 GPU-not to thoroughly test the design's capabilities.
671B through Llama.cpp
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 operating on the GPU), running through llama.cpp:
29 layers appeared to be the sweet spot given this configuration.
Performance:
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 local gaming setup.
Digital Spaceport composed a complete guide on how to run Deepseek R1 671b totally 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 rather bearable for any serious work, however it's enjoyable to run these big designs on available hardware.
What matters most to me is a combination of effectiveness and time-to-usefulness in these designs. Since reasoning models need to believe before responding to, their time-to-usefulness is usually higher than other models, however their effectiveness is likewise typically greater.
We need to both take full advantage of effectiveness and lessen time-to-usefulness.
70B through Ollama
70.6 b params, 4-bit KM quantized DeepSeek-R1 running by means of Ollama:
GPU utilization soars here, as anticipated when compared to the mainly CPU-powered run of 671B that I showcased above.
Resources
DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning
[2402.03300] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
DeepSeek R1 - Notion (Building a totally regional "deep researcher" with DeepSeek-R1 - YouTube).
DeepSeek R1's dish 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 R1 Explained to your grandmother - YouTube
DeepSeek
- Try R1 at chat.deepseek.com.
GitHub - deepseek-ai/DeepSeek-R 1.
deepseek-ai/Janus-Pro -7 B · Hugging Face (January 2025): Janus-Pro is an unique autoregressive structure that combines multimodal understanding and generation. It can both comprehend and create images.
DeepSeek-R1: Incentivizing Reasoning Capability in Large Language Models by means of Reinforcement Learning (January 2025) This paper introduces DeepSeek-R1, an open-source thinking model that measures up to the performance of OpenAI's o1. It provides a detailed method for training such models using large-scale reinforcement learning techniques.
DeepSeek-V3 Technical Report (December 2024) This report talks about the application of an FP8 combined accuracy training framework confirmed on an incredibly large-scale model, attaining both sped up training and decreased GPU memory use.
DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (January 2024) This paper explores scaling laws and provides findings that help with the scaling of massive models in open-source setups. It introduces the DeepSeek LLM job, devoted to advancing open-source language models with a long-lasting perspective.
DeepSeek-Coder: When the Large Language Model Meets Programming-The Rise of Code Intelligence (January 2024) This research study presents the DeepSeek-Coder series, a series of open-source code designs trained from scratch on 2 trillion tokens. The designs are pre-trained on a premium project-level code corpus and utilize a fill-in-the-blank job 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, a Mixture-of-Experts (MoE) language design characterized by affordable training and effective inference.
DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence (June 2024) This research presents DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model that attains efficiency comparable to GPT-4 Turbo in code-specific jobs.
Interesting events
- Hong Kong University duplicates R1 outcomes (Jan 25, '25).
- Huggingface reveals huggingface/open-r 1: Fully open recreation of DeepSeek-R1 to replicate R1, totally open source (Jan 25, '25).
- OpenAI researcher validates the DeepSeek team independently found and used some core concepts the OpenAI group used en route to o1
Liked this post? Join the newsletter.
Hors ligne
Pages: 1