Availit World How AI really works, in your language

Lesson 44 of 4644 minFacts checked October 21, 2026

A tour of DeepSeek’s papers: one lab’s ideas, in order

From January 2024 to September 2026, DeepSeek, a lab in Hangzhou, China, published a paper for almost every model it released, more than a dozen in all, free on arXiv, with the weights free to download. Read in order, they show one team learning the standard recipe and then replacing it piece by piece: attention that needs 437 times less memory per token, experts balanced without an extra loss, training in 8-bit and then 4-bit numbers, and reasoning learned from rewards. Other labs now use several of those pieces. This lesson is a guided tour, stop by stop. At each stop you will see what to read first, what the key table shows, and one claim to check with the tools of the last two lessons.

In this lesson you will

  • Know the main DeepSeek papers, in order, and what each one added
  • Read the scaling laws and the data pipeline of DeepSeek’s 2024 papers
  • Recompute a famous efficiency claim and find what it really includes
  • Turn DeepSeek-V3’s load balancing into code that runs
  • Read the parts of the R1 paper most readers skip: failures, distillation and limits
  • Follow five ideas from model to model, up to DeepSeek-V4 and V4.1-Flash
  • Have a method for reading any new paper in the series
On this page
  1. The lab and its papers
  2. The map
  3. Stop 1, 2024: learning the recipe
  4. Stop 2, 2024: less memory, less money
  5. Stop 3, 2025: reasoning, and the parts most readers skip
  6. Stop 4, 2025 and 2026: reading less, remembering more
  7. Stop 5, 2026: DeepSeek-V4 and V4.1-Flash
  8. Five threads through the series
  9. How to read a DeepSeek paper
  10. Remember
  11. Check yourself

The lab and its papers

DeepSeek was set up in July 2023 by High-Flyer, an investment firm in Hangzhou that already used AI for trading, and it is led by Liang Wenfeng, one of High-Flyer’s founders. Its papers are credited to “DeepSeek-AI”, with the names of the people who did the work, now several hundred, listed at the end. Most are technical reports that nobody outside the lab reviewed. A few went through peer review, among them DeepSeekMoE at ACL 2024, one of the main language-technology conferences; DeepSeek-R1, published in Nature in September 2025; and the Native Sparse Attention paper, which won a best paper award at ACL 2025.

In a July 2024 interview with Waves, a Chinese technology magazine from 36Kr, Liang said that publishing and releasing their work cost the company little and earned its researchers respect, and that Chinese labs should contribute original ideas instead of only following others. He also said that the team behind DeepSeek-V2 included no one who had returned from studying or working abroad: it was mostly recent graduates and PhD students of Chinese universities, working with fewer GPUs, and slower links between them, than the largest labs had. Their papers are a record of what such a team can do when it writes everything down.

  • Where to find them: arXiv for the papers, github.com/deepseek-ai for the code, and huggingface.co/deepseek-ai for the weights and each model’s config.json.
  • The licence: most recent models, from R1 to V4.1-Flash, are released under the MIT licence, which allows almost any use, including commercial use.
  • Other branches: DeepSeek has also published on code (DeepSeek-Coder), proving theorems (DeepSeek-Prover), images (DeepSeek-VL and Janus), its own GPU cluster (Fire-Flyer) and chip design (a 2025 hardware paper, in the hardware lesson). This tour follows the main language models.

Quick check

Which DeepSeek paper went through peer review at a scientific journal?

Show the answer

Answer: DeepSeek-R1, in Nature R1 was published in Nature in September 2025. The V3 and V4 reports are technical reports, checked only by the lab.

The map

