Artificial Intelligence

Token

The basic unit of text that language models process. A token can be a word, part of a word, or a punctuation mark. Text is broken into tokens before being fed into an LLM, and the model generates output one token at a time.

Why It Matters

Token counts determine API costs, context window limits, and processing speed. Understanding tokens is essential for optimizing LLM usage and managing costs.

Example

The sentence 'I love AI' might be split into 3 tokens: 'I', ' love', ' AI'. The word 'unbelievable' might be split into 'un', 'believ', 'able'.

Think of it like...

Like breaking a sentence into Scrabble tiles — sometimes a tile is a whole word, sometimes it is just a piece of one, but the model works with these individual pieces.

Related Terms