What Tokens are Learned when Tokenization is Optimized Jointly with Language Modeling?
Organizations: IIIT Hyderabad, India
Abstract
Tokenization is a fundamental component of language modeling pipelines. Despite its importance, it is often fixed, even though it significantly impacts model performance across languages. In this work, we analyze what tokens are learned when tokenization is jointly optimized with language modeling. We compare tokenizer-free approaches such as SSLMs and H-Nets with fixed tokenizers across 18 typologically and script-diverse languages. Our results show that joint optimization fundamentally alters token structure. SSLMs recover morphologically aligned and contextually efficient tokens, whereas H-Nets prioritize byte-level efficiency, producing longer tokens with very low overlap with standard subword vocabularies. We further show that tokenization behavior varies across language typologies. Agglutinative languages exhibit more dynamic segmentation patterns while learning. Through downstream evaluation, with pretrained-then-finetuned BERT models, we find that SSLM-based pretokenization consistently reduces language modeling perplexity and achieves competitive downstream performance despite distinct vocabularies. Overall, tokenizer-free approaches optimize for contextual and computational efficiency rather than strict morphological structure, resulting in fundamentally different yet effective vocabularies for downstream NLP.
Figures & tables
| Language Coverage |
|---|
| Agglutinative: Finnish, Hungarian, Malayalam, Tamil, Telugu, Kyrgyz, Turkish, Mongolian, Indonesian ( 9 languages ) |
| Analytic & Introflexive: English, Swedish, Hebrew ( 3 languages ) |
| Fusional: Sanskrit, Hindi, Sindhi, Croatian, Russian, Persian ( 6 languages ) |
| English | Hebrew | Hindi | Tamil | Hungarian | Indonesian | ||||||
| reaping | משטרתיים | कार्यकर्ताओं | வகுத்து | brigádokkal | ceritakan | ||||||
| reap ing | משטרתי ים | कार्यकर्ता ओं | வகு த்து | brigád okkal | cerita kan | ||||||
| Segmentation | F1 | Segmentation | F1 | Segmentation | F1 | Segmentation | F1 | Segmentation | F1 | Segmentation | F1 |
| rea ping | 0 | משט רתיים | 0 | का र्यकर ्ताओं | 0 | வக ுத்து | 0 | bri g ádo kkal | 0 | ceri takan | 0 |
| re ap ing | 0.67 | מ שטר תי ים | 0.5 | कार्य कर्ता ओं | 0.67 | வகு த்து | 1 | br igá d okkal | 0.5 | c erita kan | 0.67 |
| reap ing | 1 | משטר תי ים | 0.67 | कार्य कर्ता ओं | 0.67 | வகு த்து | 1 | br igá dok kal | 0 | c erita kan | 0.67 |
| Tokenizer | Sentiment Analysis (Acc) | POS Tagging (F1) | Named Entity Recognition (F1) | Dependency Parsing (LAS) | ||||||||
| Language | eng_latn | tel_telu | hin_deva | eng_latn | tel_telu | hin_deva | eng_latn | tel_telu | hin_deva | eng_latn | tel_telu | hin_deva |
| Standard Algorithms | ||||||||||||
| BPE | 85.55 | 62.85 | 76.67 | 95.09 | 88.41 | 97.15 | 89.98 | 94.72 | 90.69 | 75.64 | 66.31 | 88.20 |
| UnigramLM | 83.61 | 64.88 | 77.63 | 95.11 | 89.72 | 97.20 | 89.61 | 94.80 | 91.08 | 75.95 | 68.88 | 88.73 |
| WordPiece | 84.86 | 65.91 | 76.10 | 95.22 | 89.51 | 97.34 | 88.37 | 95.33 | 90.73 | 78.11 | 66.31 | 88.63 |
| Contextual Algorithms | ||||||||||||
| Pretokenizer | eng_latn | tel_telu | hin_deva |
|---|---|---|---|
| None | 9.84 | 9.92 | 7.23 |
| SSLM | 3.81 ( 61.3%) | 2.92 ( 70.6%) | 3.96 ( 45.2%) |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Model Scale | Sentiment Analysis (Acc) | POS Tagging (F1) | Named Entity Recognition (F1) | Dependency Parsing (LAS) | ||||||||
| Language | eng_latn | tel_telu | hin_deva | eng_latn | tel_telu | hin_deva | eng_latn | tel_telu | hin_deva | eng_latn | tel_telu | hin_deva |
| Standard Algorithm: BPE | ||||||||||||
| 2M | 77.75 | 59.15 | 65.97 | 89.16 | 62.22 | 92.57 | 70.79 | 86.15 | 75.90 | 54.78 | 56.04 | 74.12 |
| 12M | 85.55 | 62.85 | 76.67 | 95.09 | 88.41 | 97.15 | 89.98 | 94.72 | 90.69 | 75.64 | 66.31 | 88.20 |
| 30M | 88.42 | 65.43 | 78.01 | 95.97 | 92.82 | 97.64 | 91.65 | 95.66 | 91.91 | 80.29 | 72.96 | 90.44 |
| Using SSLM as pretokenization: SSLM-BPE | ||||||||||||
| Hyperparameter | Value |
|---|---|
| Model Architecture | |
| Architecture Type | H-Net |
| Total Parameters | |
| Architecture Layout | |
| Embedding Dimension | |
| Feed-Forward Dimension | |
| Hyperparameter | Value |
|---|---|
| Model Architecture | |
| Architecture Type | Transformer SSLM |
| Total Parameters | |
| Decoder Layers | |
| Embedding Dimension | |
| Feed-Forward Dimension | |
| Hyperparameter | Value |
|---|---|
| Model Architecture | |
| Architecture Type | BERT |
| Total Parameters | 2M / 12M / 30M |
| Hidden Layers | 3 / 6 / 8 |
| Hidden Dimension | 128 / 384 / 512 |
| Feed-Forward Dimension | 512 / 1024 / 2048 |
| Hyperparameter | Value |
|---|---|
| Train batch size | 32 |
| Eval batch size | 32 |
| Epochs | 3 for GLUE |
| 10 for ACTSA-TE, Dep. Parsing, IITP-PR, NER (CoNLL), POS, Wiki-NER | |
| Learning rate | 2e-5 |
| LR schedule | Linear warmup |
| English | Hebrew | Hindi | Tamil | Hungarian | Indonesian | ||||||
| Bangladeshis | ריכוזיים | डिस्ट्रीब्यूटरों | தொடுக்க | zeneszerzőzseniket | kehabisan | ||||||
| Bangladeshi s | ריכוזי ים | डिस्ट्रीब्यूटर ों | தொடு க்க | zeneszerzőzseni ket | ke habis an | ||||||
| Segmentation | F1 | Segmentation | F1 | Segmentation | F1 | Segmentation | F1 | Segmentation | F1 | Segmentation | F1 |
| Ba ngl ades his | 0 | ריכו ז יים | 0 | डिस् ट्री ब्यू टरों | 0 | தொ டுக்க | 0 | zene szerz őz sen iket | 0 | keha bisa n | 0 |
| Ba ngla deshi s | 0.5 | ריכ וזי ים | 0.67 | डिस् ट्री ब्यू ट र ों | 0.33 | தொட ு க்க | 0.67 | zene szerz ő zs en i ket | 0.29 | ke habi s an | 0.8 |
| Ba ngla deshi s | 0.5 | רי כוז י ים | 0.5 | डिस् ट्री ब्यू ट र ों | 0.33 | தொ டுக்க | 0 | zene szerz ő zs en ik et | 0 | keha bis an | 0.5 |
| Language | ISO 639-3 | ISO 15924 | Typology | Family | Group |
| Agglutinative | |||||
| Finnish | fin | latn | Agglutinative (with some Fusion) | Uralic | Finno-Ugric |
| Hungarian | hun | latn | Agglutinative (Suffixing) | Uralic | Finno-Ugric |
| Malayalam | mal | mlym | Agglutinative (Highly Synthetic) | Dravidian | Dravidian |
| Tamil | tam | taml | Agglutinative (Highly Synthetic) | Dravidian | Dravidian |
| Telugu | tel | telu | Agglutinative (Highly Synthetic) | Dravidian | Dravidian |
| Language | ISO 15924 | BP | #sentences | #words | ASL | #MS | #MN | Data Source |
| Agglutinative | ||||||||
| Finnish | latn | 1.0589051 | 432,422 | 4,532,824 | 10.48 | 10172 | 3,745,139 | NewsCrawl |
| Hungarian | latn | 1.0199851 | 280,276 | 4,883,416 | 17.42 | 6350 | 1,044,996 | NewsCrawl |
| Malayalam | mlym | 2.8852389 | 438,501 | 4,053,859 | 9.24 | 131 | - | NewsCrawl |
| Tamil | taml | 2.7292892 | 397,206 | 4,216,313 | 10.61 | 1179 | - | NewsCrawl |
| Telugu | telu | 2.6198705 | 475,463 | 4,582,098 | 9.64 | 8092 | - | NewsCrawl |
| Method | Description |
|---|---|
| Standard Algorithms | |
| Byte-pair Encoding (BPE) Gage (1994) ; Sennrich et al. (2016) | Greedy frequency-based merge algorithm that iteratively combines the most frequent symbol pairs to construct a fixed subword vocabulary. |
| UnigramLM Kudo (2018) | Probabilistic subword model trained via EM that selects a vocabulary maximizing corpus likelihood under a mixture model. |
| WordPiece Schuster and Nakajima (2012) | Likelihood-based subword segmentation used in BERT; greedily selects merges that maximize training data likelihood. |
| Metric | Description | Requirements | What it Addresses |
| Coverage | |||
| Subword Fertility | Average number of tokens produced per word. | Tokenizer and representative corpus. | Sequence length and basic storage efficiency. |
| Compression Rate | Ratio of raw text size to tokenized sequence length. | Tokenizer and representative corpus. | Storage and context window efficiency. |
| Token Frequency Distribution | Distributional profile of token occurrences (e.g., long-tail vs. concentrated usage). | Token counts from a representative corpus. | Statistical balance of vocabulary usage and fragmentation patterns. |
| Token Length Distribution | Distributional profile of tokens grouped by lengths from a representative corpus | Vocabulary of tokenizer | Granularity balance between short and long tokens, which affects efficiency and segmentation behavior. |
| Contextual Exponence | Number of distinct neighbours each token encounters Yehezkel and Pinter (2023) . We consider only immediate neighbourhoods in our evaluation. | Representative corpus and its corresponding tokens | Degree to which the tokenizer optimizes tokens’ contextual soundness |
Byte-Level Language Model
Byte-level language models predict text directly from bytes, avoiding fixed token vocabularies while balancing character-level flexibility against sequence efficiency.
See all 30 papers