The main line, paper by paper
Paper (arXiv)DateWhat it addedTaught in
DeepSeek LLM (2401.02954)Jan 2024Its own scaling laws; dense 7B and 67B models on 2 trillion tokensThis lesson
DeepSeekMoE (2401.06066)Jan 2024Fine-grained and shared expertsThe mixture-of-experts lesson
DeepSeekMath (2402.03300)Feb 2024A 120-billion-token maths dataset from the web; GRPOThe reasoning lesson
DeepSeek-V2 (2405.04434)May 2024MLA, a compressed KV cache; 236B parameters, 21B activeThe KV-cache lesson
DeepSeek-V3 (2412.19437)Dec 2024FP8 training, balancing with a bias, multi-token prediction; 671B, 37B activeThe pretraining and hardware lessons
DeepSeek-R1 (2501.12948)Jan 2025Reasoning learned by reinforcement learningThe reasoning lesson
Native Sparse Attention (2502.11089)Feb 2025Sparse attention trained from the startThis lesson
DeepSeek-OCR (2510.18234)Oct 2025Text stored as images, with about 10 times fewer tokensThe vision lesson
DeepSeek-V3.2 (2512.02556)Dec 2025DeepSeek Sparse Attention; reinforcement learning at scale for agentsThe long-context lesson
mHC (2512.24880)Dec 2025A wider residual stream that stays stableThis lesson
Engram (2601.07372)Jan 2026Memory looked up by the recent tokensThe mixture-of-experts lesson
DeepSeek-V4 (2606.19348)Apr 2026Compressed attention for 1 million tokens, mHC, the Muon optimizer; 1.6T, 49B activeThe long-context lesson
DeepSeek-V4.1-Flash (2609.19969)Sep 2026An encoder-decoder split, a KV cache of 890 bytes per token, built-in visionThis lesson

Dates are those of the first arXiv version. Most of the ideas are taught in earlier lessons; this lesson connects them and adds what they left out.

Try itSix models, two scales

This interactive part needs JavaScript.

Quick check

In the chart, which number changed least from 2024 to 2026?

Show the answer

Answer: Parameters used per token Total parameters grew about 24 times and the longest prompt 256 times, but the parameters used per token stayed between 13 and 67 billion, because each token runs only a few experts.

Stop 1, 2024: learning the recipe

DeepSeek’s first paper, on DeepSeek LLM, began where every lab begins: with its own scaling laws, the rules of the pretraining lesson for how big a model and how much data a compute budget deserves. It measured a model not by its parameter count but by M, the computation per token, including attention, which predicted the results better. It also fitted rules for the best batch size and learning rate at each budget.

The scaling laws of DeepSeek LLM (2024)
η_opt = 0.3118 × C^−0.1250

the best learning rate falls slowly as the compute budget C, in FLOPs, grows

B_opt = 0.2920 × C^0.3271

the best batch size, in tokens, grows with the budget

M_opt = 0.1715 × C^0.5243 and D_opt = 5.8316 × C^0.4757

how to split the budget between model size M and data D; the powers add up to 1 because C = M × D

C = 10^24 → η ≈ 3.1 × 10^−4, B ≈ 21 million tokens, M ≈ 6.6 × 10^11, D ≈ 1.5 × 10^12

for that budget: a model of roughly 100 billion parameters trained on 1.5 trillion tokens

The paper also found that the better the data, the more of a bigger budget should go to a bigger model. And it reported a choice worth noticing: adding 20 million multiple-choice questions raised the model’s scores on multiple-choice tests, but the team left them out of training, writing that it would mean overfitting to the benchmarks and would not make the model more truly intelligent. That is the evals lesson’s warning, taken seriously by the people being measured.

A month later, DeepSeekMath showed how to build a dataset from the open web. It started from OpenWebMath, a public collection of maths pages, and trained a small, fast fastText classifier on 500,000 maths pages and 500,000 ordinary ones. The classifier searched Common Crawl, the found pages became new examples, and the search ran again.

How DeepSeekMath found 35.5 million maths pages
  1. Seedmaths pages from OpenWebMath
  2. Train a classifierfastText: maths or not?
  3. Search Common Crawlkeep the pages it scores as maths
  4. Add what it foundand train the classifier again
  5. Stop after four roundsnearly 98 % of round four’s pages had already been found in round three
  6. Result35.5 million pages, 120 billion tokens
  • Training on arXiv papers did not help on the maths tests the authors used. Clean, formal text is not automatically good teaching material.
  • Training on code did help with maths, both when the model wrote a program to solve a problem and when it did not.
  • GRPO was introduced here, the method of the reasoning lesson. The paper also found that reinforcement learning raised the score when the model’s answers were combined by majority vote (Maj@K), but not the chance that at least one of K answers was right (Pass@K). In other words, it made the model more reliable at what it could already do rather than able to solve new problems. That question returned in 2025, as the reasoning lesson tells.

