Skip to content
mentoor

Modern LLM architecture choices

For engineers

What changed between GPT-2 and today's open-weight models: rotary positions, RMSNorm and SwiGLU, grouped-query attention, mixture of experts and hybrid layers

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

What does a rotary position embedding rotate?

Choose one answer

Check yourself · 2 of 5

In a pre-norm block, where does the normalisation sit?

Choose one answer

Check yourself · 3 of 5

A model has 32 query heads and 8 KV heads. How many query heads share each KV head?

Choose one answer

Check yourself · 4 of 5

An MoE model has 8 experts per layer and sends each token to 2. What decides the GPU memory needed to load it?

Choose one answer

Check yourself · 5 of 5

A config has num_attention_heads 32 and num_key_value_heads 8. What attention variant is this?

Choose one answer

Topics

  1. Rotary positions and context extension5 min read · RoPE encodes position by rotating queries and keys, and scaling methods such as YaRN stretch a trained model to longer contexts
  2. Pre-norm, RMSNorm and SwiGLU blocks5 min read · The small changes to the transformer block that make deep models train stably, as seen in Llama, Qwen, Mistral and Gemma
  3. Grouped-query and latent attention6 min read · Sharing keys and values across heads, or compressing them as in multi-head latent attention, to shrink the KV cache and speed up inference
  4. Routing and load balancing in MoE6 min read · A router picks the top-k experts per token, balancing losses keep experts used evenly, and total versus active parameters set memory and speed
  5. Reading an open model's config file6 min read · Hidden size, layers, attention and KV heads, vocabulary, context length and expert counts in a Hugging Face config.json, and what each implies
  6. State-space and hybrid architectures5 min read · Mamba-style layers and hybrid models mix linear-time sequence layers with attention to cut long-context cost, trading away some exact recall

Start here

110 questions · last verified 2026-12