AI Fundamentals · Part 2 of 5
Video Part 2 of 5 0:34

How words become tokens

Tokenisation explained: the first thing that happens to your text inside an AI model, and why it matters.

Step 5 on the mapHow it works underneath →
Title card reading: Words in. Tokens out.

A model never reads your words. Before anything else happens, a tokeniser splits your text into pieces called tokens, and each piece is swapped for a number from a fixed list. Those numbers are all the model works with, in and out. Common words usually stay whole as one token. Rarer or longer words are chopped into fragments, so “unbelievable” might become three pieces where “the” is one.

Words in, tokens out

thethe1 token
unbelievableunbelievable3 tokens
A common word usually stays whole. A longer or rarer word is chopped into pieces, and each piece is swapped for a number. The split shown is an illustration.

As a rule of thumb, a token is about three quarters of a word in English, so a thousand tokens is roughly 750 words. Other languages often take more tokens for the same meaning, because the list was built mostly from English text.

Two everyday oddities follow from this. Models are poor at spelling tasks, such as counting the letters in a word or writing it backwards, because they never see the letters, only the token numbers. And pricing and limits are counted in tokens, not words, so long or unusual words cost more than short common ones, and a context window measured in tokens holds fewer words than the number suggests.

Once the text is numbers, the model needs to know what the numbers mean. That is the job of embeddings, the next entry.

The line to keepWords in. Tokens out. Numbers underneath.

Transcript of the video

When you type a sentence into an AI model, it never actually sees your words.

A tokeniser splits the text first. Common words stay whole. Rarer words get chopped into fragments.

Each fragment maps to a number in a fixed vocabulary. Those numbers are all the model ever reads.

It's why models trip over spelling, and why long words cost more than short ones.

Words in. Tokens out. Numbers underneath.

Found this useful?

Subscribe for the next one, or tell me what you want explained. I take requests.