Quick check

DeepSeekMath found that reinforcement learning raised Maj@K but not Pass@K. What does that suggest?

Show the answer

Answer: The model got more reliable at answers it could already sometimes find Pass@K counts a problem as solved if any of K answers is right. If that does not rise, the model is not finding new solutions; it is finding the ones it already could more often, which lifts the majority vote.

Stop 2, 2024: less memory, less money

DeepSeek-V2 (May 2024) brought the two ideas that define the series: MLA and DeepSeekMoE, together in one model of 236 billion parameters, 21 billion active, trained on 8.1 trillion tokens. Against the earlier DeepSeek 67B, the paper reports 42.5 % lower training cost, a 93.3 % smaller KV cache and 5.76 times the maximum generation speed: more than 50,000 tokens per second on one server with eight H800 GPUs. DeepSeek priced V2 at a small margin over its own cost, and in the interview above Liang described how other Chinese companies then cut their prices to match.

The 93.3 % is quoted everywhere, often as the effect of MLA. The paper does not show how it was calculated, but the model sizes are public, so we can check it.

kv_check.py: recomputing two of DeepSeek’s numberspython
"""kv_check.py: check two numbers from DeepSeek's papers with nothing but arithmetic.
The sizes come from each model's config.json and paper. Run: python kv_check.py"""

def kv_bytes(numbers_per_layer, layers, bits):
    return numbers_per_layer * layers * bits / 8

# DeepSeek LLM 67B (2024): grouped-query attention, 8 key-value heads of 128 numbers each, 95 layers
old = kv_bytes(2 * 8 * 128, 95, 16)  # a key and a value per head, in BF16 (16 bits)

# DeepSeek-V2 (2024): MLA keeps one compressed vector of 512 numbers plus a 64-number RoPE key, 60 layers
mla16 = kv_bytes(512 + 64, 60, 16)   # in BF16
mla6 = kv_bytes(512 + 64, 60, 6)     # in 6 bits on average, as the paper says V2 is served

print(f"DeepSeek 67B:             {old:9,.0f} bytes per token")
print(f"DeepSeek-V2, MLA, BF16:   {mla16:9,.0f} bytes per token, {1 - mla16 / old:.1%} less")
print(f"DeepSeek-V2, MLA, 6 bits: {mla6:9,.0f} bytes per token, {1 - mla6 / old:.1%} less")

# DeepSeek-V4.1-Flash (2026) reports 890 bytes per token for the cache it keeps in GPU memory
print(f"DeepSeek-V4.1-Flash:      {890:9,} bytes per token, {old / 890:.0f} times less than the 67B")
  • The 67B model’s numbers come from its config.json: 95 layers, 8 key-value heads, 128 numbers per head. V2’s come from its paper: 60 layers, a compressed vector of 512 and a RoPE key of 64.
  • A byte is 8 bits, so BF16 takes 2 bytes per number.
What it printedtext
DeepSeek 67B:               389,120 bytes per token
DeepSeek-V2, MLA, BF16:      69,120 bytes per token, 82.2% less
DeepSeek-V2, MLA, 6 bits:    25,920 bytes per token, 93.3% less
DeepSeek-V4.1-Flash:            890 bytes per token, 437 times less than the 67B
  • MLA alone, in BF16, gives 82.2 %. Storing the cache in 6 bits, which the paper describes for serving V2, gives exactly 93.3 %. So the famous number very probably combines MLA with a smaller number format.
  • Neither part is a trick, and both are real savings. But a reader who credits all 93.3 % to MLA expects more from it than it gives. When a paper does not show a calculation, redo it.

