From DeepSeek-V2 and V3 to R1: which changes save compute, and which improve reasoning?

July 10, 2025

While reading “一文搞懂DeepSeek创新了些啥?” (“What did DeepSeek innovate?”), I came across expert parallelism and load balancing, looked up V3’s training cost, then searched “deepseek用张量并行了吗” (“Did DeepSeek use tensor parallelism?”). There are two senses of 推理 in these questions. V2 wants servers to generate text for more people at once (inference). R1 wants models to derive correct answers on tasks such as mathematics and coding (reasoning). Tokens generated per second can measure the former. The latter requires checking the answers. V3’s engineering also raises a third accounting question: how many GPU-hours does a training run consume?12

V2: how many parameters does one token pass through, and how much history must it read back?

Suppose two users ask questions at once, one writing code and the other revising a travelogue. At a V2 mixture-of-experts (MoE) layer, tokens from both go through two shared experts. The router also selects six of 160 routed experts for each token. Experts are feedforward networks. Routing is learned, so different tokens in the same sentence can take different paths. DeepSeekMoE builds on earlier expert routing by splitting the routed experts more finely. This gives each token more possible combinations, while shared experts handle recurring computations. V2 has 236 billion parameters overall and activates about 21 billion per token. Deployment still has to provide a place for all the experts’ weights.34

Now the travelogue user has generated 2,000 tokens and is about to write another word. To let the new position attend to previous text, servers normally retain the keys and values at past positions in each layer. The memory for these is the KV cache. More concurrent users and longer contexts mean larger caches. V2’s multi-head latent attention (MLA) jointly compresses the keys and values used by multiple heads at one position, caching a shorter vector plus a small separate key for positional information. The next token can still attend to the past, but less data must be stored and retrieved per historical position. V2’s reported 93.3% cache reduction is relative to the team’s earlier DeepSeek 67B. MoE reduces expert computation per token and MLA reduces what each past position leaves in the cache. Both gains can apply together.4

V3: when experts are scattered across machines, how do you keep GPUs from waiting on data?

Selecting only a few experts introduces a scheduling problem dense models don’t have. Suppose many tokens in a batch converge on one expert. Even if the cluster has spare compute, the GPU responsible for that expert can slow the whole batch. V2 used auxiliary losses to balance expert, device, and communication loads. V3 adds an adjustable bias to each expert’s routing score. Busy experts get a slightly lower bias next step and idle ones a higher bias. The bias affects only who gets selected. The original scores still combine expert outputs. V3 also retains a very weak sequence-level balancing loss to prevent extreme skew within a single sequence.45

Even with balanced work, tokens still have to reach experts across machines and the results have to come back. V3 training used 16-way pipeline parallelism, 64-way expert parallelism across eight machines, and ZeRO-1 data parallelism. The team designed DualPipe to split and schedule forward work, backward work, and communication across microbatches. While transferring one batch of tokens, a GPU has another batch ready to compute. This reduces pipeline idle time and overlaps some inter-machine communication with computation.5

Did V3 use tensor parallelism? In that training configuration, the team controlled memory use enough to dispense with tensor parallelism. In serving, the model must first read the whole prompt, a phase called prefill. The deployment described in the report used four-way tensor parallelism for attention during prefill and 32-way expert parallelism for the expert layers. Training and serving the same model can use different divisions of labor.5 How tensor parallelism splits a layer’s matrix multiplication · How does a token find experts spread across two GPUs?

**Where did US5.576millioncomefrom?∗∗TheV3reporttotalspretraining,contextextension,andpost−trainingat∗∗2.788millionH800GPU−hours∗∗,multipliedbyanassumedrentalpriceof5.576 million come from?** The V3 report totals pretraining, context extension, and post-training at **2.788 million H800 GPU-hours**, multiplied by an assumed rental price of 2 per GPU-hour. The team also implemented mixed-precision FP8 training for many matrix multiplications while retaining higher precision for critical operations and accumulation. Low precision, sparsity, and communication scheduling all affect time. Their individual contributions can’t be separated from this total alone. The report explicitly excludes earlier research and ablation experiments. R1’s later training is separate too.5

How does V3 use multi-token prediction during training and generation?

An autoregressive model generates sequentially because the second new token has to wait until the first is determined. During training, the entire original passage is known. The model can score several positions at once while letting each see only preceding context. For a simplified tokenization, take “我 / 喜欢 / 喝 / 茶” (“I / like / drinking / tea”). The standard objective uses the “like” position to predict “drinking” and can simultaneously use “drinking” to predict “tea”.

Multi-token prediction (MTP) adds another training target at the same position. V3’s main model predicts “drinking” at “like”. An auxiliary module combines that position’s representation with the “drinking” token supplied by the training text to predict “tea”. Earlier work tried predicting several future tokens in parallel. V3 links neighboring predictions in order, drawing a denser training signal from the same text. In deployment the auxiliary module can be removed or used to propose subsequent tokens for the main model to verify. Generation rounds are saved when the proposed tokens are accepted.65

R1: when a model samples several solutions to one problem, what does it learn from them?

R1-Zero starts from the pretrained V3-Base. Given a math problem with a known answer, the model tries several solutions. Rules check the answers and output format. The team reused GRPO, previously introduced in DeepSeekMath, to compare the relative scores of answers to the same question and adjust how likely the model is to produce them in future, avoiding a separately trained model for estimating answer value. The R1 report describes this as “without supervised fine-tuning (SFT) as a preliminary step”. What it skipped was teaching the model to imitate demonstrations before reinforcement learning. As training progressed, the team observed the model spending more tokens checking and revising answers, alongside mixed-language output and hard-to-read reasoning.78

