Most late-2026 models keep the dense block fundamentals (RMSNorm, *GLU, RoPE variants) while innovating on sparsity, attention compression, residuals, and stability.
Pre-Norm vs. Post-Norm: Protecting the Residual Path
Post-LN puts normalization directly on the residual spine:
$x_{l+1} = \text{Norm}\big(x_l + F(x_l)\big)$
Pre-LN keeps a clean identity highway (with one final norm at the output):
$x_{l+1} = x_l + F\big(\text{Norm}(x_l)\big)$
Consensus: pre-norm is standard across Llama 4, Nemotron 3, DeepSeek-V3.2, and late-2026 models
Historical exceptions: original Transformer, BERT, and OPT-350M
Diagram adapted from Xiong et al. (2020).
Why Pre-Norm Wins: Gradient Flow and Stability
Uniform gradients: Pre-LN keeps gradient magnitudes balanced across layers (Xiong et al., 2020)
Post-LN creates huge output-layer gradients and attenuated early-layer gradients at initialization
Fewer gradient spikes: Salazar & Nguyen (2019) observed far lower global gradient norm spikes under Pre-LN
Original motivation: training without learning-rate warmup
Modern motivation: stability and larger learning rates in deep networks
Non-Residual Post-Norm ("Double Norm")
Idea: if normalizing the residual stream hurts gradient flow, put the second norm on the sublayer output before addition:
SwiGLU: $\text{FFN}_{\text{SwiGLU}}(x) = (\text{Swish}_1(x W) \odot x V) W_2$, where $\text{Swish}_1(x) = x \cdot \text{sigmoid}(x)$
LLaMA 1/2/3, PaLM, Mistral, OLMo, and most post-2023 models
Parameter budget: *GLU uses 3 matrices ($W, V, W_2$) instead of 2 $\Rightarrow$ shrink $d_{\text{ff}}$ by $\mathbf{2/3}$ (from $4 d_{\text{model}}$ to $\frac{8}{3} d_{\text{model}}$) to hold parameters and FLOPs constant.
Empirical Evidence: Gated FFNs Consistently Win
Shazeer (2020) — T5-style eval
Variant
Avg
CoLA
SST-2
$\text{FFN}_{\text{ReLU}}$
83.80
51.32
94.04
$\text{FFN}_{\text{GELU}}$
83.86
53.48
94.04
$\text{FFN}_{\text{Swish}}$
83.60
49.79
93.69
$\text{FFN}_{\text{GLU}}$
84.20
49.16
94.27
$\text{FFN}_{\text{GEGLU}}$
84.12
53.65
93.92
$\text{FFN}_{\text{SwiGLU}}$
84.36
51.59
93.92
$\text{FFN}_{\text{ReGLU}}$
84.67
56.16
94.38
Raffel et al. (2019) baseline: 83.28 ± 0.235.
Narang et al. (2020) — 223M params, 11.1T ops
Variant
Step/s
Final Loss
SGLUE
XSum
Vanilla (ReLU)
3.50
1.838
71.66
17.78
GeLU
3.58
1.838
75.79
17.86
Swish
3.62
1.847
73.77
17.74
GLU
3.59
1.814
74.20
17.42
GeGLU
3.55
1.792
75.96
18.27
ReGLU
3.57
1.803
76.17
18.36
SwiGLU
3.53
1.789
76.00
18.20
All *GLU rows beat ReLU/GeLU/Swish on final loss at equal compute.
Scaling FFNs Today: Sparse MoE and MTP
LatentMoE is Nemotron 3's (early-2026 wave); MTP (multi-token prediction) is DeepSeek's.
Model (Wave)
Total / Active
Experts (Active + Shared)
DeepSeek-V3 (Dec '24)
671B / 37B
256 routed (8 + 1 shared), MTP
Kimi K2 (July '25 wave)
1T total
384 routed (8 active)
DeepSeek-V4.1-Flash(Sept '26)
552B / 16B dec, 8B pre
384 routed (6 + 1 shared), 3 MTP
Kimi K3 / K3.1(July '26)
2.8T / 104B
896 routed (16 + 2 shared), Stable LatentMoE
GLM-5.3(2026)
78L, $d=6144$
256 routed (8 + 1 shared), 1 MTP
Qwen3.8-Flash-Next(Aug '26)
125B / 6B
512 routed (10 + 1 shared)
Late-2026 frontier models activate only a small fraction of parameters per token while keeping SwiGLU-style expert FFNs (Kimi K3 also applies MXFP4 QAT to experts).
Serial vs. Parallel Transformer Blocks
Serial: $y = x + \text{MLP}(\text{Norm}(x + \text{Attn}(\text{Norm}(x))))$
Parallel: $y = x + \text{MLP}(\text{Norm}(x)) + \text{Attn}(\text{Norm}(x))$
Shared norm + fused input matmuls gave ~15% faster training in PaLM
PaLM ablation: small quality drop at 8B, neutral at 62B; 540B was extrapolated, not tested
Usage: GPT-J, GPT-NeoX, PaLM, Falcon 2 11B, Command R+, Command A — but serial remains the default
# 1. Project hidden_states to Q, K, V and reshape to (bsz, heads, seq_len, head_dim)
q = self.q_proj(x).view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
k = self.k_proj(x).view(bsz, q_len, self.num_kv_heads, self.head_dim).transpose(1, 2)
v = self.v_proj(x).view(bsz, q_len, self.num_kv_heads, self.head_dim).transpose(1, 2)
# 2. Compute per-position cos/sin tables and rotate Q and K (never V)
cos, sin = self.rotary_emb(v, position_ids)
q, k = apply_rotary_pos_emb(q, k, cos, sin)
# 3. Proceed with standard scaled dot-product attention (q, k, v)
Applied at every attention layer (not once at the input embedding) to preserve exact relative-position invariance
Only queries and keys are rotated; values $V$ carry content without rotational distortion
With partial RoPE, rotate only the first $d_{\text{rope}}$ dimensions of each head and leave the remaining semantic dimensions unrotated
Hyperparameter 1: Feed-Forward Ratio ($d_{\text{ff}} / d_{\text{model}}$)
QK-Clip (Kimi K2, July 2025): QK-Norm does not apply cleanly to MLA's compressed latent projections
Rescales query/key weights whenever a head's max attention logit exceeds a threshold
Result: Kimi K2 pretrained 1T parameters on 15.5T tokens with zero loss spikes
Gated Attention (Qwen): placing a sigmoid gate after the attention output improves stability and removes the need for some clipping
Qwen3.8-Next Stability Study (Aug 2026) — spikes per 10k steps at aggressive learning rates:
Learning Rate Stress Test
Baseline
Stabilized Setup
4× optimal LR
AdamW: 183 spikes / 10k steps
Muon + gated residual: 0 spikes
3× optimal LR
Standard norm: 32.0 spikes / 10k steps
GatedNorm: 3.2 spikes / 10k steps
Late-2026 frontier models (DeepSeek-V4, Kimi K3 with Per-Head Muon, Qwen3.8-Flash-Next) pair architectural gating with Muon-family optimizers for spike-free scale.
Attention Cost: Prefill vs. Incremental Decode
Training / Prefill (all $n$ tokens in parallel)
Ops: $O(b n d^2)$ · Mem: $O(b n d + b h n^2 + d^2)$
$$\text{AI} = O\!\left(\left(\frac{1}{k} + \frac{1}{bn}\right)^{-1}\right)$$
High arithmetic intensity ($k = d/h$, $n < d$) $\Rightarrow$ keeps compute units busy
MQA (Shazeer, 2019): 1 shared $K, V$ head $\Rightarrow$ mem $O(bnd + bn^2 k + nd^2)$, $\text{AI} = O\!\left(\left(\frac{1}{d} + \frac{n}{dh} + \frac{1}{b}\right)^{-1}\right)$
GQA (Ainslie et al., 2023): $g$ KV groups; matches MHA-XXL quality near MQA latency
Shazeer (2019)
$h$
$d_k,d_v$
$d_{\text{ff}}$
dev-PPL
Multi-head
8
128
8192
29.9
Multi-query
8
128
9088
30.2
Smaller MHA
1–8
128–16
9984
30.9–31.2
Beyond GQA: MLA and Compressed KV Caches
MLA (introduced in DeepSeek-V2; used in DeepSeek-V3 & Kimi K2): compress $K, V$ into a single low-rank latent vector $c_t^{\text{KV}}$ before caching, plus a small decoupled RoPE key
Late-2026 frontier KV designs:
GLM-5.3 (2026): MLA with kv_lora_rank = 512 and rope_dim = 64 across 64 heads
Kimi K3 (July 2026): gated MLA layers interleaved with Kimi Delta Attention
DeepSeek-V4.1-Flash (Sept 2026): 1 KV head shared by 64 Q heads (head_dim = 512), cross-layer KV reuse + FP4 KV cache $\Rightarrow$ 890 bytes/token global KV at 1M context
Sparse, Interleaved, and Hybrid Attention
2025–early-2026 wave (interleaved):
Command A: 3:1 SWA (RoPE) to Full (NoPE); OLMo 3: 3/4 SWA (4,096) + Full (YaRN); also Llama 4, Gemma 3/4
Qwen 3.5: 3:1 Gated DeltaNet to Gated Attention
Late-2026 frontier (1M context):
MiniMax-M3 (June 2026): blockwise top-$k$ sparse on GQA — matches GQA quality on 109B with 28.4× less attention compute at 1M context
Qwen3.8-Flash-Next: 3:1 Gated DeltaNet + QSA; Kimi K3: 3:1 Kimi Delta Attn + gated MLA; Nemotron 3.5: Mamba-Transformer MoE
Recap: Architecture & Hyperparameters in Late 2026
Block consensus
Non-residual norm (pre-norm RMSNorm), no bias terms
Gated FFNs (SwiGLU / GeGLU), serial blocks
RoPE / partial RoPE (or RoPE + NoPE hybrids)
Hyperparameter lessons
$d_{\text{ff}} \approx 4 d$ (or $\frac{8}{3}d$ for GLU) and $d_{\text{model}}/n_{\text{layer}} \sim 100\text{–}200$ sit in wide basins; parallelism drives depth vs. width
Multilingual vocabs: 100k–262k; weight decay aids LR-schedule dynamics, not overfitting
Stability at scale
Output z-loss, QK-Norm, and QK-Clip (for MLA)
Gated Attention, GatedNorm, and Muon suppress spikes even at $3\text{–}4\times$ LR