DeepSeek-V3 (December 2024) is the paper to read most carefully. Section 2 is the model, section 3 the engineering, and Table 1 the cost. Section 3.5 is unusual: a list of requests to chip makers, such as more precise FP8 sums inside the GPU, written by a lab that had to work around the chips it had.

  • Experts: 1 shared and 256 routed experts per layer, 8 chosen per token, each token sent to at most 4 machines. The first three layers stay dense.
  • Balancing: a bias per expert, as in the mixture-of-experts lesson, moved by 0.001 after each step for the first 14.3 trillion tokens and then frozen, plus a very small extra loss (weight 0.0001) that only stops extreme imbalance within one text.
  • FP8 training: activations share a scale in groups of 1 × 128 numbers and weights in blocks of 128 × 128, so one large value spoils only its own group. Running sums are moved to FP32 every 128 numbers. In tests on smaller models, the training loss stayed within 0.25 % of a BF16 run.
  • DualPipe: a pipeline schedule that runs computation while data moves between GPUs, so fewer GPUs sit waiting.
  • Stability: the paper reports no loss spikes it could not recover from, and no rollbacks to an earlier checkpoint, over the whole run.
  • Cost: 180,000 GPU-hours per trillion tokens, 3.7 days on its 2,048 H800 GPUs; 2.788 million GPU-hours in all, or $5.576 million at the $2 an hour the paper assumes. The paper says plainly that this leaves out earlier research and experiments, as the pretraining lesson explains.

Balancing is described in one paragraph of section 2.1.2. Here it is as code: a router that, left alone, sends almost a quarter of all choices to one expert.

balance.py: DeepSeek-V3’s balancing with a biaspython
"""balance.py: the auxiliary-loss-free load balancing of DeepSeek-V3 (section 2.1.2), as a small simulation.
16 experts, and each token picks 2. Some experts start out more attractive, so a few get most of the tokens.
pip install numpy, then: python balance.py"""
import numpy as np

rng = np.random.default_rng(0)
E, K, D = 16, 2, 32                    # 16 experts, 2 chosen per token, tokens are vectors of 32 numbers
GAMMA, STEPS, BATCH = 0.01, 300, 4096  # γ, the bias update speed (DeepSeek-V3 used 0.001 over far more steps)

W = rng.normal(0, 1, (E, D)) / np.sqrt(D)  # the router: one row of weights per expert
lean = np.linspace(-1.5, 1.5, E)           # expert 16 starts out much more attractive than expert 1

def route(x, b):
    s = 1 / (1 + np.exp(-(x @ W.T + lean)))    # s_i,t: each token's affinity for each expert (a sigmoid)
    top = np.argsort(-(s + b), axis=1)[:, :K]  # choose the top K by s + b: the bias is used only here
    g = np.take_along_axis(s, top, axis=1)
    g = g / g.sum(axis=1, keepdims=True)       # the gate values that weight each expert come from s alone
    return top, g

b = np.zeros(E)  # one bias per expert, all starting at zero
for step in range(STEPS + 1):
    x = rng.normal(0, 1, (BATCH, D))               # a new batch of tokens
    top, g = route(x, b)
    load = np.bincount(top.ravel(), minlength=E) / top.size  # each expert's share of all the picks
    if step in (0, 10, 30, 100, 300):
        print(f"step {step:3}: busiest expert {load.max():5.1%}, quietest {load.min():5.1%}"
              f"  (perfectly even: {1 / E:.2%})")
    b -= GAMMA * np.sign(load - 1 / E)             # overloaded: lower its bias by γ; underloaded: raise it by γ
  • s + b is used only to choose the top 2 experts; the gate values that weight their outputs still come from s alone, as the paper specifies. That is why the bias does not change what the model computes for a chosen expert.
  • The router here is fixed so that only the bias changes. In real training the router learns at the same time.
  • We used γ = 0.01 so the effect shows in 300 steps. With the paper’s 0.001 it took about 10 times as many steps and ended at a similar spread.
