Notes

Token

A language model never sees your words. Before anything else happens, the text is cut into pieces drawn from a fixed vocabulary, and those pieces — tokens — are the only units the model reads, predicts, and bills you for.

How text becomes tokens

A tokenizer trained with byte-pair encoding or a similar subword scheme keeps frequent words whole and splits rare ones into fragments, so unbelievable might arrive as four pieces while the is always one. Vocabularies run from about 32,000 entries in LLaMA to over 100,000 in recent GPT models. For English prose the useful rule is one token per four characters, so 100 tokens is about 75 words. Code, unusual names and non-Latin scripts fragment harder: the same sentence in Hindi or Thai can cost two to three times more tokens than in English, and the user pays that difference.

Why this unit runs everything
  • price is quoted per thousand input and output tokens
  • the context window is measured in tokens, not pages — 128k tokens is roughly 96,000 English words
  • generation speed is reported as tokens per second
  • pretraining scale is counted in training tokens
Where tokenization leaks through

Because the model perceives fragments rather than letters, it is oddly weak at character-level work: counting the letters in a word, reversing a string, or doing arithmetic on long numbers that split at awkward places. Tokenizer differences also explain why a prompt tuned on one model behaves differently on another — identical text, different pieces, different predictions.

A token is the unit of text a language model actually processes — a word, a word fragment or a punctuation mark drawn from a fixed vocabulary by a subword tokenizer. In English prose one token averages about four characters. Tokens are the unit of nearly every quantity that matters: context window length, generation speed, price, and the training-data count. The model predicts one token at a time, never a whole word or sentence.

When you type a sentence to a chat assistant, it does not read words the way you do. It first breaks your text into small chunks called tokens — sometimes a whole word, sometimes just part of one, like walk plus ing. Think of alphabet blocks: the assistant owns a fixed set of blocks and builds everything, including its reply, one block at a time. This is why these services charge by the token, and why there is a limit on how much text they can hold at once. It also explains an odd weakness: something that reads in chunks struggles to count the individual letters in a word.