Demystifying AI · Stage 5

Attention and transformers

← Demystifying AIStage 5: Language modelsNot yet checked by our team

Attention lets each token look at the other tokens and decide which ones matter to it. Each token makes a query vector and offers a key vector; the dot product of a query with a key says how relevant they are, softmax turns those scores into weights, and the token takes a weighted mix of the others' value vectors. A transformer stacks many attention and network layers. It is the T in GPT.

Why it matters: Attention is the breakthrough that made today's language models work.

Builds on: Embeddings, Matrices and matrix multiplication, Layers and networks

Learn it, then prove it

Sign in (free) to take this step's mastery check and save your journey.

Learn it

Attention in transformers, step-by-step | Deep Learning Chapter 6

Queries, keys and values, visualised. · 3Blue1Brown

Transformers, the tech behind LLMs | Deep Learning Chapter 5

How attention fits into the whole model. · 3Blue1Brown

How might LLMs store facts | Deep Learning Chapter 7

Optional: where knowledge lives in the network layers. · 3Blue1Brown

Resources are picked with AI help and not yet checked by our team.


Contact Us

Questions or feedback about anything? We'd love to hear from you.

You can reach us at: support@seriousmindware.com