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.
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.
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.
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.
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.
DeepSeek-V3.2 adds DeepSeek Sparse Attention to V3.1-Terminus by continued training: a lightning indexer picks 2048 tokens per query, so core attention drops from O(L²) to O(Lk). Then scaled-up GRPO and 1,800+ synthetic environments. I recompute the numbers and rebuild DSA in miniature.
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.
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.
DeepSeek-V2 (DeepSeek-AI, 2024) is a 236B-parameter MoE model that activates 21B per token: Multi-head Latent Attention (MLA) shrinks the inference cache and DeepSeekMoE lowers training cost. This post rechecks 93.3%, 236B and 21B, and verifies MLA's absorption and decoupled RoPE numerically.
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.