What is a tokenizer
A tokenizer is a program that cuts text into tokens before a language model reads it. A token is a piece of text: a whole word, part of a word, sometimes a space or a punctuation mark. Each token gets a number from the model's vocabulary, and the model sees a chain of those numbers, not letters.
Common words usually fit in one token, while rare and long ones get cut into parts. The same meaning in Russian, Arabic and many other languages often takes more tokens than in English, because model vocabularies were built mostly from English text. That's also why a model struggles to count the letters in a word: it never sees the letters.
Covered in the lessonWhat Are Tokens in AI and What Is a Context Window?Open the lesson →
More terms from this course
- What is an AI agent
- What is an AI hallucination
- What is a context window
- What is an embedding
- What is few-shot prompting
- What is a knowledge cutoff
- What is an LLM (large language model)
- What is machine learning
- What is multimodal AI
- What is a neural network
- What is a prompt
- What is RAG
- What is RLHF
- What is voice cloning