The Right Byte First: How UTF-16 Helps Multilingual Boundary Prediction
Organizations: Samsung Research
Abstract
Many hierarchical byte-level language models group bytes into patches using a learned boundary predictor whose view of the next codepoint depends on encoding and lookahead. In UTF-8, codepoints of many scripts take three bytes: 8 of 24 bits mark length and continuation, and the first byte carries only 4 high codepoint bits. After the same left context, a mark extending a grapheme cluster and a letter starting the next can thus share their first byte. Universal Byte-Level Encoding (UBE) keeps one- and two-byte UTF-8 encodings but writes these codepoints as two UTF-16 bytes, low byte first, so its first symbol carries 8 low codepoint bits that can distinguish such continuations. We train small causal predictors on matched FineWeb-2 text and evaluate on FLORES-200 under UTF-8, UBE, and UBE's same-length big-endian variant. At one-symbol lookahead, balanced grapheme-boundary error at codepoint boundaries across 17 languages in 13 Brahmic scripts is 8.76% with UTF-8, 8.62% with the big-endian variant, and 0.06% with UBE. When the target instead retains a parent tokenizer's subword cuts at grapheme boundaries, UBE lowers the mean error relative to UTF-8 at the same lookahead by 72.91% in Korean, 35.29% in Chinese, and 67.32-99.55% in eight more scripts. In the seven of them whose main Unicode block fits on one 256-codepoint page, the big-endian variant stays within 3.0% of UTF-8, so the gain follows byte order, not length. In Korean and Chinese, UBE's mean error falls below UTF-8's final mean error after only 25% and 37.5% of training. Which byte comes first thus affects how much lookahead a byte-level boundary predictor needs.
Figures & tables
| Encoding | |||
|---|---|---|---|
| UTF-8 | 8.76 | 6.37 | 0.20 |
| UBE | 0.06 | 0.16 | 0.19 |
| UBE-BE | 8.62 | 0.18 | 0.20 |
| Every cluster | Retained parent cuts | ||||||
|---|---|---|---|---|---|---|---|
| Encoding | Korean | Chinese | Mean | Korean | Chinese | Mean | |
| UTF-8 | 1 | 0.000 | 0.000 | 0.000 | 54.438 | 159.946 | 107.192 |
| UBE | 1 | 0.035 | 0.046 | 0.041 | 14.745 | 103.496 | 59.121 |
| UBE-BE | 1 | 0.000 | 0.000 | 0.000 | 25.357 | 121.239 | 73.298 |
| UTF-8 | 3 | 0.000 | 0.008 | 0.004 | 11.147 | 103.242 | 57.195 |
| UBE | 2 | 0.096 | 0.023 | 0.060 | 10.556 | 89.276 | 49.916 |
| Split % | ||||
|---|---|---|---|---|
| Qwen3 parent | 3,370,517 | 2,003,437 | 1,217,605 | 99.89 |
| Bwen-8B | 3,359,694 | 1,995,374 | 1,214,734 | 99.49 |
| Bwen-8B † | 1,752,896 | 573,822 | 1,578 | 66.18 |
| Panel | English | English | |
| Global model: patch positions per codepoint | |||
| Parent target | 1.2768 | 0.2093 | 6.10 |
| Bwen-8B, realized | 1.2743 | 0.2057 | 6.19 |
| Retained-parent target | 0.4705 | 0.2093 | 2.25 |
| Local modules: byte symbols per codepoint | |||
| UTF-8 bytes | 2.7125 | 1.0010 | 2.71 |
| Model | Items changed | % | Flag share (%) | Bytes/patch |
|---|---|---|---|---|
| Bwen-8B | 458/850 | 53.9 | 13.19 | 2.127 |
| Bolmo-1B | 328/850 | 38.6 | 9.76 | 1.746 |
| Bolmo-7B | 326/850 | 38.4 | 10.46 | 1.746 |
| Pair | 95% interval | Excl. 0 | |
|---|---|---|---|
| Qwen3 Bwen-8B | +0.0177 | [+0.0074, +0.0283] | 7/17 |
| OLMo-2 Bolmo-1B | +0.0064 | [−0.0080, +0.0214] | 2/17 |
Appendix figures & tables26 assets
Supplementary material from the paper’s appendix.
Appendix
| Parent (Qwen3) | Bwen-8B | |||||||||
| Language | Shared % | |||||||||
| Amharic | 87,132 | 111,737 | 40,880 | 40,880 | 0 | 111,600 | 40,752 | 40,752 | 0 | 99.87 |
| Assamese | 83,536 | 148,763 | 93,534 | 54,661 | 38,873 | 144,474 | 92,098 | 54,662 | 37,436 | 97.07 |
| Bengali | 81,693 | 138,814 | 87,846 | 46,927 | 40,919 | 138,133 | 87,858 | 46,948 | 40,910 | 99.47 |
| English ∗ | 131,966 | 27,621 | 0 | 0 | 0 | 27,149 | 0 | 0 | 0 | 97.71 |
| Gujarati | 80,578 | 186,119 | 125,560 | 79,712 | 45,848 | 186,117 | 125,559 | 79,711 | 45,848 | 99.99 |
| Language | /cut | Coarsening | Multi split % | ||||
|---|---|---|---|---|---|---|---|
| Amharic | 34,434 | 0 | 0 | 0 | 0.0000 | 3.31 | — |
| Assamese | 103,183 | 37,498 | 0 | 37,498 | 0.3670 | 1.45 | 88.07 |
| Bengali | 107,247 | 41,026 | 0 | 41,026 | 0.3862 | 1.30 | 88.31 |
| English ∗ | 49,290 | 0 | 0 | 0 | 0.0000 | 0.55 | — |
| Gujarati | 103,873 | 45,243 | 0 | 45,243 | 0.4398 | 1.80 | 98.61 |
| Hindi | 108,523 | 44,480 | 0 | 44,480 | 0.4137 | 1.12 | 98.53 |
| Symbols | Positions per codepoint | |||||||
|---|---|---|---|---|---|---|---|---|
| Language | Scalars | Parent | UTF-8 | UBE | Parent | Bwen | Retained | UBE saving % |
| Assamese | 127,594 | 148,763 | 340,036 | 233,823 | 1.1659 | 1.1323 | 0.4328 | 31.2 |
| Bengali | 130,391 | 138,814 | 348,729 | 239,566 | 1.0646 | 1.0594 | 0.3909 | 31.3 |
| Gujarati | 126,428 | 186,119 | 331,068 | 228,751 | 1.4721 | 1.4721 | 0.4790 | 30.9 |
| Hindi | 131,180 | 121,957 | 337,439 | 234,314 | 0.9297 | 0.9287 | 0.3941 | 30.6 |
| Kannada | 138,027 | 191,127 | 375,341 | 256,686 | 1.3847 | 1.3845 | 0.5456 | 31.6 |
| Script | Vowel sign | Consonant | UTF-8 first (sign / base) | UTF-16LE first (sign / base) |
|---|---|---|---|---|
| Devanagari | U+093F | U+092E | E0 / E0 | 3F / 2E |
| Bengali | U+09BF | U+09AE | E0 / E0 | BF / AE |
| Oriya | U+0B3F | U+0B2E | E0 / E0 | 3F / 2E |
| Sinhala | U+0DD2 | U+0DB8 | E0 / E0 | D2 / B8 |
| Thai | U+0E34 | U+0E21 | E0 / E0 | 34 / 21 |
| Myanmar | U+102D | U+1019 | E1 / E1 | 2D / 19 |
| Error rate (%) | ||||||
|---|---|---|---|---|---|---|
| Encoding | Balanced 0 / 1 | Missed | False cut | Within scalar | Pairs both right | |
| UTF-8 | 1 | 8.765 / 8.747 | 9.504 | 8.008 | 0.000 | 0 / 0 |
| UTF-8 | 2 | 6.314 / 6.434 | 5.114 | 7.634 | 0.000 | 4,676 / 4,949 |
| UTF-8 | 3 | 0.217 / 0.179 | 0.049 | 0.347 | 0.000 | 17,204 / 17,204 |
| UBE | 1 | 0.021 / 0.101 | 0.100 | 0.021 | 0.194 | 17,204 / 17,204 |
| UBE | 2 | 0.128 / 0.187 | 0.024 | 0.290 | 0.054 | 17,204 / 17,204 |
| Balanced error at (%) | |||||
|---|---|---|---|---|---|
| Language | Script | UTF-8 | UBE | UBE-BE | UBE seeds 0 / 1 |
| Assamese | Bengali | 8.294 | 0.002 | 7.834 | 0.002 / 0.002 |
| Bengali | Bengali | 8.060 | 0.005 | 7.350 | 0.005 / 0.005 |
| Burmese | Myanmar | 10.556 | 0.004 | 10.485 | 0.005 / 0.003 |
| Gujarati | Gujarati | 9.231 | 0.000 | 8.906 | 0.000 / 0.000 |
| Hindi | Devanagari | 8.504 | 0.003 | 8.055 | 0.003 / 0.004 |
| Contrast | Stated direction | Estimate (pp) | 95% interval (pp) |
|---|---|---|---|
| UBE UTF-8 | negative | −8.695 | [−8.757, −8.633] |
| UTF-8 UTF-8 | negative | −8.558 | [−8.620, −8.496] |
| UBE UBE-BE | negative | −8.555 | [−8.617, −8.493] |
| UBE-BE UBE-BE | negative | −8.438 | [−8.499, −8.378] |
| UBE UTF-8 | none stated | −0.137 | [−0.148, −0.127] |
| Balanced error (%) | ||||
|---|---|---|---|---|
| Encoding | All scalar ends | Next to a joiner | Other scalar ends | |
| UTF-8 | 1 | 8.7557 | 50.00 | 8.5994 |
| UTF-8 | 2 | 6.3742 | 50.15 | 6.2133 |
| UTF-8 | 3 | 0.1980 | 61.22 | 0.0019 |
| UBE | 1 | 0.0609 | 3.66 | 0.0492 |
| UBE | 2 | 0.1573 | 40.62 | 0.0123 |
| Language | Scalars | UTF-8 | UBE | Saved % | Parent | Retained | Split % |
|---|---|---|---|---|---|---|---|
| Korean | 65,965 | 157,799 | 111,887 | 29.10 | 45,020 | 41,075 | 4.74 |
| Chinese (Simplified) | 43,248 | 120,803 | 82,081 | 32.05 | 27,701 | 27,391 | 0.61 |
| Target | Baseline | Korean | Chinese |
|---|---|---|---|
| Every cluster | Scalar decoder | 0.00 | 0.00 |
| Every cluster | No cuts | 984.66 | 976.60 |
| Retained parent cuts | Scalar decoder | 377.32 | 366.65 |
| Retained parent cuts | No cuts | 607.34 | 609.95 |
| Encoding | Korean: seeds 0 / 1 / 2 | Chinese: seeds 0 / 1 / 2 | |
|---|---|---|---|
| Every cluster | |||
| UTF-8 | 1 | 0.000 / 0.000 / 0.000 | 0.000 / 0.000 / 0.000 |
| UBE | 1 | 0.000 / 0.030 / 0.076 | 0.023 / 0.000 / 0.116 |
| UBE-BE | 1 | 0.000 / 0.000 / 0.000 | 0.000 / 0.000 / 0.000 |
| UTF-8 | 3 | 0.000 / 0.000 / 0.000 | 0.023 / 0.000 / 0.000 |
| UBE | 2 | 0.258 / 0.015 / 0.015 | 0.069 / 0.000 / 0.000 |
| Korean | Chinese | |||
| Contrast | Difference | 95% interval | Difference | 95% interval |
| Every cluster | ||||
| UBE UTF-8 | +0.035 | [+0.000, +0.095] | +0.046 | [+0.015, +0.086] |
| UBE UBE-BE | +0.035 | [+0.000, +0.095] | +0.046 | [+0.015, +0.086] |
| UBE UTF-8 | +0.096 | [+0.005, +0.229] | +0.015 | [+0.000, +0.039] |
| UBE UBE-BE | +0.096 | [+0.005, +0.229] | +0.023 | [+0.000, +0.062] |
| Encoding | Language | Within / 1,000 | Missed % | False cut % | F1 % | Split % | |
|---|---|---|---|---|---|---|---|
| Every cluster | |||||||
| UTF-8 | 1 | Korean | 0.000 | 0.000 | — | 100.000 | 0.000 |
| UTF-8 | 1 | Chinese | 0.000 | 0.000 | — | 100.000 | 0.000 |
| UBE | 1 | Korean | 0.025 | 0.001 | — | 99.998 | 0.003 |
| UBE | 1 | Chinese | 0.031 | 0.002 | — | 99.998 | 0.003 |
| UBE-BE | 1 | Korean | 0.000 | 0.000 | — | 100.000 | 0.000 |
| Language | Position | Scalar gaps | Target cuts % |
|---|---|---|---|
| Korean | Before whitespace | 14,418 | 100.00 |
| Korean | After whitespace | 14,418 | 2.53 |
| Korean | Between whitespace | 4 | 75.00 |
| Korean | Neither side | 36,113 | 69.99 |
| Chinese | Before whitespace | 1,057 | 100.00 |
| Chinese | After whitespace | 1,057 | 36.23 |
| Encoding | Before | After | Between | Neither side | |
|---|---|---|---|---|---|
| Korean | |||||
| UTF-8 | 1 | 0.000 | 0.000 | 25.000 | 9.941 |
| UBE | 1 | 0.000 | 0.005 | 25.000 | 2.688 |
| UBE-BE | 1 | 0.000 | 0.000 | 33.333 | 4.627 |
| UTF-8 | 3 | 0.009 | 0.000 | 75.000 | 2.023 |
| UBE | 2 | 0.000 | 0.000 | 25.000 | 1.920 |
| One symbol ( ) | Whole next scalar | ||||
|---|---|---|---|---|---|
| Language | UBE UTF-8 | UBE UBE-BE | UBE-BE UTF-8 | UBE UTF-8 | UBE UBE-BE |
| Japanese | −79.94 | −71.05 | −8.89 | −2.53 | −0.17 |
| [−82.55, −77.43] | [−73.64, −68.52] | [−10.33, −7.42] | [−3.37, −1.66] | [−0.89, +0.60] | |
| Thai | −56.37 | −54.73 | −1.64 | −0.67 | −0.22 |
| [−58.10, −54.64] | [−56.42, −53.01] | [−2.18, −1.08] | [−0.98, −0.34] | [−0.51, +0.08] | |
| Lao | −67.00 | −65.83 | −1.18 | +0.18 | −0.02 |
| Language | Encoding | 250 | 500 | 750 | 1,000 | 1,250 | 1,500 | 1,750 | 2,000 |
|---|---|---|---|---|---|---|---|---|---|
| Korean and Chinese (Section 4.1 ) | |||||||||
| Korean | UTF-8 | 80.1 | 64.1 | 62.0 | 57.9 | 58.4 | 54.8 | 54.2 | 54.4 |
| Korean | UBE-BE | 60.6 | 37.8 | 31.2 | 29.3 | 27.0 | 26.4 | 25.7 | 25.4 |
| Korean | UBE | 62.1 | 30.2 | 21.6 | 18.5 | 16.0 | 15.6 | 15.1 | 14.7 |
| Chinese | UTF-8 | 235.7 | 210.3 | 192.6 | 180.4 | 173.0 | 164.9 | 162.2 | 159.9 |
| Chinese | UBE-BE | 215.8 | 181.7 | 158.6 | 143.6 | 135.9 | 127.7 | 123.4 | 121.2 |
| Parent margin | Conv. margin | Ratio | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Language | base | mark | base | mark | parent | conv. | 95% interval | 95% interval | ||
| Assamese | 25.88 | 22.49 | 19.57 | 16.35 | 0.8689 | 0.8354 | −0.0335 | [−0.0865, +0.0197] | −0.0123 | [−0.0527, +0.0261] |
| Bengali | 29.69 | 25.90 | 25.41 | 22.35 | 0.8722 | 0.8796 | +0.0074 | [−0.0358, +0.0506] | −0.0083 | [−0.0350, +0.0175] |
| Gujarati | 28.52 | 22.37 | 24.41 | 19.96 | 0.7845 | 0.8179 | +0.0334 | [+0.0059, +0.0636] | −0.0260 | [−0.0475, −0.0049] |
| Hindi | 30.26 | 24.51 | 27.92 | 22.99 | 0.8098 | 0.8232 | +0.0135 | [−0.0147, +0.0415] | −0.0126 | [−0.0317, +0.0056] |
| Kannada | 30.51 | 24.70 | 24.70 | 20.78 | 0.8095 | 0.8412 | +0.0317 | [−0.0067, +0.0715] | −0.0184 | [−0.0460, +0.0099] |
| Parent margin | Conv. margin | Ratio | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Language | base | mark | base | mark | parent | conv. | 95% interval | 95% interval | ||
| Assamese | 17.01 | 16.62 | 11.98 | 11.35 | 0.9772 | 0.9471 | −0.0301 | [−0.1002, +0.0424] | +0.0358 | [−0.0160, +0.0888] |
| Bengali | 21.17 | 19.94 | 15.78 | 15.39 | 0.9421 | 0.9753 | +0.0331 | [−0.0190, +0.0872] | −0.0282 | [−0.0613, +0.0045] |
| Gujarati | 20.17 | 16.66 | 13.52 | 11.86 | 0.8257 | 0.8775 | +0.0517 | [−0.0022, +0.1114] | −0.0578 | [−0.1023, −0.0131] |
| Hindi | 24.57 | 22.18 | 21.42 | 19.01 | 0.9029 | 0.8873 | −0.0156 | [−0.0558, +0.0252] | −0.0129 | [−0.0462, +0.0189] |
| Kannada | 22.32 | 18.32 | 15.94 | 12.69 | 0.8205 | 0.7965 | −0.0240 | [−0.0655, +0.0180] | +0.0315 | [−0.0018, +0.0688] |
| Omitted language | ||
|---|---|---|
| Assamese | +0.0205 | −0.0206 |
| Bengali | +0.0183 | −0.0208 |
| Gujarati | +0.0169 | −0.0197 |
| Hindi | +0.0185 | −0.0206 |
| Kannada | +0.0167 | −0.0202 |
| Khmer | +0.0200 | −0.0219 |
| Instability (%) | of 50 | Flag share (%) | Bytes per patch | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Language | Bwen | 1B | 7B | 1B=7B | Bwen | 1B | 7B | Bwen | 1B | 7B |
| Assamese | 72 | 64 | 64 | 50 | 8.97 | 13.07 | 13.18 | 2.352 | 2.057 | 2.053 |
| Bengali | 74 | 82 | 82 | 50 | 7.50 | 14.20 | 14.16 | 2.523 | 2.201 | 2.200 |
| Gujarati | 34 | 0 | 0 | 50 | 12.48 | 1.21 | 1.36 | 1.764 | 1.590 | 1.591 |
| Hindi | 68 | 80 | 80 | 50 | 15.64 | 17.82 | 18.49 | 2.771 | 2.629 | 2.630 |
| Kannada | 42 | 0 | 0 | 50 | 13.37 | 1.37 | 2.00 | 1.950 | 1.566 | 1.564 |
| Model | Bytes/patch, instability | Bytes/patch, flag share | Flag share, instability |
|---|---|---|---|
| Bwen-8B | +0.620 | −0.369 | −0.091 |
| Bolmo-1B | +0.757 | +0.511 | +0.894 |
| Bolmo-7B | +0.764 | +0.504 | +0.883 |
| Bits per scored byte | ||||||
|---|---|---|---|---|---|---|
| Language | Parent | Bwen path | Gap | Flag term | Gap flag | Flag share % |
| Assamese | 0.7307 | 0.9526 | 0.2219 | 0.0855 | 0.1364 | 8.97 |
| Bengali | 0.5550 | 0.6505 | 0.0955 | 0.0488 | 0.0467 | 7.50 |
| Gujarati | 0.6361 | 0.7689 | 0.1328 | 0.0959 | 0.0369 | 12.48 |
| Hindi | 0.5150 | 0.5798 | 0.0648 | 0.0907 | −0.0259 | 15.64 |
| Kannada | 0.5734 | 0.7487 | 0.1753 | 0.1001 | 0.0752 | 13.37 |
| Model | Variants | Max (bits) | Mean (bits) | Paths moved |
|---|---|---|---|---|
| Bwen-8B | 306 | 12.32 | 1.54 | 10 |
| Bolmo-1B | 2,550 | 41.28 | 1.83 | 11 |
| Bolmo-7B | 2,550 | 20.88 | 1.06 | 29 |
| Language | Inflation % | Added bits | First-token bits | Ratio |
|---|---|---|---|---|
| Assamese | 44.7 | 146.3 | 17.3 | 8.4 |
| Bengali | 61.2 | 159.1 | 18.2 | 8.7 |
| Gujarati | 76.6 | 194.3 | 19.8 | 9.8 |
| Hindi | 83.9 | 179.0 | 19.8 | 9.0 |
| Kannada | 78.7 | 199.2 | 18.2 | 11.0 |
| Khmer | 88.4 | 325.2 | 20.1 | 16.2 |