Words, characters and pieces
Text as data separated decoding, normalization and information loss. Now we choose the units that receive model IDs.
The equipment dictionary knows lamp and clamp. A new request contains clamps. Treating the complete word as an unseen identifier loses a useful relationship; spelling every input one character at a time makes sequences longer. Tokenization chooses reusable units between those extremes and records how they map to model inputs.
Baseline: words or characters
A word tokenizer assigns an ID to each entry in a vocabulary. For a vocabulary of size , an embedding table with vector width has entries. The ID selects a row; its numerical magnitude is not a measure of meaning. Two adjacent IDs are not necessarily related words.
Whole-word units make common words compact. However, every inflection, spelling variant, and new item code may need a separate entry. A fixed vocabulary can map unknown strings to a shared unknown token, which makes those different strings indistinguishable to the next layer. Extending the vocabulary later also requires a model-side rule for new embedding rows.
Character units share parts across words and reduce the need for whole-word entries. They increase the number of model positions. They still need an alphabet policy: a vocabulary learned from a limited set of Unicode characters does not automatically cover every script or symbol. A byte representation can cover arbitrary UTF-8 input with an alphabet of 256 byte values, but a visible character may occupy several positions before merges.
Subword units retain common sequences as single entries and assemble less common strings from smaller pieces. Their segmentation need not match linguistic morphemes. The goal depends on the tokenizer: predictable coverage and useful sequence lengths can matter even when the pieces have no independent meaning.