- Learn
- Part 1. Gen AI concepts
- Chapter 10
Inside the transformer
7 lessons · 47 min
Builds on 2. What an LLM is
One token attends: query, keys, values, heads
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
- 10.1Queries, keys and values7 min read
- 10.2Multi-head attention6 min read
- 10.3Positional encodings: sinusoidal and RoPE7 min read
- 10.4Encoder-only, decoder-only and encoder-decoder6 min read
- 10.5The KV cache and why long prompts cost memory7 min read
- 10.6Lab: read an attention map7 min read
- 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…