DeepSeek

Wiki chapters and blog posts about DeepSeek.

Wiki

Efficient Attention: MQA, GQA, MLA and FlashAttention

Attention has two bottlenecks: the KV cache that decoding rereads at every step, and the N×N score matrix of training and prefill. MQA, GQA and MLA shrink the KV cache; FlashAttention cuts memory traffic with tiling and online softmax, and its output is identical to standard attention.

Intermediate 27 min read

Mixture of Experts (MoE): Routing, Load Balancing and Sparse Activation

A mixture-of-experts layer swaps the feed-forward network for many experts and routes each token to only k of them, so total parameters grow while per-token compute stays small. This page computes total and active parameters for Mixtral and DeepSeek-V3 and lets you try load balancing.

Intermediate 31 min read

Reinforcement Learning for Reasoning: RLVR and GRPO

Since o1 and DeepSeek-R1, making a model think longer before answering has become the main line of post-training. Why verifiable rewards (RLVR) can replace a reward model, how GRPO drops the value model, and the recipe and pitfalls of R1-Zero and R1.

Advanced 21 min read

Blog posts

DeepSeek-V4.1-Flash: Getting the Global KV Cache Down to 890 Bytes per Token

DeepSeek-V4.1-Flash cuts the global KV cache to 890 bytes per token, about 1/4 of V4-Flash and 1/437 of DeepSeek-V1, with a causal encoder-decoder, cross-layer sharing in CSA2 and an FP4 main KV. This post explains the paper and rebuilds its numbers from the public configs.

Paper notes arXiv 2026

mHC: Keeping a Wider Residual Stream Stable With Doubly Stochastic Mixing

mHC (Manifold-Constrained Hyper-Connections) is DeepSeek's fix for hyper-connections: Sinkhorn-Knopp turns the residual mixing matrix into a doubly stochastic one, keeping multi-layer gain bounded, for a reported 6.7% extra training time. This post reviews it and checks the math in code.

Paper notes arXiv 2025

DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning

DeepSeek-R1 shows that large-scale reinforcement learning with automatically checkable rewards lets a base model grow long chains of thought; a cold start and four stages make it usable. We recompute the paper's data and cost tables, list what does not add up, and cover later corrections.

Paper notes arXiv; Nature 645 (2025) 2025

DeepSeek-V3 Technical Report: MoE, MLA, FP8 and Low-Cost Training

DeepSeek-V3 is a 671B-parameter MoE model that activates 37B per token. It adds auxiliary-loss-free balancing and multi-token prediction to MLA and DeepSeekMoE, and trains with FP8 and DualPipe on 2048 H800 GPUs in 2.788M GPU hours. This post covers methods, numbers and limits.

Paper notes arXiv 2024

DeepSeekMath: Math Corpus, GRPO and a Unified View of Reinforcement Learning

DeepSeekMath 7B continues pretraining on 120B tokens of web math, then uses GRPO, reinforcement learning without a value model, to reach 51.7% on MATH with no tools or voting. This post covers the corpus pipeline, ablations, GRPO's math and a unified view of SFT, RFT, DPO, PPO and GRPO.

Paper notes arXiv 2024

Topics