Lesson 1 · Unit 01
Tokens
Byte-pair encoding, built by hand
What you practise
- Why not characters or words, byte-pair encoding built by hand (merge the most common pair), vocabulary size, why token counts and letter-counting behave oddly
Try a question from this lesson
Pick one
A model needs text as numbers. Suppose every whole English word in a dictionary gets its own number. What breaks first?
Correct answer
A typo, a new name or a line of code has no number
Why
A word list can never be complete: "teh", a username or x_train are not in it. Numbering single characters covers everything but makes every text very long. Tokens are the middle road: pieces of words.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Tokens are pieces of words
A tokenizer cuts text into tokens and swaps each one for its id, its row number in the vocabulary.
Common words are a single token. Rare words are split into a few common pieces, so nothing is ever "unknown". The ids below are made up; real ones depend on the tokenizer.
"unbelievable!"
un | believ | able | !
403 9173 540 010 more exercises in the app
- 3× type the answer
- 3× multiple choice
- 1× fill the blanks
- 1× order the lines
- 1× true or false
- 1× match the pairs
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.