Subword Tokenization: How Words Are Split into Subword Tokens
What subword tokenization changes in text, when tokenized output stays usable, and when plain text or detokenized output is the better choice.
Subword tokenization breaks words into smaller units, called subword tokens, that a language model or text-processing pipeline can map to entries in a fixed vocabulary. Frequent words often stay whole. Rarer or longer words are split into recognizable pieces. This review explains what the process actually changes, how well the result can be reversed back to the original text, and when tokenized output is the wrong thing to hand to a human reader.
Is subword tokenization suitable for your intended use?
Subword tokenization suits machine processing: training or running language models, counting tokens against a model's input limit, analyzing how a vocabulary handles particular words, or comparing how different tokenizers segment the same text. Its main benefit is that any input can be represented with a bounded vocabulary. Rare words, names, typos and words from other languages are not discarded as unknown. They are spelled out from smaller pieces.
The decisive tradeoff is that subword tokens are not linguistic units. A split can follow a real morpheme boundary, but it often does not. The pieces reflect frequency statistics in the tokenizer's training data, not grammar. Tokenization also does not produce text meant for people. If the goal is something a person will read, search, edit or share, keep the plain text, or detokenize the output before using it.
- Good fit: preparing input for a model that expects a specific tokenizer
- Good fit: estimating token counts or cost against a model's limits
- Good fit: inspecting how a vocabulary handles a language, a domain term or a name
- Poor fit: morphological analysis that needs true roots, prefixes and suffixes
- Poor fit: any output intended for human reading, publishing or search indexing
What subword tokenization actually changes
This is a change to the stored representation, not a visual effect. The text is segmented into a sequence of tokens, and each token is usually replaced by an integer ID from the tokenizer's vocabulary. Nothing about fonts, glyph appearance or display direction is involved. The output is a different data structure: a list of token strings or IDs rather than a continuous string.
Several widely used algorithms produce the vocabulary and the splits:
- Byte Pair Encoding (BPE): starts from characters or bytes and repeatedly merges the most frequent adjacent pair into a new vocabulary entry.
- Byte-level BPE: applies BPE to UTF-8 bytes, so any input can be encoded without an unknown-token fallback.
- WordPiece: builds merges using a likelihood-based score rather than raw frequency, and marks word-internal pieces with a continuation prefix.
- Unigram language model: starts from a large candidate vocabulary and prunes it, choosing segmentations by probability.
- SentencePiece: a toolkit that implements BPE and Unigram directly on raw text, treating whitespace as an ordinary symbol.
Each scheme marks word boundaries differently, and those markers appear in tokenized output. WordPiece prefixes continuation pieces with two hash signs. SentencePiece represents a preceding space with the character U+2581 (a lower one-eighth block that resembles an underscore). Some byte-level BPE vocabularies display a leading space as a visible substitute character. These markers are part of the token strings, not the original text.
The example below shows the general pattern. It is not output from a specific tokenizer. Actual splits depend entirely on the trained vocabulary, and the same word can be segmented differently by different models.
Input: unhappiness is unavoidable
WordPiece style: un ##happi ##ness is un ##avoid ##able
SentencePiece: ▁un happi ness ▁is ▁un avoid able
The same applies to the Russian phrase in this topic's original title, "разбиение слов на подсловные токены" (splitting words into subword tokens). Whether a word like "подсловные" stays whole or breaks into pieces depends on how much Russian text the tokenizer was trained on. As a general principle, a vocabulary trained mostly on English tends to break Cyrillic words into more and shorter pieces than English words of similar length. No measurements were supplied for this review, so the size of that effect for any particular tokenizer is not stated here.
Normalization: a change that may not be reversible
Many tokenizers normalize text before splitting it. Normalization can include Unicode compatibility normalization such as NFKC, lowercasing, accent stripping or whitespace collapsing. SentencePiece, for example, applies an NFKC-based normalization by default. These steps change the stored characters. Full-width letters, ligatures, some symbols and composed versus decomposed accented characters may come back in a different form after decoding. A tokenizer described as lossless is generally lossless with respect to its normalized text, not necessarily the exact original bytes. Check the tokenizer's configuration if exact round-tripping matters.
Combining marks and multi-code-point emoji
Subword boundaries do not have to respect user-perceived characters. A byte-level tokenizer can split a single emoji, an emoji built from several code points joined by zero-width joiners, or a letter followed by a combining accent across two or more tokens. The full sequence decodes correctly. A single token or a truncated sequence, however, can decode to an incomplete UTF-8 byte sequence or a stray combining mark. This matters when text is cut to a token limit, streamed token by token, or inspected one token at a time.
Will the result remain readable and usable after copying or sharing?
Token IDs are not readable at all without the matching vocabulary. Token strings are partly readable, but they carry boundary markers and arbitrary breaks inside words. Copying tokenized output into a document, message or web page therefore causes predictable problems:
- Search: a search for the original word will not match text in which that word is broken into pieces or prefixed with markers.
- Editing: spell checkers and editors treat each piece as a separate, usually misspelled, word.
- Assistive technology: screen readers are likely to read word fragments separately and may announce marker characters. This review has no scoped test with any particular screen reader, so actual behavior is unverified.
- Portability: token IDs are meaningful only with the exact tokenizer and vocabulary version that produced them. Another model's tokenizer will interpret them differently or not at all.
When tokenized output must be shared, such as in a bug report or a comparison of tokenizers, include the original plain text alongside it and name the tokenizer used. For anything a person will read, run the tokens through the tokenizer's own decode step rather than joining the strings by hand. Manual joining tends to get spacing and marker removal wrong.
Evidence gaps
No tokenizer-specific evidence was supplied for this review: no vocabulary sizes, token counts, compression ratios, language comparisons or test results. The descriptions above reflect the documented design of the named algorithms. To judge a particular tokenizer, run representative text through it, including the languages, names, symbols and emoji you expect, then decode the result and compare it with the original.