CT-GENAI-900  /  Chapter 2 — Inside the Model — Tokens, Meaning, and Attention
Generative AI
CHAPTER 2 · ~36 MIN · CINEMATIC

Inside the Model.

Text becomes tokens, tokens become geometry, attention decides what matters — and the Transformer falls out.

4ideastoken · embedding · attention · block
~1.3tok/wordwhat the model really sees
Q·K·Vattentionthe one mechanism that mattered
36minthe longest chapter
ENkaraoke subs
CT-GENAI-900 · Generative AI: From Tokens to Agents
▶ VIDEO · CHAPTER 2 · ~36 MIN · CINEMATIC

Tokens, meaning, and the mechanism that changed everything

The player screen is a live animation stage with real diagrams — sentences shatter into tokens, tokens fall into a space where meaning becomes distance and direction, attention draws its weights live between words, and the Transformer assembles itself block by block as the narration reaches each part. Karaoke subtitles in English, fullscreen.

That was the first 10 minutes.

The rest of this chapter — and chapters 2 to 5 — come with lifetime access.

$11.99one payment · lifetime access
Get the full course Already bought it? Sign in
Chapter 2 · Inside the Model · Generative AI: From Tokens to Agents
Inside the Model: tokens, geometry, attention
0:00 / 0:00
REFERENCE · THE MESSAGE CATALOGUE
The concept catalogue →
Every idea the chapter builds — what it is, what it does, and where it lands in the story.
REFERENCE · THE CHAPTER 2 CONCEPT CATALOGUE

Every idea in the chapter

Each concept the video builds — what it is, what it does, and where it lands in the story. Click any row to open its full breakdown. Filter to find any of them.

IdeaCategoryWhat it doesIn one lineLesson
Chapter 2 · Inside the Model — Tokens, Meaning, and Attention
REFERENCE · INSIDE THE MODEL · TEXT → PREDICTION

The whole machine, on one page

Everything Chapter 2 builds, as a reference you can scan: how text becomes tokens, how tokens become meaning, how attention decides what matters, and how the transformer stacks it all into the engine behind every model you have used.

The pipeline — your sentence, all the way in
1 · Text"I love cats" — what you type
2 · Tokenschopped into chunks by BPE, each mapped to an integer
3 · Embeddingseach integer becomes a vector — a point in meaning-space
4 · + Positiona signal stitched in saying "you are word #2"
5 · Blocks × Nattention → feedforward → residual → normalize, repeated
6 · Output heada probability for every possible next token
Byte Pair Encoding — how the chunks are found
StepWhat happensResult
startvocabulary = individual letters onlyevery word spelled out one character at a time
merge 1most common pair is t + hth becomes one token
merge 2most common pair is now th + ethe becomes one token
… × 1000srepeat, thousands of timescommon words = 1 token · rare words = several pieces
resultthe vocabulary (~50k–100k in most models)common things get short · rare things stay flexible
Attention — the three roles
RoleThe question it answersIn the meeting-room analogy
Query (Q)"who here is relevant to me?"the question you walked in with
Key (K)"here is what I am about"the name tag each person wears
Value (V)"what I hand over, if chosen"what they actually tell you
dot producthow strongly does Q match K?scanning the tags for relevance
softmaxturn raw scores into weights summing to 100%deciding how much to listen to each
the blendnew meaning = weighted mix of the valuesyou leave with a combined answer
One transformer block — the four steps, in order
1 · Self attentionEvery token looks at every other and updates its understanding. This is where context flows between words.
2 · FeedforwardEach token passes, individually, through a small network. Where the model does its private thinking.
3 · ResidualADD the update on top of the original rather than replacing it. The quiet hero — without it, deep stacks would not train.
4 · Layer normGentle housekeeping that keeps the numbers in a healthy range so training stays stable.
Two famous pieces of arithmetic
SumLands onWhat it proves
king − man + womanqueena clean direction for gender emerged — nobody defined it
Paris − France + ItalyRomea direction meaning "the capital of" — it was never taught geography
Every idea in this chapter — searchable

Filter by idea, category or lesson.

Chapter 2 · the one sentence: text becomes tokens, tokens become points in a space of meaning, attention lets those points read each other, and a stack of identical blocks turns that into one very good guess at the next token.
QUIZ · 10 QUESTIONS

Inside-the-model check

Questions and answers reshuffle every load. 70%+ and Chapter 2 is yours.