The Price of Token Boundaries: Compression Certificates and Prediction
Organizations: The Chinese University of Hong Kong, Shenzhen · Shenzhen Loop Area Institute
Abstract
Pre-tokenisation restricts which text fragments can become prediction units, but its compression cost is obscured when tokenisers are compared only under the same boundaries. We measure this cost by bounding the minimum token count from both sides, with and without a regular-expression boundary rule. Nonnegative prices on token occurrences yield a lower bound through shortest paths and vocabulary-budget selection; maximising over all prices recovers the linear programming relaxation, and an independent integer checker certifies the reported values. On English Wikipedia, boundaries increase the optimal token count by 28.3--36.8%. Byte pair encoding lies 2.1% above the constrained lower bound, but 10.9% above the unrestricted bound. Compression and prediction favour different dictionaries: at 85M non-embedding parameters and matched training-token budgets, unrestricted fitting yields higher mean held-out bits per byte under a common unrestricted decoder in all 12 languages in the paired study and 11 of 12 under independent tuning and evaluation. To study intermediate boundary policies, we introduce boundary licences, which limit the vocabulary entries permitted to cross cuts and admit the same form of certificate. On separate English and Chinese fitting corpora, licensing 10% of the vocabulary budget recovers 85.2% and 100.0% of the achieved token-count reduction from removing all cuts. These results quantify the compression cost of boundaries while separating it from the prediction quality of the resulting token units.
Figures & tables
| English | Chinese | |||
| Method | Regex | None | Regex | None |
| Optimum: upper ceiling | 4.642 | 6.314 | 4.593 | 5.084 |
| SlotPrice | 4.616 (0.6) | 5.958 (6.0) | 4.582 (0.3) | 5.045 (0.8) |
| BPE | 4.551 (2.1) | 5.697 (10.9) | 4.545 (1.1) | 4.978 (2.2) |
| Two-stage BPE | – | 5.898 (7.1) | – | 4.967 (2.4) |
| Unigram | 2.894 (60.4) | 5.735 (10.1) | 4.006 (14.7) | 4.787 (6.3) |
| Language | Token blocks | Byte history | Sliding context |
|---|---|---|---|
| English | |||
| German | |||
| Russian | |||
| Finnish | |||
| Turkish | |||
| Vietnamese |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Regex | None | Tax (%) | |||||
|---|---|---|---|---|---|---|---|
| Language | SlotPrice | BPE | SlotPrice | BPE | Two-stage | Unigram | Interval |
| English | 4.616 | 4.551 | 5.958 | 5.697 | 5.898 | 5.735 | 28.3–36.8 |
| German | 4.823 | 4.714 | 6.031 | 5.641 | 5.845 | 5.622 | 24.0–33.3 |
| Russian | 7.203 | 7.007 | 9.012 | 8.422 | 8.459 | 8.288 | 24.1–37.1 |
| Finnish | 4.939 | 4.792 | 6.190 | 5.794 | 5.891 | 5.729 | 24.0–35.8 |
| Turkish | 4.957 | 4.863 | 6.330 | 5.776 | 6.077 | 5.928 | 26.8–34.6 |
| LP | Uniform (%) | Occurrence (%) | |||||
| 1000 | 100 | 6 | 20 | 3k | 660.0 | 91.6 | 99.99 |
| 1000 | 50 | 8 | 30 | 5k | 570.0 | 86.3 | 99.79 |
| 1500 | 100 | 10 | 30 | 9k | 880.0 | 86.5 | 99.82 |
| 2000 | 100 | 6 | 40 | 5k | 1167.5 | 86.1 | 99.97 |
| 2000 | 100 | 8 | 40 | 9k | 1124.2 | 85.9 | 99.90 |
| 2000 | 200 | 6 | 30 | 6k | 1256.0 | 88.4 | 99.89 |
| lang | bound | bound | achieved | certified | BPE gap | ||
| English | |||||||
| 4096 | 10240 | 3.699 | 4.542 | 10.7% | 4.6–30.0% | 9.8% / 23.7% | |
| 8192 | 5120 | 4.056 | 5.134 | 15.1% | 11.4–30.7% | 6.6% / 19.7% | |
| 32768 | 1280 | 4.642 | 6.314 | 29.1% | 28.3–36.8% | 2.1% / 10.9% | |
| 131072 | 320 | 4.994 | 8.006 | 54.5% | 53.6–61.3% | 1.3% / 11.9% | |
| ws 32768 | 1280 | 5.058 | 6.314 | 19.0% | 17.8–26.1% | 3.1% / – | |
| regex (deployed in) | achieved | certified | note | |
|---|---|---|---|---|
| o200k / GPT-4o style | 5.07 | 29.1% | 28.3–36.8% | |
| r50k (GPT-2) | 5.18 | 26.0% | 25.3–33.5% | |
| cl100k (GPT-3.5/4) | 5.05 | 29.2% | 28.5–37.0% | |
| LLaMA-3 | 5.05 | 29.2% | 28.5–37.0% | cl100k |
| Language | Encoder | Native | Cuts | No cuts | |
|---|---|---|---|---|---|
| English | o200k_base | 195,757 | 4.474 | 4.501 | 4.508 |
| English | cl100k_base | 99,200 | 4.408 | 4.437 | 4.444 |
| Chinese | o200k_base | 195,757 | 3.145 | 3.149 | 3.177 |
| Chinese | cl100k_base | 99,200 | 2.144 | 2.147 | 2.164 |
| Variant | English | Time | Chinese | Time |
|---|---|---|---|---|
| Dual objective relative to the full optimizer (%; higher is better) | ||||
| Uniform prices | 85.76 | – | 88.91 | – |
| Without preconditioning | 85.76 | 153 | 88.91 | 134 |
| Without momentum | 95.67 | 287 | 98.14 | 271 |
| Without averaging | 100.00 | 314 | 100.00 | 265 |
| Full optimizer | 100.00 | 305 | 100.00 | 294 |
| Arm | Vocabulary construction | LM encoding boundaries | Stream/evaluation decoder |
|---|---|---|---|
| BPE with regex | Native BPE, regex pieces | Serialised regex | Native ranked merges |
| BPE without regex | Native BPE, complete documents | None | Native ranked merges |
| SlotPrice π | SlotPrice , regex-constrained occurrences | None | Minimum-count Viterbi |
| SlotPrice | SlotPrice , unrestricted occurrences | None | Minimum-count Viterbi |
| Two-stage BPE | Locally trained two-stage merge adaptation | None | Minimum-count Viterbi |
| Unigram | Likelihood-trained byte vocabulary | None | Minimum-count Viterbi |
| Language | Change (%) | interval | Holm | ||
|---|---|---|---|---|---|
| English | 1.1588 | 1.3405 | +15.68 | [+13.19, +18.18] | Yes |
| German | 1.1773 | 1.3292 | +12.92 | [+1.78, +24.06] | No |
| Russian | 0.6245 | 0.6964 | +11.53 | [+9.12, +13.93] | Yes |
| Finnish | 1.2412 | 1.3619 | +9.73 | [+6.72, +12.73] | No |
| Turkish | 1.0826 | 1.1915 | +10.06 | [+3.66, +16.46] | No |
| Vietnamese | 0.8965 | 0.9428 | +5.21 | [-3.97, +14.38] | No |
| Setting | Contrast | Effect | Replicates | Summary |
|---|---|---|---|---|
| M, 12 languages | vs. SlotPrice π , test bits/byte | 3 | ||
| M, k | vs. BPE, test bits/byte | 1 | – | |
| M, k, matched bytes | vs. SlotPrice π , BLiMP | pts | 2 | – |
| B, k, | vs. BPE, BLiMP | pts | 2 | unresolved |
| achieved | ceiling | held-out | cross (%) | rare (%) | |||
| English | |||||||
| 0 | 0 | 4.746 | 5.059 | 4.539 | 0.0 | 11.2 | 10.56 |
| 655 | 655 | 5.566 | 6.274 | 5.343 | 20.0 | 13.0 | 12.04 |
| 1,638 | 1,638 | 5.788 | 6.509 | 5.537 | 25.1 | 13.7 | 12.43 |
| 3,276 | 3,276 | 5.961 | 6.711 | 5.686 | 28.5 | 15.0 | 12.74 |
| 8,192 | 8,192 | 6.178 | 6.958 | 5.834 | 33.0 | 17.4 | 13.14 |
| Language | achieved (%) | optimal gain (%) | |
|---|---|---|---|
| English | 655 | 61.6 | |
| English | 1,638 | 75.3 | |
| English | 3,276 | 85.2 | |
| English | 8,192 | 96.9 | |
| Chinese | 655 | 84.2 | |
| Chinese | 1,638 | 98.3 |
| Random/regex change (%) | Held-out bytes/token | FIT crossing (%) | ||||
| achieved | optimal interval | regex | random | regex | random | |
| English | ||||||
| 0 | +48.7 | [47.1,53.5] | 3.803 | 2.743 | 0.0 | 26.6 |
| 163 | +47.1 | [15.2,57.0] | 4.169 | 3.018 | 13.2 | 26.4 |
| 409 | +42.9 | [14.9,52.3] | 4.282 | 3.179 | 16.9 | 27.6 |
| 819 | +37.6 | [12.0,46.8] | 4.360 | 3.344 | 20.0 | 28.5 |
| Unrestricted | Regex-fitted | |||
|---|---|---|---|---|
| Language | Grid | Rate | Grid | Rate |
| English | 0.6 | 2.4 | ||
| German | 0.6 | 2.4 | ||
| Russian | 1.2 | 2.4 | ||
| Finnish | 2.4 | 2.4 | ||
| Turkish | 0.6 | 2.4 | ||
| Comparison | Context | Relative change (%) / status | Holm |
|---|---|---|---|
| English | Token blocks | 10.44 [6.23, 14.64] | 0.060 |
| Chinese | Token blocks | 4.62 [1.96, 7.29] | 0.060 |
| German | Token blocks | 11.06 [8.99, 13.14] | 0.021 |
| Finnish | Token blocks | 6.41 [3.85, 8.97] | 0.060 |
| Russian | Token blocks | 7.45 [3.07, 11.84] | 0.060 |
| Japanese | Token blocks | 3.36 [1.74, 4.97] | 0.060 |