What it printedtext
step   0: busiest expert 23.6%, quietest  0.0%  (perfectly even: 6.25%)
step  10: busiest expert 14.9%, quietest  0.2%  (perfectly even: 6.25%)
step  30: busiest expert  7.1%, quietest  5.3%  (perfectly even: 6.25%)
step 100: busiest expert  7.0%, quietest  5.5%  (perfectly even: 6.25%)
step 300: busiest expert  6.8%, quietest  5.1%  (perfectly even: 6.25%)
  • At the start one expert gets 23.6 % of the picks and another none at all. Within 30 steps every expert gets between about 5 and 7 %.
  • It never becomes perfectly even. Each batch gives each expert only about 512 picks, so some spread is chance, and each bias always moves by a full step γ.

Quick check

In DeepSeek-V3’s balancing, where is an expert’s bias used?

Show the answer

Answer: Only when choosing which experts a token goes to The bias is added only to pick the top experts. The weights that mix the chosen experts’ outputs come from the original scores, so balancing does not distort the computation, and no extra loss pulls against learning.

Stop 3, 2025: reasoning, and the parts most readers skip

The reasoning lesson tells the story of DeepSeek-R1: R1-Zero learning to reason from rewards alone, its AIME 2024 score rising from 15.6 % to 71.0 % during training, and the four-stage recipe of R1. Three parts of the paper get less attention and teach just as much.

  • Unsuccessful attempts. The team tried process reward models, which score every step, and found that steps are hard to define, that the reward model gets gamed, and that retraining it costs too much. It tried Monte Carlo tree search, as in game-playing AI, and found the space of possible texts far larger than a board game’s and the value model too hard to train. Papers rarely report what failed; this one saves others months.
  • Distillation against reinforcement learning, in the table below.
  • Limitations. R1 was weaker than V3 at function calling, multi-turn chat and JSON output; few-shot examples in the prompt made it worse; and it was “optimized for Chinese and English”, so questions in other languages could make it reason and answer in English.
Distillation or reinforcement learning for a 32B model? (Table 6 of the R1 paper)
ModelAIME 2024MATH-500GPQA DiamondLiveCodeBench
QwQ-32B-Preview (Qwen’s reasoning model)50.090.654.541.9
Qwen-32B-Base with large-scale RL, like R1-Zero47.091.655.040.2
Qwen-32B-Base fine-tuned on R1’s outputs (distilled)72.694.362.157.2

Pass@1 in %, averaged over several samples per question. AIME 2024 has only 30 problems, so each one is worth more than 3 points.

The authors drew two conclusions: distilling a stronger model into a smaller one works very well, and reinforcement learning on a small model takes enormous compute and may not catch up. Read it with the evals lesson in mind. MATH-500’s 2.7-point gap is within the noise for 500 questions, and AIME’s 30 problems make even 25 points less certain than they look. The evidence is the pattern: distillation wins on all four tests, and by 7 to 26 points on three of them.

The Nature version of September 2025 added what the reviewers asked for: more detail on the training data and on safety, and less wording that made the model sound human. Its supplementary material put the cost of training R1 itself at about $294,000 of GPU time, on top of the roughly $6 million for the base model.

Quick check

R1’s paper says it was optimised for Chinese and English. What does that mean for someone asking it a question in Urdu or Hausa?

Show the answer

Answer: It may think, and even answer, in English instead The paper lists language mixing as a limitation: in other languages the model could switch to English. The next lesson is about how well AI serves each language, and how to check.

Stop 4, 2025 and 2026: reading less, remembering more

