Mixture of Experts

Wiki chapters and blog posts about Mixture of Experts.

Wiki

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

Modern LLM Architecture: From GPT-2 to Llama, Qwen and DeepSeek

Almost every mainstream open LLM is a refined decoder-only Transformer: Pre-Norm with RMSNorm, a SwiGLU feed-forward network, RoPE positions and GQA attention, and some add mixture of experts (MoE) to grow parameters without growing compute in proportion.

Intermediate 15 min read

Collective Communication: Why All-Reduce Has So Many Algorithms

Collective communication is the plumbing of multi-GPU training. This page simulates five all-reduce algorithms and checks them element by element, compares rounds and traffic with the alpha-beta model, then shows how topology, summation order and MoE all-to-all change the choice.

Advanced 48 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

GSPO: Moving Importance Ratios and Clipping From Tokens to Whole Responses

GSPO (Group Sequence Policy Optimization), from the Qwen team in 2025, replaces GRPO's per-token importance ratios and clipping with one length-normalized ratio per response, and reportedly needs no Routing Replay for MoE models. This post reviews it and verifies its gradients in code.

Paper notes arXiv 2025

MiniMax-01: Lightning Attention and million-token context

MiniMax-01 combines seven Lightning Attention layers with one softmax layer per eight, using a 456B-parameter MoE with 45.9B active parameters and reporting inference contexts up to four million tokens.

Paper notes arXiv 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

Mixtral of Experts: An Open MoE That Matches Llama 2 70B with 13B Active Parameters

Mixtral 8x7B keeps Mistral 7B's architecture but replaces every feed-forward layer with 8 experts and routes each token to 2: about 47B parameters in total, about 13B used per token. This post covers the architecture, the benchmark evidence, the routing analysis and which claims deserve a discount.

Paper notes arXiv 2024

Topics