Skip to content
Klay

Tokens and tokenization

After this lesson you can: Explain why an LLM cannot reliably count the letters in a word.

Watch

Notes

An LLM does not receive a string the way your program does. Before the model sees text, a tokenizer converts it into a sequence of token IDs. A token might be a whole common word, part of a word, punctuation, whitespace, or a byte-like fragment. The model then predicts the next token ID, not the next character and not exactly the next English word.

Unlock the full lesson notes, the exercises and the graded checkpoint - ₹5,000 once.