What is token?
A piece of text, such as a character, a word or part of a word, that a model treats as one unit and represents by an id.
Where it is taught
Tokens and positions. The path from a sentence to the matrix a transformer works on. Split into tokens, look up embeddings, and add information about order.
What the lesson leaves you with
- Text is split into tokens, and tokens become ids, then embedding vectors.
- Position embeddings are added so the model knows the order of the tokens.
- The model predicts the next token at every position: the targets are the inputs shifted by one.
Questions
- What is token?
- A piece of text, such as a character, a word or part of a word, that a model treats as one unit and represents by an id.
- Where is token used in AI?
- The path from a sentence to the matrix a transformer works on. Split into tokens, look up embeddings, and add information about order.
- What is the key idea to remember about token?
- Text is split into tokens, and tokens become ids, then embedding vectors.
- Where can I learn token step by step?
- In the lesson “Tokens and positions” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.