Skip to content

Raschka: The Big LLM Architecture Comparison

optionalextendedfrontierblogrubric 8/122025 · ~90 min

Sebastian Raschka

Status

TL;DR. Sebastian Raschka compares the architectures of open-weight LLMs in one long post. It started on 19 July 2025 with DeepSeek V3. It has been updated since, most recently on 2 April 2026 with Gemma 4. It looks only at architecture, not data or training. His conclusion is that models have changed less than you might expect since GPT-2. The changes are in attention, normalisation, position encoding and mixture-of-experts.

The post works model by model. Each model is used to explain one or two design choices. The table maps those choices onto pages on this site.

Section (model)Design choice it explainsRead on this site
1. DeepSeek V3/R1MLA; MoE with 256 experts, 9 active (1 shared), 37B of 671B parameters activeMLA, DeepSeekMoE, DeepSeek-V3
2. OLMo 2Post-norm inside the residual branch; QK-Norm; still MHAOLMo
3. Gemma 3Sliding-window attention at 5:1 local:global, window 4,096 → 1,024; norms before and after attentionGemma 3
5. Llama 4GQA with fewer, larger experts, alternating MoE and dense blocksGQA, Mixtral
6. Qwen3Dense and MoE variants; no shared expertQwen3
7. SmolLM3NoPE in every fourth layerRoPE
8. Kimi K2DeepSeek V3 design scaled to 1T parameters; Muon optimiserKimi K2, Muon
9. gpt-ossWidth vs depth; few large experts; attention bias; learned attention sinksgpt-oss
11. GLM-4.5Three dense layers before the MoE blocksGLM-4.5
12. Qwen3-NextGated DeltaNet and gated attention at 3:1; multi-token prediction for speculative decodingGated DeltaNet, MTP, speculative decoding
13. MiniMax-M2Per-head QK-Norm; partial RoPE on half the head dimensionRoPE, YaRN
14. Kimi LinearLinear-attention revival; channel-wise gated delta rule; NoPE in MLA layersGated DeltaNet, Mamba
16, 21. DeepSeek V3.2, GLM-5DeepSeek sparse attention for long contextNative sparse attention (a related DeepSeek method)
18. Nemotron 3Mamba-2 and MoE hybrid with few attention layers; latent expertsNemotron-H, Mamba
23. Gemma 45:1 sliding-window hybrid with GQA; values set equal to keys in global layersGemma 3

The post is a review, so its results are other papers’ numbers. A few it highlights: in the DeepSeek-V2 ablations, GQA was worse than MHA and MLA was slightly better. A Gemma 2 ablation at 9B found a wider model slightly better than a deeper one (average 52.0 vs 50.8 across four benchmarks). MiniMax-M2 uses 4.37% of its parameters per token against 9.36% for Qwen3 235B-A22B. The post also reports a reversal. MiniMax went back to full attention for M2 after linear attention did poorly on reasoning and multi-turn tasks. Kimi Linear and Qwen3-Next then revived linear hybrids.

  • Weng: The Transformer Family v2 is the 2023 survey of the same design space. Many of its ideas (sliding windows, sparse attention, linear attention) show up here in production models.
  • Stanford CS336 Lectures 3 and 4 teach architectures and attention alternatives. This post is a good companion.
  • Umar Jamil has code-level walk-throughs of Mistral, LLaMA 2, Mamba and MLA.
  • Attention is the 2017 baseline every model here modifies.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Gemma 3 uses five sliding-window layers (window 1,024) for every global layer. Derive the KV-cache size relative to a model with all global layers at a 32K-token context, and say how the ratio changes as the context grows.

    What a strong answer covers
    • Global layers store keys and values for all L tokens; sliding layers store at most W = 1,024.
    • Relative size is 1/6 + (5/6) × W/L. At L = 32,768 this is about 0.19, so the cache is about 5x smaller.
    • As L grows the ratio tends to 1/6, because the global layers dominate; the 5:1 ratio caps the saving at 6x.
    • The post notes Gemma 2 used 1:1 with a 4,096 window, and that Gemma 3 reports little perplexity cost from the change.
  2. Mechanism

    Compare how GQA, MLA and a Gated DeltaNet hybrid each reduce inference memory, using the post's descriptions of Llama-style models, DeepSeek V3 and Qwen3-Next.

    What a strong answer covers
    • GQA shares one key-value head across a group of query heads, so the cache shrinks by the group size.
    • MLA compresses keys and values into a low-dimensional latent before caching and projects them back up, at the cost of an extra matmul.
    • The post cites DeepSeek-V2 ablations in which GQA was worse than MHA while MLA was slightly better.
    • Qwen3-Next replaces three of every four attention layers with Gated DeltaNet, which keeps a fixed-size fast-weight memory instead of a growing cache; one gated-attention layer remains for precise retrieval.
  3. Critique

    The post itself says comparing LLMs is notoriously hard. Critique what a side-by-side architecture comparison can and cannot tell you, using the OLMo 2 normalisation result and the Qwen3 shared-expert decision as examples.

    What a strong answer covers
    • Data, training recipes and hyperparameters differ between models and are often undocumented, so a better model need not mean a better architecture.
    • OLMo 2's stability plot changes the norm placement and adds QK-Norm together, so the effect of each cannot be separated.
    • Qwen3 dropped the shared expert; a developer said they saw no significant gain and worried about inference cost, with no straight answer. Design choices are often weakly justified.
    • Controlled ablations (Gemma 2 width vs depth, DeepSeek-V2 MLA vs GQA, the NoPE paper at about 100M parameters) are rarer and may not transfer to large scale.

Done with this page?

Status