No-op write gate: setting $\beta_t = 0$ leaves the state untouched for uninformative tokens
Key-targeted erasure: $(I - \beta_t k_t k_t^\top)$ removes the old value stored along direction $k_t$ before writing $\beta_t k_t v_t^\top$ (fast-weight / test-time training delta rule)
Why hybrids beat pure linear: fixed-size states lose exact multi-key recall; controlled ablations (ByteDance Seed / UCSC) show 3:1 hybrids match Transformer recall while pure linear drops sharply
Historical 2025 design: MiniMax M1 used a 7:1 lightning-linear to full-attention hybrid for linear scaling in context length
Gated Attention (Qwen, 2025): a sigmoid gate applied after attention improves training stability and allows larger learning rates
Used in full-attention layers of Qwen3-Next / Qwen3.5 and in Kimi K3's gated MLA
Next: how do we compress the global attention layers themselves?
Multi-Head Latent Attention (MLA)
Core idea (DeepSeek V2/V3 → GLM-5.3, Kimi K3): project $\mathbf{h}_t$ to a compact latent $\mathbf{c}_t^{KV} = W^{DKV}\mathbf{h}_t$, with $\mathbf{k}_t^C = W^{UK}\mathbf{c}_t^{KV}$ and $\mathbf{v}_t^C = W^{UV}\mathbf{c}_t^{KV}$
Inference caches only $\mathbf{c}_t^{KV}$ (and queries use $\mathbf{c}_t^Q$ to save training activations)
RoPE conflict:
Without RoPE: $\langle \mathbf{h}W^Q,\, W^{UK}\mathbf{c}_t^{KV}\rangle = \langle \mathbf{h}(W^Q W^{UK}),\, \mathbf{c}_t^{KV}\rangle$ ($W^{UK}$ absorbs into $W^Q$)
With RoPE: $R_q R_k$ sits between $W^Q$ and $W^{UK}$, blocking absorption
Fix: decoupled RoPE on a small extra slice $\mathbf{k}_t^R$ (e.g., GLM-5.3: kv_lora_rank 512 + RoPE dim 64)
MLA shrinks the KV cache per token, yet still attends densely over all $n$ positions unless paired with sparsity.
Alternative to Hybrids: Dynamic Sparse Attention (DSA)
Instead of compressing history into a recurrent state, score all past tokens cheaply and attend only to the top-$k$.
MiniMax Sparse Attention (MSA) MiniMax-M3, June 2026
Replaces MiniMax M1's 2025 7:1 linear hybrid with blockwise sparse attention on GQA
Lightweight index branch selects top-$k$ KV blocks independently per GQA group; main branch runs exact block-sparse attention
MiniMax report: matches GQA quality on a 109B model while cutting per-token attention compute by 28.4× at 1M context
Qwen Sparse Attention (QSA) Qwen3.8-Flash-Next, Aug 2026
125B total / 6B active; retains the 3:1 Gated DeltaNet to global-attention backbone
During continued pretraining, replaces full-attention layers with QSA
Scores micro-blocks using a compressed lightweight indexer (indexer budget 2048 in config)
Trend: the field is moving from linear-plus-dense hybrids toward sparse exact attention inside global layers.
DeepSeek-V4 (2026): CSA + HCA Hybrid
Local backbone: sliding-window attention handles fine-grained local context cheaply (window 128 in DeepSeek-V4.1-Flash)
CSA (Compressed Sparse Attention): compresses KV along the sequence dimension, then runs DSA-style top-$k$ sparse selection
HCA (Heavily Compressed Attention): compresses the sequence KV even more aggressively, then runs dense attention over the compact summary
Pairing sparse selective retrieval (CSA) with a cheap global summary (HCA) covers both needle lookup and broad context.
DeepSeek-V4.1-Flash (Sept 2026): CSA2 & KV Reuse
Config: 1 KV head shared by 64 query heads, head_dim = 512, indexer top-$k = 512$, FP4 KV cache
Global KV footprint: 890 bytes / token (~1/4 of DeepSeek-V4-Flash)
Scale of change: compare 890 bytes / token with ~88 KB / token for BF16 MLA across 78 layers (GLM-5.3) — roughly two orders of magnitude smaller
The 2026 Attention Landscape: Three-Axis Design Space
Model (Release)
Local / Cheap Mixer
Global Layer Ratio
Global Selection / Compression
DeepSeek-V4.1-Flash (Sept 2026)
Sliding window (128)
Cross-layer Full/Reindex/Reuse
CSA2 + FP4 KV (890 B/tok)
Kimi K3 / K3.1 (July 2026)
Kimi Delta Attn (GDN family)
3:1 (3 KDA + 1 global)
Gated MLA
Qwen3.8-Flash-Next (Aug 2026)
Gated DeltaNet
3:1 (3 GDN + 1 global)
QSA micro-block sparse (budget 2048)
GLM-5.3 (2026)
— (all global MLA)
All 78 layers
MLA + DSA top-$k$ (2048)
MiniMax-M3 (June 2026)
— (block-sparse GQA)
All global (sparse)
MSA per-GQA-group top-$k$ blocks
Nemotron 3.5 (Oct 2026)
Mamba-2
Hybrid Mamba-Transformer
Self-attention layers
Takeaway — three axes of late-2026 attention: (1) cheap local/recurrent mixing, (2) a minority of global layers, and (3) sparse or compressed selection inside those global layers.
Next: Part 2 — tackling the other half of the Transformer block, the dense FFN, with Mixtures of Experts.
Part 2: What Is a Mixture of Experts (MoE)?
Replace the dense FFN with $N$ parallel expert FFNs and a learned router selecting $K \ll N$ experts per token
Core win: increase total parameter count (capacity) without increasing per-token FLOPs
Less common variant: MoE over attention heads (ModuleFormer, JetMoE); standard practice sparsifies the MLP
Adapted from Fedus et al. (2022).
Why MoEs Dominate Frontier LLMs
Same FLOPs, more parameters → lower loss
Switch Transformer (Fedus et al. 2022): test loss drops smoothly from 1 to 256 experts at fixed FLOPs, reaching dense T5-Base perplexity up to 7× faster
OLMoE (1.3B active / 6.9B total vs. 1.3B dense): ~3× fewer FLOPs/tokens and ~2× faster wall-clock training on HellaSwag
DeepSeek controlled ablation (0.2B active / 2.0B total vs. 0.2B dense, 2.9T FLOPs per 2K tokens, 100B tokens): Pile loss drops from 2.060 → 1.881
2026 frontier total-to-active ratios make this decoupling concrete:
2026 Frontier Model
Total / Backbone Params
Active Params / Token
Total : Active
DeepSeek-V4.1-Flash (Sept 2026)
552B backbone
16B decode (8B prefill)
~34× (decode)
Kimi K3 / K3.1 (July 2026)
2.8T
104B
2.8T : 104B
Qwen3.8-Flash-Next (Aug 2026)
125B
6B
125B : 6B
Sparse models give frontier knowledge capacity at a fraction of dense training and inference FLOPs.
Historical Hurdles — and the MoE Design Space
Why MoEs were once hard to adopt
Multi-node systems complexity: hosting all experts requires many GPUs plus high-throughput all-to-all dispatch (Fedus et al. 2022)
Training instability: heuristic objectives and sensitive routers caused loss spikes worse than dense Transformers (Zoph et al. 2022)
What varies across MoE designs?
Routing function: token choice vs. expert choice, softmax vs. sigmoid
By 2026, each hurdle has a clean engineering solution — we examine all three axes next.
Routing Paradigms: Who Chooses Whom?
Token-Choice (TC) dominates autoregressive LMs: each token routes independently; OLMoE ablations show TC outperforms EC on validation loss and HellaSwag
Expert-Choice (EC) guarantees load balance but can drop tokens or leak future positions in causal sequences
Other baselines: Hash routing (fixed token hash, strong non-learned baseline) and RL routing (Bengio 2013; Clark et al. 2020 — high variance)
Top-$K$ Routing: From Softmax to Renormalized Sigmoid
Standard in DeepSeek V3 → V4, Kimi K3, and GLM-5.3
Sigmoid avoids zero-sum logit competition across hundreds of experts while renormalization preserves activation scale.
Fine-Grained Experts and Shared Expert Isolation
Fine-grained segmentation (DeepSeekMoE, Dai et al. 2024): split each FFN into $m$ narrower experts and activate $mK$ of them → identical active FLOPs, exponentially more combinations $\binom{mN}{mK}$
Shared expert isolation (DeepSpeed-MoE → DeepSeekMoE): keep $N_s$ always-on experts for universal features so routed experts avoid redundant copies
Empirical Ablations: Fine-Grained vs. Shared Experts
DeepSeekMoE Ablations (Fixed Params & FLOPs)
Baseline: 0 shared + top-2 of 16 routed (GShard style)
Why it works: $f_i$ is discrete, but $P_i$ is differentiable — $\frac{\partial \mathcal{L}_{\text{aux}}}{\partial p_i(x)} = \frac{\alpha N}{T^2}\sum \mathbb{1}\{\arg\max p(x) = i\}$, so heavily used experts are pushed down harder
DeepSeek V1–V2 extensions: generalize $f_i = \frac{N'}{K'T}\sum_t \mathbb{1}(\text{token } t \text{ selects } i)$, and aggregate by device ($\mathcal{L}_{\text{DevBal}}$)
Without load balancing (OLMoE ablation): routing collapses onto ~2 experts taking 50–100% of tokens, worsening both hardware utilization and C4/Pile validation loss
Aux-Loss-Free Balancing via Per-Expert Biases
Auxiliary losses trade off load balance against language-modeling gradients. DeepSeek-V3 (Dec 2024) decouples them:
router_logits = (x @ W_gate).to(torch.float32)
router_scores = torch.sigmoid(router_logits) # or softmax in FP32
Fix 2 — Router z-loss (Zoph et al. 2022): penalize large logits: $L_z(x) = \frac{1}{B}\sum_{i=1}^{B} \left(\log \sum_{j=1}^{N} e^{x_j^{(i)}}\right)^2$
OLMoE ablation (weight 0.001 vs. none): removing z-loss triggers repeated loss spikes and drops on HellaSwag and MMLU
MoE Systems (1): Expert Parallelism & All-to-All
Expert Parallelism (EP) places disjoint subsets of experts across GPUs (e.g., NVLink-connected NVIDIA Blackwell B200/B300 nodes)
Composes orthogonally with Data Parallelism (DP) and Tensor/Model Parallelism (TP)
Two collective barriers per layer:
All-to-All Dispatch sends routed token activations to destination expert ranks
All-to-All Combine returns expert outputs to each token's home rank
High interconnect bandwidth and overlap with shared-expert / attention compute are critical
MoE Systems (2): Grouped GEMMs & Block-Sparse Kernels
Naive batched GEMMs require every expert to receive an identical fixed capacity, wasting FLOPs on padding or dropping tokens
Block-sparse / Grouped GEMMs (MegaBlocks; custom kernels in CUDA, CUTLASS, CuTe DSL, and Triton) pack ragged per-expert token lists into one fused kernel launch
Enables dropless MoE training and serving without sacrificing Tensor Core occupancy
MoE Systems (3): LatentMoE Cuts All-to-All Traffic
Bottleneck: All-to-All communication volume scales as $K \times d_{\text{model}}$ bytes per token
LatentMoE: down-project activations to $d_{\text{lat}} < d_{\text{model}}$ before dispatch, run routed experts in the latent space, and up-project after combine
From one lab to frontier practice:
Introduced in Nemotron 3 (early-2026) for hardware-aware accuracy per byte
Adopted at 2.8T scale as Stable LatentMoE in Kimi K3 (July 2026)
With fixed capacity_factor, tokens exceeding an expert's buffer are dropped (skipping the FFN via the residual path)
Surprising inference consequence: because routing capacity is shared at the batch level, another user's prompt in the same batch can cause your token to be dropped
This creates cross-request nondeterminism even at temperature 0
Static-Shape MoE via Online Expert Replication
Connecting load balance and fixed capacity: instead of dropping tokens or paying dynamic-shape padding, replicate popular experts dynamically across ranks
MoonEP (Moonshot): keeps every rank's received token count identical so tensor shapes stay completely static
DeepEP V2.5: adds redundant-expert weight prefetching and gradient reduction across expert replicas
MoE Fine-Tuning & Sparse Upcycling
Fine-tuning overfitting: high parameter count causes sparse models to overfit small SFT sets (SuperGLUE CB gap, Zoph et al. 2022)
Fix A (small data): fine-tune only non-MoE weights
Fix B (scale data): e.g., DeepSeek's 1.4M curated SFT examples
Sparse Upcycling: reuse a pretrained dense model to initialize an MoE (copy Attention/Norms, replicate MLP $E\times$, fresh router)
Next: two non-MoE architectural companions that matter in late-2026 frontier models — mHC and MTP.
Manifold-Constrained Hyper-Connections (mHC)
Hyper-connections widen the residual path into $n$ parallel streams (usually 4) and learn small mixing matrices before and after each layer
Stability problem: unconstrained mixing matrices can break the identity path that keeps deep models trainable
mHC (DeepSeek-V4, 2026): projects the mixing matrix toward a doubly stochastic matrix via Sinkhorn–Knopp iterations (up to 20 in DeepSeek-V4)
Systems cost: $n\times$ residual memory traffic + serial reductions per layer → requires fused kernels (DeepSeek self-reports 6.7% overhead of an overlapped pipeline stage)