01 · The model
Tokens
Models do not read words. They read tokens — pieces of text from a fixed vocabulary — and emit a probability distribution over the next one.
In English
The model does not see letters or words. It sees tokens — chunks from a fixed list, like a very large alphabet. It then scores every chunk in that list as “what might come next” and picks one.
- Try this
- Type a short sentence. Watch it split. Then drag temperature: low is picky, high is chaotic.
- Keep this
- Text in → tokens → a bet on the next token. That is generation.
Lab · tokenize and sample
5 tokens·pedagogical BPE, not tiktoken
Next-token distribution
·Paris99.8%·the0.1%·Lyon0.1%·a0.0%·located0.0%·not0.0%·Berlin0.0%·London0.0%
Training squeezes a corpus into a vocabulary of tens or hundreds of thousands of pieces. “hello” might be one token. “antidisestablishmentarianism” will not. Spaces usually belong to the following word — that leading dot in the chips is a space.
The forward pass is a function: a list of token ids in, a vector of logits out, one number per vocabulary entry. Softmax turns logits into a distribution. Sampling picks. That is generation. There is no separate “thinking” stage inside the weights.