After R1, the papers turn to long contexts and to new kinds of sparsity. Each is short enough for a first pass in ten minutes.

  • Native Sparse Attention (February 2025), with Peking University and the University of Washington: each query reads compressed summaries of blocks of earlier tokens, a few blocks chosen in full, and a window of recent tokens, and the model is trained this way from the start. On a 27B model it matched full attention, and at 64,000 tokens the authors measured up to 11.6 times faster decoding. Liang Wenfeng is one of its authors.
  • DeepSeek-V3.2 (December 2025): DeepSeek Sparse Attention, where a small, fast indexer picks the 2,048 most useful earlier tokens for each query (the long-context lesson), plus reinforcement learning at a much larger scale and a pipeline that creates practice tasks for agents. A high-compute version, V3.2-Speciale, reached gold-medal level on the problems of the 2025 International Mathematical Olympiad and International Olympiad in Informatics, according to DeepSeek.
  • DeepSeek-OCR (October 2025): a page of text, stored as an image, needs about 10 times fewer tokens than the text itself and can still be read back about 97 % correctly; at 20 times it falls to about 60 %. The paper suggests this as a cheap way to keep old context (the vision lesson).
  • Engram (January 2026): a huge table of stored patterns, looked up by the last few tokens at almost no cost (the mixture-of-experts lesson). At 27B parameters it beat an MoE model of the same size and computation, by 3.4 points on MMLU and 5.0 on BBH.

Which year did each idea first appear in a DeepSeek model?

0 of 8 sorted
  • MLA, the compressed KV cache

    Answer: 2024

  • Training a 671B model mostly in FP8

    Answer: 2024

  • Balancing experts with a bias

    Answer: 2024

  • Reasoning learned from rule-based rewards (R1)

    Answer: 2025

  • A lightning indexer that picks 2,048 earlier tokens

    Answer: 2025

  • The Muon optimizer

    Answer: 2026

  • Compressed Sparse and Heavily Compressed Attention

    Answer: 2026

  • Splitting the layers into an encoder and a decoder

    Answer: 2026

Stop 5, 2026: DeepSeek-V4 and V4.1-Flash

DeepSeek-V4 (April 2026) brings the earlier ideas together. Start with section 2.1, “Designs inherited from DeepSeek-V3”: it tells you what is not new, so that you can spend your time on what is. Then read 2.2 (mHC), 2.3 (the new attention) and 2.4 (the optimizer).

DeepSeek-V4’s two models, from section 4.2 of the paper
V4-FlashV4-Pro
Layers4361
Width of each token’s vector4,0967,168
Routed and shared experts256 + 1384 + 1
Experts per token66
Compressed entries each query picks (CSA)5121,024
Training tokens32 trillion33 trillion
Parameters, total and active284B, 13B1.6T, 49B

Both read up to 1 million tokens. Compare these with the models’ config.json files on Hugging Face; the files are what actually runs.

  • Attention: CSA squeezes every 4 tokens into one entry and an indexer picks the top ones; HCA squeezes every 128 tokens into one and reads them all; layers alternate, and every layer also sees the last 128 tokens in full (the long-context lesson). The cache is stored in FP8, except the 64 position numbers, which stay in BF16.
  • Experts: stored in FP4, with quantization-aware training during post-training (the quantization lesson). The first three layers, dense in V3, are now expert layers that choose experts by a fixed hash of the token instead of a router, and the limit on how many machines a token may visit is gone.
  • Optimizer: Muon, which orthogonalises each update matrix so that no single direction dominates, for most weights; AdamW for the embeddings, the output layer and the normalisation weights.
  • Post-training: more than ten specialists, for maths, code, agents and more, each fine-tuned and then trained with GRPO, are distilled into one model that learns from its own answers (on-policy distillation). It has three modes, from no thinking to “Think Max”, and for tasks no program can check, the model itself acts as the judge, guided by written rubrics.

DeepSeek-V4.1-Flash (September 2026) was built for agents, whose prompts are long, with tools’ outputs and whole files, while their answers are short. Its 40 layers are split into a 20-layer encoder and a 20-layer decoder, and the decoder’s memory is computed from the encoder’s output. Reading a prompt therefore needs only the first 20 layers, which nearly halves the work. Layers share their KV cache and their choice of tokens, the cache is stored in FP4, and the part kept in GPU memory is 890 bytes per token, about a quarter of V4-Flash’s. It adds 196 billion parameters of Engram memory to its 552-billion-parameter network, reads images as well as text, and was trained on 45 trillion tokens.

Quick check

Why does V4.1-Flash’s encoder-decoder split make reading a long prompt faster?

Show the answer

