AI Concepts· Topic 01 · Definition

Token

The atomic unit an LLM processes - roughly a syllable.

A token is the fundamental unit of text that language models process, representing fragments of text that may be parts of words, complete words, punctuation marks, or special characters. Tokenization is the process of breaking text into these units based on specific rules. In English, tokens often correspond roughly to 4 characters or 3/4 of a word on average, though this varies widely depending on the specific tokenization algorithm and language.

Why it matters

Understanding tokens is essential for AI optimization because they directly impact cost, performance, and capabilities of language models. Token limits constrain context windows, affecting how much information can be processed at once. Optimizing content for efficient tokenization can reduce costs and improve model performance, especially for applications with high volume or requiring extensive context.

Use cases
  • Content OptimizationStructuring text to minimize token usage while preserving meaning.
  • Cost ManagementEstimating and controlling API costs based on token usage.
  • Context PlanningDesigning prompts and documents to fit within token limits.
Optimization techniques

To optimize token usage, use common words where possible (they often tokenize more efficiently), avoid unnecessary repetition, and structure information concisely. For technical content, consider that specialized terminology and code may tokenize less efficiently. When working with context limits, prioritize the most relevant information and consider chunking strategies for large documents.

Metrics

Measure tokenization efficiency through tokens per character ratio, tokens per word ratio, and total token count for equivalent content expressed different ways. For applications, track token usage per request, cost per useful output, and context utilization percentage.

How LLMs interpret this

Language models process text by converting it into tokens, which are then transformed into numerical embeddings. The model's understanding of language is built upon these token-level representations and their relationships. Token boundaries affect how models interpret text, with some tokenization choices potentially impacting the model's perception of word meanings and relationships.

Keywords
tokentokenizationtext processinglanguage model tokensword pieces
Also known as
Text TokenLanguage TokenWord Piece
More in AI ConceptsAll 19 terms →

Knowing the term is step one.

Geordy operationalizes every term in this glossary - generating the structured files AI engines actually read.

Token | Geordy Glossary · Geordy