TokShop @ ICML 2025 ยท arXiv 2505.24689
BPE Stays on SCRIPT
๐ Best Paper, TokShop @ ICML 2025
Read the paper on arXiv ↗BPE penalizes non-Western scripts, creates tokens full of broken UTF-8 fragments, and relies on brittle regex pretokenization. SCRIPT addresses all three.
The problem
Most tokenizers split text with English-centric regex rules that misfire on other languages, then encode it as UTF-8 bytes. A Latin letter costs one byte, Greek costs two, and most CJK characters cost three, so non-Latin scripts pay a structural penalty. Greedy merges also leave tokens holding partial, meaningless byte fragments; GPT-4o's vocabulary has 874 of them.
What we do
SCRIPT (Script Category Representation in PreTokenization) drops UTF-8 conversion. It represents every character as a fixed pair of tokens: a block token from the character's Unicode script and category, plus an index token. Every character then costs exactly two tokens, and pretokenization becomes a simple rule that follows script boundaries. A constrained merging strategy forbids merges that would split characters, which drives invalid tokens to zero and also works for ordinary byte-based BPE.
Why it matters
SCRIPT-BPE stays competitive on compression while flattening the encoding cost to about two tokens per character for every script, rather than the one-to-three-byte premium that penalizes non-Latin languages. It does not always beat byte-based BPE on raw compression, but it removes the built-in unfairness and the garbage tokens, giving multilingual models a cleaner foundation.