Glossary · AI/ML
Token
Also known as: tokens, tokenization, context window
The unit of text an LLM reads and writes, usually a word or part of a word. Pricing, speed, and context limits are all measured in tokens.
Why it matters
- Cost: hosted APIs bill per input and output token.
- Context window: the maximum number of tokens (prompt + answer) a model can handle in one call.
- Latency: models generate output one token at a time, so long answers take longer.
Rule of thumb
For English text, one token is roughly four characters or about three quarters of a word. Code and non-English text usually use more tokens per word.
Example
"Spring Boot is great" → ["Spring", " Boot", " is", " great"] (4 tokens)
Exact splits depend on the model’s tokenizer.