The released R1 takes extra steps for readability and general ability. First fine-tune V3-Base on several thousand curated reasoning examples, then apply reasoning-oriented reinforcement learning. Next, sample several answers per question and select about 600,000 reasoning examples. Add about 200,000 general examples such as writing and Q&A and fine-tune V3-Base again. The final RL stage considers both reasoning correctness and whether answers are helpful and safe. The team also directly fine-tuned smaller Qwen and Llama models on these roughly 800,000 examples to produce R1’s distilled versions. When you see R1 in a model name, distinguish the model trained through the full process from a smaller model that learned by imitating the selected answers.8

Did R1 introduce GRPO, and how does it differ from PPO or DPO?

GRPO (Group Relative Policy Optimization) first appeared in the initial DeepSeekMath submission on February 5, 2024. The authors call it “a variant of Proximal Policy Optimization (PPO)” in the abstract. In 2025, R1-Zero used this existing method for reasoning post-training on V3-Base.78

Suppose a model produces four answers to an arithmetic problem with verified scores of 1, 1, 0, 0. Training decides which answers should become more likely. A reward scores a completed answer. A value model (critic) estimates, at a particular position in an answer, the score the continuation can usually expect.

MethodHow the problem supplies a training signalMain cost
PPO (Proximal Policy Optimization)Common language-model implementations use actual returns and value-model predictions to estimate how much better than expected each step was, then adjust the probability of the corresponding tokens. A clipped objective limits the benefit of pushing the new-to-old policy probability ratio too far.9Repeatedly samples answers during training and fits a value function.
GRPO (outcome rewards)Compare the four answers to the same question directly. Their group mean is 0.5, so the two correct answers are above it and the two incorrect ones below. The original algorithm normalizes that difference by the within-group standard deviation and uses PPO-style clipping.7Avoids the value model but generates several answers per problem. If all four score equally, this relative reward has no distinguishing signal.
DPO (Direct Preference Optimization)Training data can directly supply a pair, for example “A is better than C”. A preference loss increases A’s log-probability advantage over C relative to a frozen reference model.10Classic DPO fine-tunes offline on existing preference pairs, without new samples on every step or separately trained reward and value models.
RLOO (REINFORCE leave-one-out)Also generates several answers per question, but A’s baseline uses only the other three. If A scored 1 and the others scored 1, 0, and 0, A beats its baseline by about 0.67.11Also avoids a value model, with the same cost of multiple samples.

So who assigns a score and how the score updates the model are different questions. Math grading rules can supply rewards for PPO or GRPO, as can a reward model that learned human preferences. R1-Zero paired rule-based rewards with GRPO. Classic DPO learns preferences directly from labeled answer pairs.7810

These changes call for different tests. For the same context, compare how many bytes MLA must cache per token. For the same training task, use DualPipe measurements to see how much of a whole step GPUs spend waiting for communication. For R1, even with identical machines and compute budgets, the model must actually solve problems and have its answers checked before we can tell whether the training method improved its reasoning.

Footnotes

  1. 老猫. (2025, February 7). 一文搞懂DeepSeek创新了些啥? 知乎. 原文,V2 的专家并行与负载均衡段落 ↩

  2. 唐国梁Tommy. (2025, February 2). 详解 DeepSeek-V3 的低成本训练之道. 知乎. 原文,“DeepSeek-V3 的主张” ↩

  3. Dai, D., et al. (2024). DeepSeekMoE: Towards ultimate expert specialization in mixture-of-experts language models. arXiv. 细粒度专家与共享专家 ↩

  4. DeepSeek-AI. (2024). DeepSeek-V2: A strong, economical, and efficient mixture-of-experts language model. arXiv. §2 模型架构 · §3 训练配置 ↩ ↩2 ↩3

  5. DeepSeek-AI. (2024). DeepSeek-V3 technical report. arXiv. 表 1 成本口径 · §2 路由与 MTP · §3.2–3.4 训练、精度与部署 ↩ ↩2 ↩3 ↩4 ↩5

  6. Gloeckle, F., et al. (2024). Better & faster large language models via multi-token prediction. arXiv. 独立预测头的方案 ↩

  7. Shao, Z., et al. (2024). DeepSeekMath: Pushing the limits of mathematical reasoning in open language models. arXiv. 首版提交日期 · 首版摘要第 2 段及 §4.1 的算法 ↩ ↩2 ↩3 ↩4

  8. DeepSeek-AI. (2025). DeepSeek-R1: Incentivizing reasoning capability in LLMs via reinforcement learning. arXiv. 引文见摘要第 1 段 · §2.2–2.4 R1-Zero、R1 与蒸馏 ↩ ↩2 ↩3 ↩4

  9. Schulman, J., Wolski, F., Dhariwal, P., Radford, A., & Klimov, O. (2017). Proximal policy optimization algorithms. arXiv. §3 裁剪目标 ↩

  10. Rafailov, R., Sharma, A., Mitchell, E., Manning, C. D., Ermon, S., & Finn, C. (2023). Direct preference optimization: Your language model is secretly a reward model. arXiv. §4 偏好训练目标 ↩ ↩2

  11. Ahmadian, A., et al. (2024). Back to basics: Revisiting REINFORCE style optimization for learning from human feedback in LLMs. arXiv. §2.3 留一法基线 ↩

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-07-10). From DeepSeek-V2 and V3 to R1: which changes save compute, and which improve reasoning?. https://caiborui.com/blog/2025-07-10-zh-deepseek-v2-v3-r1-innovations-entrans

@misc{borui2025-020ee261,
  author = {borui},
  title = {{From DeepSeek-V2 and V3 to R1: which changes save compute, and which improve reasoning?}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-07-10-zh-deepseek-v2-v3-r1-innovations-entrans}
}