What does a tokenizer actually hand to a language model as input?
- The raw Unicode characters of the original text, passed through completely untouched by any lookup step
- A dense embedding vector already looked up for each individual character in the string
- A sequence of integer IDs indexing a fixed vocabulary
- A bag-of-words frequency table that discards the ordering of the tokens entirely
Why
A tokenizer is a deterministic function from text to a list of integers, and each integer is an index into a fixed vocabulary that was built once during tokenizer training. The neural network never sees the original characters; it consumes only these IDs. As its own first internal step, the model maps each ID to a row of its embedding matrix, but that lookup happens inside the model, not in the tokenizer. So the raw-characters option is wrong because the model has no character-level access at all. The embedding-vector option confuses two separate stages: the tokenizer emits IDs, and turning IDs into vectors is the model's job. The bag-of-words option is wrong because token order is preserved exactly, and position matters enormously for attention. Because the vocabulary is frozen after training, the same input always yields the same IDs, which makes tokenization reproducible. This ID sequence is also what context-window limits and per-token billing are measured against, so it is the real currency of an LLM call.