Tokenizer
A component that converts text into tokens before feeding it into a model — and back, from tokens to readable text. The first and last stage of any LLM.
What it does
flowchart LR
A[Text] --> B[Tokenizer]
B --> C[Tokens]
C --> D[LLM]
D --> E[Tokens]
E --> F[Tokenizer]
F --> G[Text]
Why it is needed
The model works with numbers, not letters. The tokenizer:
- cuts text into meaningful pieces (words, parts of words, characters);
- assigns a numerical id to each token;
- can reassemble back.
Why it is important
Tokenization affects everything: how many tokens the text consumes, how the model understands rare words, and even the quality of Russian language. Different models use different tokenizers.