Most tokenizers use byte pair encoding, or BPE. It learns the most frequent sequences of bytes in a training corpus and merges them. On English, with spaces between words and spelling that keeps words whole, this works well.
Hebrew and Aramaic build words differently. A root of usually three consonants runs through a pattern, and prefixes attach directly to the word.
| Feature | English | Hebrew and Aramaic |
|---|
| Word formation | Adds pieces around a stem | Threads a root through a pattern |
| Conjunctions and prepositions | Separate words | Often attached letters |
| Bytes per letter in UTF-8 | One | Two, and more with vowel marks |
| Final letter forms | None | Five letters change shape at word end |
| Vowel marks | None | Optional marks on consonants |
A BPE tokenizer sees bytes, so the shared root of four related words has no shared token. Multibyte letters can also be cut in the middle, which explains why some tokenizers show broken characters in streams.