Skip to content
AgenticAIWiki
  1. Learn
  2. Part 1. Gen AI concepts
  3. Chapter 10

Inside the transformer

7 lessons · 47 min

Builds on 2. What an LLM is

One token attends: query, keys, values, heads

Full screen
the24338·cat17221·sat32597Query: sat[1, 0]

Swipe to change step

Step 1 of 8. Focus on one token, sat. Its vector is multiplied by a learned matrix W_Q to make a query: what sat is looking for. Here the query is [1, 0]. Query: sat ([1, 0]), highlighted.

In this chapter

  1. 10.1Queries, keys and values7 min read
  2. 10.2Multi-head attention6 min read
  3. 10.3Positional encodings: sinusoidal and RoPE7 min read
  4. 10.4Encoder-only, decoder-only and encoder-decoder6 min read
  5. 10.5The KV cache and why long prompts cost memory7 min read
  6. 10.6Lab: read an attention map7 min read
  7. 10.7Mixture-of-experts: total and active parameters7 min read

Chapter check

Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.

Loading check…