Answer: The decoder’s memory is computed from the encoder’s output, so the prompt needs only the first 20 of 40 layers Prefill is where the model reads the prompt. Since the decoder takes its keys and values from the encoder’s last layer, the decoder layers do not have to run over the prompt, and the work nearly halves.

Five threads through the series

The best way to read a series is to follow one idea from paper to paper and ask why it changed each time.

Following one idea across the papers
ThreadStart: DeepSeek LLM 67BMiddle: V2 to V3.2Now: V4 and V4.1
AttentionGrouped-query attention, 8 key-value headsMLA (V2, V3, R1), then MLA with sparse attention (V3.2)CSA and HCA (V4), then CSA2 shared across layers (V4.1)
ExpertsNone: a dense model2 shared + 160 routed, 6 per token (V2); 1 + 256, 8 per token (V3)1 + 384, 6 per token (V4-Pro)
BalancingNot neededThree extra losses and at most 3 devices per token (V2); a bias and at most 4 machines (V3)The same bias, with no machine limit (V4)
Number formatsBF16FP8 training (V3)FP4 experts and an FP8 cache (V4), an FP4 cache (V4.1)
After pretrainingFine-tuning, then DPOGRPO (DeepSeekMath, V2), reinforcement learning from checkable rewards (R1)Specialists trained with GRPO, then distilled into one model (V4)

From the papers and the models’ config.json files.

Most steps attack whatever cost the most at the time: the memory of the cache (MLA), the price of training (MoE and FP8), attention over very long texts (sparse and compressed attention), and in 2026 the cost of the long prompts that agents send (V4.1-Flash). None of these ideas was entirely new: MoE, low-precision formats, sparse attention and hyper-connections all came from earlier work, much of it from other labs. DeepSeek’s strength has been to combine them at full scale, make them work together on the hardware it had, and publish the details.

Quick check

How did DeepSeek’s way of balancing experts change from V2 to V3?

Show the answer

Answer: It replaced three extra balance losses with a bias per expert and a very small loss V2 used expert-level, device-level and communication balance losses. V3 moved to a bias that is used only when choosing experts, keeping just a tiny loss against extreme imbalance within a text.

How to read a DeepSeek paper

  1. Do a first pass: the abstract, the architecture figure, the headings and the conclusion with its limitations. Then find the section on what was inherited, and skip what you already know.
  2. For every efficiency number, find what it is compared with. It is usually DeepSeek’s previous model (V2 against 67B, V4 against V3.2), not other labs’ models.
  3. Open the model’s config.json beside the hyperparameter section. They should agree; if they do not, the file is what runs.
  4. Read the results tables as the evals lesson taught: they are DeepSeek’s own runs, and the settings are in the appendix. Count the questions and look for error bars.
  5. Read the failures and limitations: R1’s unsuccessful attempts and V4’s unexplained fixes are some of the most useful pages in the series.
  6. Look for the follow-ups: the Dr. GRPO paper that questioned R1’s “aha moment”, Hugging Face’s Open-R1 project, which set out to rebuild R1’s training in the open, and the code DeepSeek released.

Your exercise: read section 2.1.2 of the V3 report, about one page, with balance.py beside it, and find each sentence of the paper in the code. Then write a one-page summary of the whole report: the problem, the main ideas, the evidence, one limit and one question you still have.

Quick check

DeepSeek-V4 reports needing 27 % of the computation per token of an earlier model at 1 million tokens. What should you check first?

Show the answer

Answer: Which earlier model it is compared with An efficiency figure means little until you know the baseline. Here it is DeepSeek-V3.2, at a context of 1 million tokens, as the long-context lesson explains.

