A ai coolAId
← All 44 Terms 1. LLM & Deep Learning Foundations Read in Ch. 1: How LLMs Actually Work →

Tokenization (BPE)

In One Sentence
Splitting raw text into subword integer IDs so a neural network can process language as numbers.
ELI5 (Intuition)
Before an AI can read a sentence, it chops words into common LEGO bricks—short words stay whole, while rare or long words break into reusable pieces like 'un-' + 'believ' + '-able'.
ELI18 (Technical)
Modern LLMs use Byte-Pair Encoding (BPE) or Unigram subword vocabularies (typically 32k–200k tokens) mapping UTF-8 byte sequences to integer IDs \(x_1, \dots, x_T \in \{1, \dots, V\}\). Subwords balance vocabulary size against sequence length and guarantee zero out-of-vocabulary failures.
In Practice
API billing, context limits, and subtle bugs all live at the token level: English averages ~0.75 words per token, while JSON punctuation, non-English scripts, or arithmetic digits can burn 2–4x more tokens and explain why models struggle with character counting.