Skip to content
Sign in

What is Token?

A token is the basic unit of text that an LLM reads and generates. It may be a whole word, part of a word, or punctuation, depending on the model's tokenizer.

Tokenization breaks raw text into these discrete pieces so the model can convert them into numbers it understands. Common methods like Byte-Pair Encoding (BPE) split words into frequent subword units, allowing the model to handle rare words and different languages efficiently.

Every model has a fixed vocabulary of tokens and a maximum context length measured in tokens. Longer inputs are truncated or cost more to process, which directly affects how much information the model can consider at once.

Token count also determines API pricing and generation speed, making tokenization a central factor in both model design and practical usage.

Example

The sentence "ChatGPT is helpful" might become four tokens: ["Chat", "G", "PT", " is helpful"] with one tokenizer or three tokens with another.

Why it matters

Tokens set the limits on context size, control inference cost, and shape how well models handle language, so they are fundamental to building and using modern LLMs.

Frequently asked questions

No. Tokens can be whole words, word pieces, or even single characters, so one word may equal multiple tokens.