Remember

  • DeepSeek, set up in Hangzhou in 2023, has published a detailed paper for almost every model, with open weights and much of its code.
  • DeepSeek LLM fitted its own scaling laws, including rules for the batch size and learning rate, and left multiple-choice data out of training to avoid overfitting to tests.
  • DeepSeekMath built 120 billion tokens of maths from the web with a classifier, introduced GRPO, and found that RL improved reliability more than reach.
  • DeepSeek-V2 combined MLA and DeepSeekMoE; its 93.3 % smaller cache very probably combines MLA with a 6-bit format.
  • DeepSeek-V3 added FP8 training, balancing with a bias, multi-token prediction and DualPipe, and stated its costs and what they leave out.
  • R1’s failures, its distillation table and its limits, including language mixing, are as worth reading as its successes.
  • Sparse attention, optical compression, mHC and Engram led to V4, which brought them together, and to V4.1-Flash, built for agents’ long prompts.
  • Follow one idea across the papers: attention, experts, balancing, number formats and post-training each changed for a reason.
  • Read with the config file, the code and the follow-ups beside you, and redo any number the paper does not explain.

Words to know

Technical report
A lab’s own detailed paper about a model, usually not peer reviewed.
Non-embedding FLOPs per token (M)
DeepSeek LLM’s measure of model size: the computation per token, attention included.
fastText classifier
A small, very fast text classifier, used to pick out pages on one subject from billions.
Maj@K and Pass@K
The score when K answers decide by majority vote, and the chance that at least one of K answers is right.
Decoupled RoPE
MLA’s small separate key that carries the position, so the compressed part needs none.
Auxiliary-loss-free balancing
Evening out experts’ loads with a bias used only for choosing, instead of an extra loss.
Fine-grained scaling
Giving each small group of numbers its own scale, so one outlier spoils only its own group.
DualPipe
DeepSeek’s pipeline schedule that overlaps computation with communication between GPUs.
Distillation
Training a smaller model on a larger model’s outputs.
On-policy distillation
Distillation where the student writes its own answers and learns to match the teachers’ probabilities for them.
Doubly stochastic matrix
A matrix with no negative entries whose rows and columns each add up to 1.
mHC
Manifold-constrained hyper-connections: a widened residual stream kept stable by doubly stochastic mixing.
Causal encoder-decoder
V4.1-Flash’s split of its layers, where the decoder’s memory comes from the encoder, so reading a prompt costs nearly half as much.

Go to the source

This lesson is built on these papers and documents. Paper links open arxiv.org, a separate site.

Check yourself

6 questions. Tap the answer you think is right.

0 of 6 answered

Why did DeepSeek LLM leave 20 million multiple-choice questions out of training?

Show the answer

Answer: They raised test scores without making the model more capable, which would be overfitting to the benchmarks The paper reports that the questions improved multiple-choice benchmarks, and chose to exclude them because that gain would not reflect real ability.

How did DeepSeekMath build its 120-billion-token dataset?

Show the answer

Answer: By training a classifier on maths pages, searching Common Crawl, and repeating with what it found Four rounds of classify, search and retrain found 35.5 million pages. Training on arXiv papers, by contrast, did not help.

Recomputed from the model sizes, what does DeepSeek-V2’s 93.3 % smaller KV cache very probably include?

Show the answer

Answer: MLA, plus storing the cache in about 6 bits instead of 16 MLA in BF16 gives 82.2 % less than the 67B model; with the 6-bit format the paper describes for serving, the figure is exactly 93.3 %.

What did the R1 paper find when it compared distillation with reinforcement learning on a 32B model?

Show the answer

Answer: Distilling R1 into the 32B model beat large-scale reinforcement learning on it, on all four tests The distilled model led on AIME, MATH-500, GPQA Diamond and LiveCodeBench, by 7 to 26 points on three of them.

What does mHC require of the matrices that mix the residual streams?

Show the answer

Answer: That they are doubly stochastic: no negative entries, and rows and columns each adding up to 1 Mixing with a doubly stochastic matrix is a form of averaging, so the signal cannot grow out of control across many layers.

What is a good first step when a DeepSeek paper reports a big efficiency gain?

Show the answer

Answer: Find the baseline it is compared with, usually DeepSeek’s own previous model Efficiency numbers are relative. Knowing the baseline, and recomputing the figure where you can, tells you what the gain really is.

Lesson complete

Answer every question above to complete this lesson.

Your progress is saved on this device only.

Next lessonAI in your language: why it lags, and what you can do
Previous lesson All lessons

Choose your language