Writing-System-Level Tokenizer Adaptation for Byte-Level BPE

arXiv cs.CL Papers

Summary

This paper introduces BPE-guided insertion for post-hoc tokenizer adaptation on byte-level BPE models, keeping vocabulary size fixed and preserving most token-ID assignments. The method reduces Ukrainian token counts by ~33-36% while minimizing impact on English and other European languages.

arXiv:2608.00582v1 Announce Type: new Abstract: Pretrained byte-level BPE tokenizers can segment underrepresented languages inefficiently. Replacing a tokenizer changes the meaning of nearly every token ID, while vocabulary expansion enlarges the model's embedding and output matrices. We study post-hoc adaptation that keeps the model-vocabulary size fixed and preserves most existing token-to-ID assignments as a construction-time compatibility property. Directly transferring tokens from a language-specific tokenizer does not guarantee derivability through the target BPE merge graph: an inserted entry can conflict with the target's greedy merge ranks. We formalize this failure as the merge ordering problem and introduce BPE-guided insertion, which builds each transferred token through a target-reachable decomposition. Our pipeline uses script-aware row selection to limit collateral fragmentation, reconstructs target-script byte-level prerequisites, and applies guided insertion to maintain merge-graph reachability. On Ukrainian adaptations of Nemotron and GPT-OSS, it reduces token counts by 33.5% and 36.6%, keeps changes on English and the evaluated four-language European aggregate within 0.05%, and retains 78.5%/77.3% of original model-vocabulary rows at the same IDs. Constraint-matched global and frequency-based removal achieve similar Ukrainian compression but increase English/European token counts by 0.7-2.2%; fresh same-size retraining compresses Ukrainian slightly more but retains effectively no same-ID rows and increases English token counts by 7.6-8.6%. The reallocation increases token counts on the evaluated three-language Cyrillic micro-aggregate by 6.7%/10.1%. Structural audits find all 28,134/45,398 inserted BPE nodes reachable under ordinary rank-ordered merging and no retained same-ID model-vocabulary entry newly broken. We release all tokenizers and code.
Original Article
View Cached Full Text

Cached at: 08/04/26, 07:43 AM

# Writing-System-Level Tokenizer Adaptation for Byte-Level BPE
Source: [https://arxiv.org/html/2608.00582](https://arxiv.org/html/2608.00582)
###### Abstract

Pretrained byte\-level BPE tokenizers can segment underrepresented languages inefficiently\. Replacing a tokenizer changes the meaning of nearly every token ID, while vocabulary expansion enlarges the model’s embedding and output matrices\. We study post\-hoc adaptation that keeps the model\-vocabulary size fixed and preserves most existing token\-to\-ID assignments as a construction\-time compatibility property\. Directly transferring tokens from a language\-specific tokenizer does not guarantee derivability through the target BPE merge graph: an inserted entry can conflict with the target’s greedy merge ranks\. We formalize this failure as themerge ordering problemand introduceBPE\-guided insertion, which builds each transferred token through a target\-reachable decomposition\. Our pipeline uses script\-aware row selection to limit collateral fragmentation, reconstructs target\-script byte\-level prerequisites, and applies guided insertion to maintain merge\-graph reachability\. On Ukrainian adaptations of Nemotron and GPT\-OSS, it reduces token counts by 33\.5% and 36\.6%, keeps changes on English and the evaluated four\-language European aggregate within 0\.05%, and retains 78\.5%/77\.3% of original model\-vocabulary rows at the same IDs\. Constraint\-matched global and frequency\-based removal achieve similar Ukrainian compression but increase English/European token counts by 0\.7–2\.2%; fresh same\-size retraining compresses Ukrainian slightly more but retains effectively no same\-ID rows and increases English token counts by 7\.6–8\.6%\. The reallocation increases token counts on the evaluated three\-language Cyrillic micro\-aggregate by 6\.7%/10\.1%\. Structural audits find all 28,134/45,398 inserted BPE nodes reachable under ordinary rank\-ordered merging and no retained same\-ID model\-vocabulary entry newly broken\. We release all tokenizers and code\.111[https://github\.com/BogdanDidenko/tokenizer\-transfer\-framework](https://github.com/BogdanDidenko/tokenizer-transfer-framework); reproducibility releasetokshop\-colm2026\-repro\-v1\.

## 1Introduction

Vocabulary adaptation for underrepresented languages and specialized domains differs fundamentally by tokenizer architecture\. For SentencePiece\-based models,Kiulian et al\. \([2025](https://arxiv.org/html/2608.00582#bib.bib9)\)demonstrate fixed\-vocabulary reallocation for Ukrainian, Arabic, and Georgian via score\-reassigned merging\. For byte\-level BPE\(Radford et al\.,[2019](https://arxiv.org/html/2608.00582#bib.bib23)\)—used in GPT\-OSS\-20B\(OpenAI,[2025](https://arxiv.org/html/2608.00582#bib.bib18)\), Nemotron\-3\(NVIDIA,[2024](https://arxiv.org/html/2608.00582#bib.bib16)\), Qwen\(Yang et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib29)\), and Aya\(Aryabumi et al\.,[2024](https://arxiv.org/html/2608.00582#bib.bib2)\)—to our knowledge no post\-hoc fixed\-vocabulary method yet solves this setting, despite highfertility\(tokens per word\) in underrepresented languages: the unmodified Nemotron/GPT\-OSS tokenizers require 2\.71/2\.60 tokens per Ukrainian word versus 1\.32/1\.26 for English \(Table[6](https://arxiv.org/html/2608.00582#A5.T6)\), increasing inference cost and compressing effective context windows\(Rust et al\.,[2021](https://arxiv.org/html/2608.00582#bib.bib25); Petrov et al\.,[2024](https://arxiv.org/html/2608.00582#bib.bib21)\)\.

Existing work on byte\-level BPE expands the vocabulary, replaces the tokenizer, or changes allocation during pretraining; none addresses post\-hoc adaptation under a fixed vocabulary budget \(§2\)\. We evaluate cheap same\-size retraining directly; surgery instead preserves every non\-selected vocabulary index and its associated input/output embedding rows\. This is a construction\-time compatibility advantage, not a downstream\-quality claim; measuring continued\-pretraining savings requires a model\-level experiment\. The structural obstacle is themerge ordering problem: in byte\-level BPE, merge rules are applied greedily in rank order; when a new token is inserted with a heuristic split, an earlier\-ranking merge may fire first, rendering the inserted token strict\-unreachable—a failure mode termedill\-tokenization\(Balde et al\.,[2024](https://arxiv.org/html/2608.00582#bib.bib3)\)\.Balde et al\. \([2024](https://arxiv.org/html/2608.00582#bib.bib3)\)report the same failure mode in domain vocabulary adaptation, and our worked Ukrainian example in §[3\.4](https://arxiv.org/html/2608.00582#S3.SS4)exhibits the corresponding target\-rank conflict\. Our construction goal is therefore stricter than vocabulary membership: every inserted node must remain derivable by ordinary rank\-ordered BPE, and no retained same\-ID entry may lose that property\.

We proposetokenizer surgery, centered onBPE\-guided insertion\. We convert tokens from a*character\-level*BPE donor—whose merges operate on Unicode characters rather than the target’s raw UTF\-8 bytes—and register a decomposition reachable under the target merge ordering, without changing BPE inference\. To keep the vocabulary fixed\(Kiulian et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib9); Downey et al\.,[2023](https://arxiv.org/html/2608.00582#bib.bib6)\),script\-aware removalfrees slots under a configurable retention filter; the target script is then rebuilt from a clean base inventory before donor\-token insertion\. This instantiation is immediately useful when adaptation can be framed as writing\-system\-level reallocation, as in Ukrainian\. When the target language shares its script with languages that must also be preserved, the current pipeline lacks a reliable way to free slots without deleting from the same inventory it aims to keep; we leave such same\-script reallocation to future work\.

Our contributions:

1. 1\.We formalize the merge ordering problem and propose target\-guided insertion that makes every inserted node derivable under the target’s merge ranks \(§[3\.4](https://arxiv.org/html/2608.00582#S3.SS4)–[3\.5](https://arxiv.org/html/2608.00582#S3.SS5)\)\.
2. 2\.We combine dependency\-safe script\-aware removal, target\-script base reconstruction, and target\-guided insertion in a fixed\-vocabulary writing\-system\-level pipeline \(§[3](https://arxiv.org/html/2608.00582#S3)\)\.
3. 3\.We evaluate real removal, continued\-BPE, runtime\-patching, and retraining baselines under a pinned suite, and audit inserted, retained, and full\-vocabulary merge reachability \(§[4](https://arxiv.org/html/2608.00582#S4)\)\.

## 2Background and Related Work

#### Vocabulary Adaptation\.

Approaches differ fundamentally in whether they expand, replace, or reallocate vocabulary\.Expansionadds tokens to the existing vocabulary, increasing embedding matrix size:Chau et al\. \([2020](https://arxiv.org/html/2608.00582#bib.bib4)\)extend multilingual BERT;Kim et al\. \([2024](https://arxiv.org/html/2608.00582#bib.bib8)\)add 8,960 Korean tokens to SOLAR\-10\.7B with progressive unfreezing;Wang et al\. \([2020](https://arxiv.org/html/2608.00582#bib.bib27)\)extend to low\-resource languages\.Full replacementtrains a new tokenizer and reinitializes all embeddings\(Dobler & de Melo,[2023](https://arxiv.org/html/2608.00582#bib.bib5); Remy et al\.,[2023](https://arxiv.org/html/2608.00582#bib.bib24); Downey et al\.,[2023](https://arxiv.org/html/2608.00582#bib.bib6)\)\.Pre\-training\-timemethods modify BPE training itself: OBPE\(Patil et al\.,[2022](https://arxiv.org/html/2608.00582#bib.bib20)\)biases merge selection toward cross\-lingual overlap; XLM\-V\(Liang et al\.,[2023](https://arxiv.org/html/2608.00582#bib.bib14)\)trains a larger shared vocabulary\. Continued BPE training\(Purason et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib22)\)extends an existing tokenizer by resuming merge learning on target\-domain data and pairs this with leaf\-based pruning, reducing unreachable or unused added tokens without relying on an auxiliary donor tokenizer; we use the authors’ implementation directly\.222[https://github\.com/taidopurason/tokenizer\-extension](https://github.com/taidopurason/tokenizer-extension), commit15e9ed7f\.For SentencePiece tokenizers,Kiulian et al\. \([2025](https://arxiv.org/html/2608.00582#bib.bib9)\)maintain fixed vocabulary size by merging score\-reassigned vocabularies for Ukrainian, Arabic, and Georgian, but do not repair the explicit byte\-level BPE merge tables studied here\. SentencePiece provides both Unigram and BPE models; merge ancestry is recoverable for the latter, whereas score reassignment is native to the former\. In a same\-script setting,Ociepa et al\. \([2025](https://arxiv.org/html/2608.00582#bib.bib17)\)report that directly combining a Polish tokenizer with Mistral became ambiguous because overlapping vocabularies did not induce compatible token\-pair merges\. Our setting is narrower and more structural: post\-hoc modification of an existing byte\-level BPE merge table under a fixed vocabulary budget\.Land & Bartolo \([2024](https://arxiv.org/html/2608.00582#bib.bib11)\)independently document that many tokens in deployed multilingual tokenizers are under\-trained, supporting the practical case for removal\-based reallocation that targets rarely\-trained inventory\. To our knowledge, no prior work addresses post\-hoc token insertion in fixed\-vocabulary byte\-level BPE via an explicit structural correction of the stored merge table\.

#### The Ill\-Tokenization Problem\.

Balde et al\. \([2024](https://arxiv.org/html/2608.00582#bib.bib3)\)identify that naively appended domain tokens receive lower merge priority than existing vocabulary, causing BPE to ignore them—a failure they termill\-tokenization\. Their solution, AdaptBPE, patches BPE initialization at runtime via longest\-substring matching and does not modify the stored merge table; its published protocol expands rather than reallocates the vocabulary\. The study evaluates BART/RoBERTa \(64\.13% ill\-tokenization before the patch\); a separate limitation diagnostic finds 27\.76% under standard LLaMA\-2\-7B tokenization but does not apply AdaptBPE to that model\.Sharthak et al\. \([2025](https://arxiv.org/html/2608.00582#bib.bib26)\)observe the same root cause and sidestep it via wholesale tokenizer transplantation, initializing the destination tokenizer’s embedding matrix with local subword and global semantic heuristics\.333[https://github\.com/Tinycompany\-AI/TokenAdapt](https://github.com/Tinycompany-AI/TokenAdapt), commit3f7ff1de\.TokenAdapt is therefore an embedding\-transfer method rather than an alternative tokenizer construction: its token counts are exactly those of its chosen destination tokenizer\.Purason et al\. \([2025](https://arxiv.org/html/2608.00582#bib.bib22)\)likewise report that conventional tokenizer extension can add tokens that are unreachable or never used, and provide an open\-source diagnostic for detecting unreachable vocabulary entries\. Our BPE\-guided insertion addresses this failure structurally within the current writing\-system\-level pipeline by correcting the stored merge table rather than patching runtime behavior\.

#### Ukrainian\-language tokenization\.

Adjacent Ukrainian\-NLP work targets different layers of the stack: rule\-based word/sentence segmentation\(lang\-uk,[2016](https://arxiv.org/html/2608.00582#bib.bib12)\), tokenizer\-efficiency evaluation\(Korablyov et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib10)\), and multilingual\-LLM adaptation combining tokenizer reallocation with data curation and model training\(Paniv et al\.,[2026](https://arxiv.org/html/2608.00582#bib.bib19)\)\. None addresses post\-hoc fixed\-vocabulary byte\-level BPE merge\-table modification, which is the contribution of this paper\.

#### Embedding Initialization\.

Initializing embeddings for new tokens is orthogonal to our structural contribution but critical for downstream performance\. Methods range from sub\-token averaging\(Kim et al\.,[2024](https://arxiv.org/html/2608.00582#bib.bib8)\)and overlap\-based transfer\(Dobler & de Melo,[2023](https://arxiv.org/html/2608.00582#bib.bib5); Remy et al\.,[2023](https://arxiv.org/html/2608.00582#bib.bib24); Kiulian et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib9)\)to model\-aware approaches such as MATT\(Haltiuk & Smywinski\-Pohl,[2025](https://arxiv.org/html/2608.00582#bib.bib7)\)\. Our tokenizer surgery is compatible with any initialization method applied post\-surgery\.

## 3Method

### 3\.1Pipeline Overview

Tokenizer surgery maintains a fixed vocabulary size\|V\|\|V\|in three stages: script\-aware removal frees slots, target\-script base reconstruction restores a controlled inventory of target\-script*base tokens*, and BPE\-guided insertion adds donor tokens into the rebuilt byte\-level vocabulary\. These stages address, respectively, collateral deletion outside the declared removal inventory, missing partial\-byte dependencies after the target\-script reset, and target\-rank conflicts that can make simple donor\-merge appends unreachable \(§[3\.4](https://arxiv.org/html/2608.00582#S3.SS4)\)\.

### 3\.2Script\-Aware Token Removal

We classify each token by writing system using Unicode script detection viaunicodedataplusand select removal candidates from a configurable set of removal\-eligible scripts while excluding a declared*retention inventory*\. Tokens without a selected removal script, including Common\-only surfaces, are not selected by this rule; the separate target\-script reset takes precedence over the exclusion because it deliberately rebuilds the Cyrillic region\. This differs from the corpus\-frequency vocabulary reduction ofAlabi et al\. \([2022](https://arxiv.org/html/2608.00582#bib.bib1)\): they retain high\-frequency subwords from the adaptation corpora \(plus 1,000 entries from the original tokenizer\), whereas we classify decoded surfaces directly and validate the resulting merge structure\. In our tokenizer artifacts, higher vocabulary IDs generally correspond to later\-added merges, so we use descending ID order as a practical removal heuristic within each removal script\. A decoded surface may contain characters from several writing systems, so it is excluded from script\-selected removal if any character belongs to the retention inventory\. This additionalunicodedatapluscheck prevents a multi\-script surface from being selected merely because one of its labels is removal\-eligible\.

In these experiments, quantitative collateral\-preservation claims are limited to English and the four Latin\-script corpora in the EU aggregate\. Additional build\-specific exclusions in the frozen construction configs are reproducibility parameters, not evaluated preservation targets\. Appendix[D](https://arxiv.org/html/2608.00582#A4)reports every selected row by primary writing system; we make no preservation claim for writing systems absent from the evaluation suite\.

After removal, we first applythree\-component checking: a merge\[L,R\]→T\[L,R\]\\to Tis retained only if all three ofLL,RR, andTTremain in the vocabulary; if any one was removed, the merge rule is dropped \(no merge is added in this step\)\. This local check is necessary but not sufficient: removing an internal node can leave a retained parent without any complete derivation even when every remaining merge is individually well formed\. We therefore run an exact strict\-backend merge\-graph audit\. For an optional script\-selected prerequisite that breaks a retained token, we restore that prerequisite and replace it with the next eligible descending\-ID candidate; if a mandatory target\-reset row caused the failure, the dependent token would enter the removal closure\. We repeat selection, merge cleanup, and strict audit until no retained same\-ID entry is newly broken while preserving the exact slot budget\. This dependency repair restored 2 Nemotron and 14 GPT\-OSS candidates; no target\-reset closure was needed in either build\.

### 3\.3Target\-Script Base Reconstruction

For the target script itself—Cyrillic in our Ukrainian setting—we do not attempt to preserve arbitrary higher\-level merges\. Byte\-level BPE creates hidden dependencies through shared partial tokens \(e\.g\., the byte token\[20 D0\], a visible\-space byte fused with a Cyrillic lead byte, participates in merges for many distinct Cyrillic letter forms\), making selective retention brittle\. Instead, we reduce the target\-script region to letter\-level coverage and then complete a controlled base inventory of*base tokens*containing every target\-script letter in uppercase and lowercase, with and without leading space\. Existing*base tokens*are retained when available; only missing ones are synthesized by adding the minimal byte\-level merges needed to assemble them from byte\-level tokens that already remain in the vocabulary\.

For example, Figure[1](https://arxiv.org/html/2608.00582#S3.F1)shows how existing byte\-level tokens\[20 D0\]and\[B0\]can be merged into the space\-prefixed*base token*\[20 D0 B0\]\(␣а\)\. Analogous merges complete the rest of the target\-script inventory and provide the controlled foundation on which BPE\-guided insertion builds larger tokens \(§[3\.5](https://arxiv.org/html/2608.00582#S3.SS5)\)\.

existing byte\-level tokens20 D0\+\+B0→\\rightarrow20 D0 B0\(␣а\)new*base token*

Figure 1:Composing a missing target\-script*base token*from existing byte\-level tokens\. If the inputs for a missing*base token*already remain in the vocabulary, we add only the final merge that composes it; repeating this restores the target\-script building blocks used for later insertion\.

### 3\.4The Merge Ordering Problem

After reconstructing a controlled target\-script inventory, the remaining question is no longer whether the pieces of a donor token exist\. It is whether the current target merge table will ever expose the boundary at which a newly added merge is supposed to fire\.

#### Hidden internal nodes\.

This is more subtle than ordinary string segmentation because byte\-level BPE already contains internal graph nodes that do not align with Unicode character boundaries\. In GPT\-OSS, for example,\[20 D0\]\(visible space plus a dangling Cyrillic lead byte\) is the parent of space\-prefixed letters such as\[20 D0 B0\]\(␣а\),\[20 D0 B1\]\(␣б\), and\[20 D0 BC\]\(␣м\)\. The vocabulary also contains\[D0 BE D0\], which combines the full letter о with the lead byte of the next Cyrillic character and is then extended into\[D0 BE D0 B2\]\(ов\),\[D0 BE D0 B4\]\(од\),\[D0 BE D0 BD\]\(он\), and related nodes\.

#### Worked donor\-target conflict\.

A merge\(L,R\)→T\(L,R\)\\to Tis therefore reachable only if tokenizingTTunder the current merge ranks naturally yields\[L,R\]\[L,R\]as the final unresolved split forTT\. Figure[2](https://arxiv.org/html/2608.00582#S3.F2)gives a worked example for the Ukrainian token кран\. In both GPT\-OSS and Nemotron, the unmodified target tokenizer already routes this string through\[D0 BA D1 80 D0 B0\]\|\|\[D1 97 D0 BD\], i\.e\., roughly кра∣\\midн\. The second node\[D1 97 D0 BD\]is itself built as\[D1 97\] \+ \[D0 BD\]and reused in larger merges such as Укран\. A donor\-consistent split would place the boundary after кра, but if we register that donor boundary, the new merge never fires because the current target graph does not expose\[D0 BA D1 80 D0 B0 D1 97\]as the final unresolved left component\. The added token is present in the vocabulary but strict\-unreachable through the merge graph\.

Donor token:кранMerge chain:кра⏟\.\.D1 97\+н⏟D0 BD⟶кран\\underbrace\{\\text\{\{кра\}\}\}\_\{\\text\{\{\.\.D1\\,97\}\}\}\+\\;\\underbrace\{\\text\{\{н\}\}\}\_\{\\text\{\{D0\\,BD\}\}\}\\;\\longrightarrow\\;\\text\{\{кран\}\}Target vocabulary already contains:краD0 BA D1 80 D0 B0нD1 97 D0 BDfinal targetboundaryLower\-rank merge \+ н→\\toн fires first⇒\\Rightarrowgreedy BPE yields \[кра\] \[н\]the donor operands \[кра\] \[н\] areneverexposed togetherBlocked merge operands:never formedкраD0 BA D1 80 D0 B0 D1 97consumed in ннD0 BDThe target merge \+ н→\\toн consumes the required final н⇒\\Rightarrowthe donor merge \(кра, н\) never firesFigure 2:Themerge ordering problemfor the token кран\. The donor tokenizer contains the merge \(кра, н\)→\\toкран, but both targets apply the lower\-rank merge \+ н→\\toн first and expose \[кра\] \[н\]\. The required donor operands \[кра\] \[н\] therefore never coexist, so directly copying the donor merge cannot produce the inserted token\.
#### Definition and validation protocol\.

We call this themerge ordering problem: a token can be present in the vocabulary yet remain strict\-unreachable because the merge registered for it disagrees with the split induced by the current rank\-ordered merge table\.Strict merge reachabilityasks whether ordinary rank\-ordered BPE reduces a serialized model\-vocabulary key to exactly its own ID\. The audit calls the BPE model directly, bypassing the pre\-tokenizer and added\-token matcher, so it tests the stored merge graph rather than vocabulary membership alone\. Unless explicitly labeled operational in the auxiliary runtime analysis \(§[4\.4](https://arxiv.org/html/2608.00582#S4.SS4)\), “reachable” below means strict merge reachability; every reported fraction uses checked entries as its denominator and lists decoding exclusions separately\.

### 3\.5BPE\-Guided Insertion

After target\-script base reconstruction \(§[3\.3](https://arxiv.org/html/2608.00582#S3.SS3)\), the rebuilt tokenizer already contains a controlled byte\-level inventory of target\-script*base tokens*\. For each donor surfaceTT, we convert it to the target’s byte\-level representation and simulate the*current target*merge table\. If the reachable decomposition contains more than two pieces, we recursively materialize an adjacent intermediate reachable under those same target ranks, re\-simulateTT, and repeat\. Once the current decomposition is\(A,B\)\(A,B\), we register\(A,B\)→T\(A,B\)\\to Tat the end of the target merge table\. Thus every inserted merge agrees with the split that greedy target\-side BPE actually exposes; the donor merge hierarchy is neither copied nor required\.

The insertion of one donor surface is transactional\. All target\-side prerequisite nodes required to makeTTreachable consume replacement slots; if the full chain does not fit, its tentative nodes are rolled back and the next donor candidate is tried\. Insertion stops only when the budget freed by script\-aware removal, target\-script reset, and base reconstruction is exhausted\.

Algorithm 1Budgeted Target\-Guided Donor Insertion0:ordered donor surfaces

Ω\\Omega, target merge ranks

RR, slot budget

BB
𝑎𝑑𝑑𝑒𝑑←0\\mathit\{added\}\\leftarrow 0

for all

T∈ΩT\\in\\Omegado

if

𝑎𝑑𝑑𝑒𝑑=B\\mathit\{added\}=Bthen

stop

endif

C←TargetClosure​\(T,R\)C\\leftarrow\\textsc\{TargetClosure\}\(T,R\)\{each merge follows the split reachable under

RR\}

if

𝑎𝑑𝑑𝑒𝑑\+\|C\|≤B\\mathit\{added\}\+\|C\|\\leq Bthen

InsertByteMerges\(C\)\(C\)and update

RR
𝑎𝑑𝑑𝑒𝑑←𝑎𝑑𝑑𝑒𝑑\+\|C\|\\mathit\{added\}\\leftarrow\\mathit\{added\}\+\|C\|

endif

endfor

returninserted target\-reachable closure under budget

BB

#### Donor requirements\.

For correctness, the donor need only expose decodable Unicode token surfaces; it need not expose its merge graph or share vocabulary IDs, special\-token assignments, vocabulary size, or byte encoding with the target\. For useful adaptation, it should be trained on the target language or domain and supply enough candidates to use the available slot budget\. Candidate order is an explicit input to Algorithm[1](https://arxiv.org/html/2608.00582#alg1), not a correctness condition: our Ukrainian experiments use ascending serialized donor\-vocabulary ID only as a deterministic order and do not interpret it as corpus frequency\.

Unlike AdaptBPE’s runtime patch for appended domain vocabulary\(Balde et al\.,[2024](https://arxiv.org/html/2608.00582#bib.bib3)\), our approach is a structural fix for writing\-system\-level tokenizer replacement: we correct the merge table itself, so standard BPE implementations require no modification\.

## 4Experiments

### 4\.1Setup

We evaluate two Ukrainian tokenizer adaptations based onNemotron\-3\-Nano\(NVIDIA,[2024](https://arxiv.org/html/2608.00582#bib.bib16)\)\(131,072 BPE model\-vocabulary entries\) andGPT\-OSS\-20B\(OpenAI,[2025](https://arxiv.org/html/2608.00582#bib.bib18)\)\(199,998 BPE model\-vocabulary entries\)\. Donor tokens come from the Lapa project’s Unicode\-character BPE Ukrainian tokenizer release\(Lapa LLM,[2025](https://arxiv.org/html/2608.00582#bib.bib13)\), whoseuk\_tokenizer\.jsoncontains 150,000 entries\. For these Ukrainian builds, donor eligibility retains stripped surfaces of at least two Unicode code points whose non\-space characters are all Cyrillic; leading\-space and non\-leading\-space forms remain distinct\. We additionally require the surface to remain one piece under the target tokenizer’s pre\-tokenizer, then traverse the eligible list in ascending donor\-vocabulary ID\. These are script and boundary filters over a Ukrainian\-trained donor, not a language classifier or a corpus\-frequency ranking\. The script\-selection configs and resulting replacement manifests are pinned; Appendix[D](https://arxiv.org/html/2608.00582#A4)gives their complete primary\-writing\-system breakdown\. We interpret collateral preservation only on the evaluated corpora rather than inferring it from whether a writing system was excluded from row selection\. We report tokenizer\-level fertility \(tokens per whitespace\-delimited word\) on a pinned suite: 100,000 documents per subset for Ukrainian Malyuk, C4 English, a four\-language EU aggregate, and a three\-language Cyrillic aggregate, plus the 94 available Cyrillic Crimean\-Tatar documents\. Appendix[E](https://arxiv.org/html/2608.00582#A5)reports the exact dataset codes and per\-subset counts\. The samples, dataset revisions, shuffle order \(100,000\-example buffer, seed 42\), text\-sequence hashes, and evaluation runtime \(Transformers 4\.57\.3; Tokenizers 0\.22\.1\) are pinned\. EU is the micro\-aggregate of Spanish, French, Italian, and German; the broader evaluation sheet is given in Appendix[E](https://arxiv.org/html/2608.00582#A5)\.

### 4\.2Baselines

All fixed\-budget surgery arms use the same base tokenizer, donor order, target pre\-tokenizer filter, and replacement budgets \(28,134 Nemotron rows; 45,398 GPT\-OSS rows\)\. The script\-aware, global\-ID\-after\-reset, and Alabi\-style selector arms also use the same strict dependency audit; optional prerequisite rows are restored and replaced under each arm’s own ranking\. The Alabi\-style selector, Purason, and the direct\-transfer control use the same pinned 100M\-character Ukrainian HPLT slice\. The AdaptBPE arms instead draw eligible surfaces in the same order from the released donor used by our method\. The fresh\-retraining baseline instead uses a separately pinned 100M\-character UK50/EU50 mixture drawn from HPLT Ukrainian and five Wikipedia editions; none of its source datasets is used in the evaluation suite\. We compare: \(i\) global descending\-ID removal after the same target reset; \(ii\) an Alabi\-style selector\(Alabi et al\.,[2022](https://arxiv.org/html/2608.00582#bib.bib1)\)that replaces the low\-frequency complement of adaptation\-corpus tokens while protecting the first 1,000 original IDs except where the shared target\-script reset must take precedence; \(iii\) continued BPE with leaf\-frequency pruning from the official Purason et al\. implementation\(Purason et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib22)\); \(iv\) fresh same\-size BPE retraining on the declared UK50/EU50 mixture; and \(v\) AdaptBPE\(Balde et al\.,[2024](https://arxiv.org/html/2608.00582#bib.bib3)\)\. For AdaptBPE, whose released code modifies only slow RoBERTa/BART tokenizers,444[https://github\.com/gb\-kgp/adaptbpe](https://github.com/gb-kgp/adaptbpe), commit949556e4\.we port the published recursive longest\-substring initialization to each target’s pinned pre\-tokenizer and merge table\. We replace its Latin\-only single\-character helper set with the existing 256\-symbol byte alphabet so Ukrainian byte strings admit a complete cover, and verify that the optimized port matches a direct transcription of the published recursion on 500 Ukrainian pre\-tokenized pieces per target \(0 mismatches\)\. We report both a constraint\-matched operationalization that reuses precisely the script\-aware replacement IDs without adding merge rules and the published expansion setting, which adds the same number of donor types and is explicitly marked as outside the fixed\-vocabulary constraint\. The fixed runtime variant can assign one donor surface to every freed row because it pays no prerequisite\-node cost, but it requires a non\-standard tokenizer at inference; our structural method consumes some rows on prerequisites and runs in an unmodified BPE implementation\.

We additionally run adirect target\-native merge\-transfer controlfor reachability rather than fertility\. For each target, we train a fresh byte\-level BPE with that target’s own pre\-tokenizer on the same 100M\-character Ukrainian slice, reuse exactly the script\-aware arm’s replacement IDs, clean invalidated target merges, and append an ancestry\-closed donor merge prefix in donor\-rank order without target\-guided repair\. Because this control changes the donor inventory and candidate ranking, its fertility gap from our released\-donor build is not a causal estimate of BPE\-guided insertion; its purpose is the auxiliary runtime analysis in §[4\.4](https://arxiv.org/html/2608.00582#S4.SS4)\.

TokenAdapt\(Sharthak et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib26)\)is not listed as a separate token\-count row because it initializes model embeddings for an already chosen destination tokenizer; it does not change that tokenizer’s segmentation\. A valid TokenAdapt comparison is model\-level \(initialization, equal continued\-pretraining compute, and downstream/perplexity evaluation\), for which the complete 20B/30B weights are outside this tokenizer\-only experiment\.

### 4\.3Language Adaptation Results

Table 1:Fertility \(tokens/whitespace\-delimited word,↓\\downarrow\)\. “Donor surfaces” counts inserted donor surfaces, not vocabulary expansion; prerequisite BPE nodes also consume replacement slots\. “IDs kept” is the fraction of original model\-vocabulary rows retaining the same token at the same numeric ID\.Table 2:Token\-count changes relative to each unmodified base on the pinned evaluation suite \(lower is better\)\. “fixed” means the same total active tokenizer\-ID budget as the corresponding base \(BPE model vocabulary plus any added\-token layer\), not preservation of the old assignments\. The first three rows in each block share the target\-script reset, donor order, insertion procedure, and slot budget; only the selector for non\-Cyrillic fill slots differs\. EU is the ES/FR/IT/DE micro\-aggregate; Cyr\. agg\. is the three\-language Cyrillic micro\-aggregate\. “IDs kept” is the share of original model\-vocabulary rows retaining the same token at the same numeric ID; coincidental matches after fresh retraining round to 0\.0%\. The final AdaptBPE row in each block is its published expansion setting and is not fixed\-vocabulary\.Table[1](https://arxiv.org/html/2608.00582#S4.T1)shows Ukrainian fertility falling from 2\.71 to 1\.80 and from 2\.60 to 1\.65, while English/EU fertility is unchanged at the displayed precision\. The row audit preserves every non\-selected entry: 102,938/131,072 and 154,600/199,998 original token\-to\-ID assignments remain intact\.

The cross\-language Cyrillic cost is material: the three\-language micro\-aggregate changes by \+6\.65%/\+10\.06%, with per\-subset results reported in Appendix[E](https://arxiv.org/html/2608.00582#A5)\. Because these subsets share Cyrillic with the target inventory, they are affected by the mandatory target reset; reallocation cannot be uniformly Pareto\-optimal across inventories that share the same writing system\.

Table[2](https://arxiv.org/html/2608.00582#S4.T2)gives the baseline comparisons\. At fixed target reset, global descending\-ID removal matches our Ukrainian and Cyrillic\-aggregate changes within 0\.10 points but adds \+0\.97%/\+2\.08% EN/EU tokens on Nemotron and \+0\.78%/\+2\.20% on GPT\-OSS\. Its retained\-entry audit passes, identifying script filtering as a preservation policy rather than a reachability requirement\. Alabi\-style selection also matches Ukrainian but costs \+0\.82%/\+1\.96% and \+0\.70%/\+2\.12% EN/EU, versus at most \+0\.05% for ours\.

The fixed\-budget AdaptBPE arm combines the shared target reset, which removes base Cyrillic entries and incident merges, with runtime substring initialization\. It changes Ukrainian by−27\.20%\-27\.20\\%/−30\.08%\-30\.08\\%and the Cyrillic aggregate by \+33\.16%/\+39\.47%\. The published expansion arm retains the base inventory and reaches−32\.89%\-32\.89\\%/−36\.55%\-36\.55\\%Ukrainian, while the aggregate changes by \+2\.45%/\+2\.76%\. Its recursive initialization can select a new donor token inside a larger pre\-tokenized piece; because the original merge table has no rules using that new atom, a base token spanning it may no longer form\. Expansion adds 28,134/45,398 entries and requires modified inference\.

Purason continued BPE reaches−32\.78%\-32\.78\\%/−35\.71%\-35\.71\\%Ukrainian but costs \+1\.18%/\+1\.06% English and \+2\.81%/\+3\.17% EU, retaining 74\.3%/73\.9% of IDs\. Fresh UK50/EU50 retraining uses the same total active tokenizer\-ID budget as each base but does not preserve its assignments; it compresses Ukrainian still more \(−36\.42%\-36\.42\\%/−38\.16%\-38\.16\\%\), raises English by 8\.61%/7\.64%, and retains effectively 0% of original model\-vocabulary rows at the same IDs\. Surgery’s measured advantage is thus index compatibility and selected\-language segmentation, not cheap training or maximal Ukrainian compression\.

#### Verification\.

Direct Rust\-model audits find 0/28,134 and 0/45,398 broken inserted nodes\. When the full pipeline is forced through the ordinary merge path, it emits all 27,975/45,232 donor surfaces at their assigned IDs with exact roundtrips\. Strict audits find 0/101,938 and 0/154,600 newly broken retained same\-ID entries and 0/130,072 and 0/199,998 broken full model\-vocabulary entries \(excluding 1,000 Nemotron added\-token contents, checked operationally\)\. The global and Alabi\-style arms likewise introduce no retained failures; Appendix[B](https://arxiv.org/html/2608.00582#A2)separates vocabulary membership, strict model reachability, and operational surface reachability\.

### 4\.4Auxiliary Runtime Analysis: Exact Whole\-Piece Lookup

The target implementation exposes a pre\-merge shortcut separate from the BPE graph\. In Hugging Face Tokenizers BPE, theignore\_mergesoption controls thisexact whole\-piece vocabulary lookup: if an entire pre\-tokenized piece is already a vocabulary entry, the model returns its ID before applying BPE merges; otherwise it proceeds with ordinary merging\.555[https://huggingface\.co/docs/tokenizers/main/api/models](https://huggingface.co/docs/tokenizers/main/api/models)Both evaluated target configurations enable this option\. For this diagnostic,operational isolated reachabilityasks whether the full tokenizer pipeline encodes an isolated raw surface as exactly its assigned ID under a declared lookup state\.

The direct target\-native merge\-transfer control leaves 4,513/28,134 Nemotron nodes \(16\.04%\) and 104/45,398 GPT\-OSS nodes \(0\.23%\) strict\-broken\. Among valid UTF\-8 isolated surfaces, disabling the shortcut exposes 4,512/28,126 and 104/45,387 exact\-ID failures; enabling it recovers every one, reducing isolated operational failures to 0/28,126 and 0/45,387\. Thus the shortcut masks 100% of the observed isolated\-surface failures in this control without repairing the merge graph\. It matches a complete pre\-tokenized piece, not arbitrary occurrences inside a larger piece, so this runtime diagnostic complements rather than replaces structural validation\. Appendix[B](https://arxiv.org/html/2608.00582#A2)reports denominators and decoding exclusions\.

## 5Conclusion

Taken together, the results position tokenizer surgery as a compatibility\-preserving alternative to full replacement rather than a route to maximal target\-language compression\. Its central guarantee is that inserted nodes remain derivable under ordinary BPE while retained same\-ID entries remain structurally valid\. The auxiliary whole\-piece control shows why default isolated\-token behavior must be reported separately from that guarantee\. The measured cross\-language Cyrillic degradation also shows that near\-zero changes on the evaluated Latin\-script suite do not imply blanket language preservation\.

## Ethics Statement

The Ukrainian experiments use writing\-system\-level slot reallocation under a fixed vocabulary budget\. Only the English/EU Latin\-script suite is evaluated as collateral preservation; the complete row\-selection breakdown is reported separately as a construction record in Appendix[D](https://arxiv.org/html/2608.00582#A4)\. Whether an unevaluated writing system is excluded from row selection is an implementation parameter, not evidence of language\-level preservation or a normative ranking of languages and cultures\. The observed degradation on the evaluated Cyrillic suite makes the shared\-capacity trade\-off explicit\.

The donor\-side data mixture also includes Cyrillic Crimean Tatar material\. We view support for the languages of Indigenous peoples of Ukraine and other communities historically connected with Ukraine as an important direction for future tokenizer and model development\. More broadly, we regard writing\-system\-aware adaptation as a tool for improving representation of under\-served language groups under fixed\-vocabulary constraints; such methods should be used to expand language support, not to justify the marginalization or erasure of particular languages, scripts, or speech communities\.

## Limitations

Compression vs\. downstream performance\.Our primary metric is tokenizer fertility \(compression\), which is an efficiency signal rather than a downstream quality guarantee\. Recent work shows that better compression does not uniformly predict task performance:Lotz et al\. \([2025](https://arxiv.org/html/2608.00582#bib.bib15)\)find a statistically significantnegativecorrelation \(ρ=−0\.59\\rho\{=\}\{\-\}0\.59\) between compression and multiple\-choice benchmark scores, andWegmann et al\. \([2025](https://arxiv.org/html/2608.00582#bib.bib28)\)show the correlation can invert by task type\. We therefore treat lower fertility as evidence of tokenizer\-level efficiency—reduced context\-window consumption and faster generation—without claiming uniform downstream gains\. Structural*reachability*is a separate construction\-time property: a tokenizer can compress well while containing vocabulary entries that its merge graph cannot derive, even if the default runtime emits some exact whole pieces\. Our builds satisfy strict reachability for all inserted and retained model entries and operational reachability for all donor surfaces through ordinary rank\-ordered merging; this invariant does not itself imply downstream gains\.

Runtime lookup scope\.Both evaluated targets enable the whole\-piece lookup defined in §[4\.4](https://arxiv.org/html/2608.00582#S4.SS4), which recovers every valid isolated strict\-broken surface in the direct\-transfer control\. Consequently, our structural result should not be interpreted as evidence that direct transfer has the same operational failure rate under the targets’ default settings, nor that every repaired node improves corpus fertility\. The guarantee concerns behavior without this lookup and makes the serialization robust to runtime settings; quantifying benefits for occurrences inside larger pre\-tokenized pieces requires a context\-distribution analysis with matched donor inventories and candidate order\.

Writing\-system scope\.The current fixed\-vocabulary pipeline is strongest when adaptation can be framed as writing\-system\-level reallocation\. In same\-script settings, such as adapting one Latin\-script language while preserving another, the current slot\-acquisition strategy would have to delete from the same inventory it seeks to preserve\. Our Alabi\-style baseline applies corpus\-frequency filtering\(Alabi et al\.,[2022](https://arxiv.org/html/2608.00582#bib.bib1)\)under the same replacement budget, target\-script reset, donor order, and insertion procedure\. This tests one such selector, but same\-script adaptation remains harder because corpus frequency need not preserve every language or domain that shares the script\.

Preservation scope\.Our preservation claims are limited to tokenizer\-level behavior on the evaluated corpora\. We make no behavioral claim for unevaluated writing systems, irrespective of whether the frozen construction config excludes their rows from removal\. The broader appendix tables show that Ukrainian\-centric reallocation is not neutral for all nearby Cyrillic settings, so the current pipeline should not be read as uniformly preserving all neighboring languages\.

Segmentation\-distribution shift\.The EN/EU fertility increases from non\-script\-aware removal measure only additional fragmentation, not its full possible effect on the pretrained model\. Whenever the original tokenizer emitted a removed surface as one token, pretraining did not expose that occurrence under the new multi\-token decomposition\. The component tokens may be individually familiar from other contexts, but their composition is not guaranteed to recover the removed token’s learned representation\. We therefore hypothesize that indiscriminate removal can cause model\-level degradation beyond the measured token\-count increase; establishing its magnitude requires collateral\-language perplexity and downstream benchmarks under a controlled embedding\-initialization and continued\-pretraining protocol\.

Embedding initialization\.Our method modifies only the tokenizer; useful model behavior still depends on embedding initialization and continued pre\-training\. TokenAdapt\(Sharthak et al\.,[2025](https://arxiv.org/html/2608.00582#bib.bib26)\)and MATT\(Haltiuk & Smywinski\-Pohl,[2025](https://arxiv.org/html/2608.00582#bib.bib7)\)are applicable at this subsequent model\-level stage\. They cannot be distinguished by the tokenizer\-only counts reported here: TokenAdapt leaves the selected destination tokenizer unchanged, while changing how its embedding rows are initialized\.

## References

- Alabi et al\. \(2022\)Jesujoba O\. Alabi, David Ifeoluwa Adelani, Marius Mosbach, and Dietrich Klakow\.Adapting pre\-trained language models to African languages via multilingual adaptive fine\-tuning\.In*Proceedings of the 29th International Conference on Computational Linguistics*, pp\. 4336–4349, Gyeongju, Republic of Korea, 2022\. International Committee on Computational Linguistics\.URL[https://aclanthology\.org/2022\.coling\-1\.382/](https://aclanthology.org/2022.coling-1.382/)\.
- Aryabumi et al\. \(2024\)Viraat Aryabumi, John Dang, Dwarak Talupuru, Saurabh Dash, Hangyu Cairuz, et al\.Aya expanse: Combining research breakthroughs for a new multilingual frontier\.*arXiv preprint*, 2024\.
- Balde et al\. \(2024\)Gunjan Balde, Soumyadeep Roy, Mainack Mondal, and Niloy Ganguly\.Adaptive BPE tokenization for enhanced vocabulary adaptation in finetuning pretrained language models\.In*Findings of EMNLP*, pp\. 14724–14733, 2024\.doi:10\.18653/v1/2024\.findings\-emnlp\.863\.URL[https://aclanthology\.org/2024\.findings\-emnlp\.863/](https://aclanthology.org/2024.findings-emnlp.863/)\.
- Chau et al\. \(2020\)Ethan C\. Chau, Lucy H\. Lin, and Noah A\. Smith\.Parsing with multilingual BERT, a small corpus, and a small treebank\.In*Findings of EMNLP*, pp\. 1324–1334, 2020\.doi:10\.18653/v1/2020\.findings\-emnlp\.118\.
- Dobler & de Melo \(2023\)Konstantin Dobler and Gerard de Melo\.FOCUS: Effective embedding initialization for monolingual specialization of multilingual models\.In*Proceedings of EMNLP*, 2023\.
- Downey et al\. \(2023\)C\. M\. Downey, Terra Blevins, Nora Goldfine, and Shane Steinert\-Threlkeld\.Embedding structure matters: Comparing methods to adapt multilingual vocabularies to new languages\.In*Proceedings of the 3rd Workshop on Multi\-lingual Representation Learning*, pp\. 268–281, 2023\.
- Haltiuk & Smywinski\-Pohl \(2025\)Mykola Haltiuk and Aleksander Smywinski\-Pohl\.Model\-aware tokenizer transfer\.*arXiv preprint arXiv:2510\.21954*, 2025\.
- Kim et al\. \(2024\)Seungduk Kim, Seungtaek Choi, and Myeongho Jeong\.Efficient and effective vocabulary expansion towards multilingual large language models\.*arXiv preprint arXiv:2402\.14714*, 2024\.
- Kiulian et al\. \(2025\)Artur Kiulian, Anton Polishko, Mykola Khandoga, Yevhen Kostiuk, et al\.From English\-centric to effective bilingual: LLMs with custom tokenizers for underrepresented languages\.In*Proceedings of the Fourth Ukrainian Natural Language Processing Workshop*, pp\. 1–13, 2025\.doi:10\.18653/v1/2025\.unlp\-1\.1\.
- Korablyov et al\. \(2025\)Maksym Korablyov et al\.Tokenization efficiency of current foundational large language models for the ukrainian language\.*Frontiers in Artificial Intelligence*, 8, 2025\.doi:10\.3389/frai\.2025\.1538165\.
- Land & Bartolo \(2024\)Sander Land and Max Bartolo\.Fishing for magikarp: Automatically detecting under\-trained tokens in large language models\.*arXiv preprint arXiv:2405\.05417*, 2024\.
- lang\-uk \(2016\)lang\-uk\.tokenize\-uk: Rule\-based ukrainian word and sentence tokenizer\.[https://github\.com/lang\-uk/tokenize\-uk](https://github.com/lang-uk/tokenize-uk), 2016\.
- Lapa LLM \(2025\)Lapa LLM\.Lapa Ukrainian tokenizer\.[https://huggingface\.co/lapa\-llm/tokenizer](https://huggingface.co/lapa-llm/tokenizer), 2025\.
- Liang et al\. \(2023\)Davis Liang, Hila Gonen, Yuning Mao, Rui Hou, Naman Goyal, Marjan Ghazvininejad, Luke Zettlemoyer, and Madian Khabsa\.XLM\-V: Overcoming the vocabulary bottleneck in multilingual masked language models\.In*Proceedings of EMNLP*, 2023\.
- Lotz et al\. \(2025\)Jonas F\. Lotz, Antonio V\. Lopes, Stephan Peitz, Hendra Setiawan, and Leonardo Emili\.Beyond text compression: Evaluating tokenizers across scales\.In*Proceedings of ACL*, pp\. 32155–32173, 2025\.
- NVIDIA \(2024\)NVIDIA\.Nemotron\-3\-nano: A family of compact language models\.Technical report, NVIDIA, 2024\.
- Ociepa et al\. \(2025\)Krzysztof Ociepa, Łukasz Flis, Krzysztof Wróbel, Adrian Gwoździej, and Remigiusz Kinas\.Bielik 7B v0\.1: A Polish language model—development, insights, and evaluation\.*Computer Science*, 26\(4\):131–161, 2025\.doi:10\.7494/csci\.2025\.26\.4\.7689\.
- OpenAI \(2025\)OpenAI\.gpt\-oss\-120b & gpt\-oss\-20b model card, 2025\.
- Paniv et al\. \(2026\)Yurii Paniv, Bohdan Didenko, Mykola Haltiuk, Vladyslav Humennyy, Andrian Kravchenko, Roman Kyslyi, Viktoriia Makovska, Artem Orlovskyi, Bohdan Ruban, Maksym\-Yurii Rudko, Anastasiia Senyk, Nazarii Drushchak, Dmytro Chaplynskyi, and Mariana Romanyshyn\.Data\-efficient adaptation of multilingual LLMs to Ukrainian\.In Mariana Romanyshyn \(ed\.\),*Proceedings of the Fifth Ukrainian Natural Language Processing Conference \(UNLP 2026\)*, pp\. 155–168, Lviv, Ukraine, May 2026\. Association for Computational Linguistics\.ISBN 979\-8\-89176\-359\-3\.URL[https://aclanthology\.org/2026\.unlp\-1\.14/](https://aclanthology.org/2026.unlp-1.14/)\.
- Patil et al\. \(2022\)Vaidehi Patil, Partha Talukdar, and Sunita Sarawagi\.Overlap\-based vocabulary generation improves cross\-lingual transfer among related languages\.In*Proceedings of ACL*, pp\. 219–233, 2022\.doi:10\.18653/v1/2022\.acl\-long\.18\.
- Petrov et al\. \(2024\)Aleksandar Petrov, Emanuele La Malfa, Philip H\. S\. Torr, and Adel Bibi\.Language model tokenizers introduce unfairness between languages\.*Advances in Neural Information Processing Systems*, 2024\.
- Purason et al\. \(2025\)Taido Purason, Pavel Chizhov, Ivan P\. Yamshchikov, and Mark Fishel\.Teaching old tokenizers new words: Efficient tokenizer adaptation for pre\-trained models\.*arXiv preprint arXiv:2512\.03989*, 2025\.URL[https://arxiv\.org/abs/2512\.03989](https://arxiv.org/abs/2512.03989)\.
- Radford et al\. \(2019\)Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever\.Language models are unsupervised multitask learners\.Technical report, OpenAI, 2019\.
- Remy et al\. \(2023\)François Remy, Pieter Delobelle, Bettina Berendt, Kris Demuynck, and Thomas Demeester\.Tik\-to\-tok: Translating language models one token at a time\.*arXiv preprint arXiv:2310\.03477*, 2023\.
- Rust et al\. \(2021\)Phillip Rust, Jonas Pfeiffer, Ivan Vulić, Sebastian Ruder, and Iryna Gurevych\.How good is your tokenizer? on the monolingual performance of multilingual language models\.In*Proceedings of ACL\-IJCNLP*, 2021\.doi:10\.18653/v1/2021\.acl\-long\.243\.
- Sharthak et al\. \(2025\)Shaurya Sharthak, Vinayak Pahalwan, Adithya Kamath, and Adarsh Shirawalmath\.Achieving tokenizer flexibility in language models through heuristic adaptation and supertoken learning\.*arXiv preprint arXiv:2505\.09738*, 2025\.URL[https://arxiv\.org/abs/2505\.09738](https://arxiv.org/abs/2505.09738)\.
- Wang et al\. \(2020\)Zihan Wang, Stephen Mayhew, and Dan Roth\.Extending multilingual BERT to low\-resource languages\.In*Findings of EMNLP*, pp\. 2649–2656, 2020\.doi:10\.18653/v1/2020\.findings\-emnlp\.119\.
- Wegmann et al\. \(2025\)Anna Wegmann, Dong Nguyen, and David Jurgens\.Tokenization is sensitive to language variation\.In*Findings of ACL*, pp\. 10958–10983, 2025\.
- Yang et al\. \(2025\)An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, et al\.Qwen3 technical report\.*arXiv preprint*, 2025\.

## Appendix

This appendix provides additional byte\-level examples of the merge ordering problem, detailed removal statistics, per\-script replacement counts, and summary statistics for the Ukrainian tokenizer builds\.

## Appendix AAdditional Byte\-Level Examples

Words can route through even harsher byte\-level structure than the кран example in §[3\.4](https://arxiv.org/html/2608.00582#S3.SS4): in the original GPT\-OSS tokenizer, “обрунтування” tokenizes into byte spans\[D0 BE D0 B1\],\[D2\],\[91\],\[D1 80 D1 83 D0 BD\],\[D1 82 D1 83\], and\[D0 B2 D0 B0 D0 BD D0 BD D1 8F\]\. Thus the single character \(UTF\-8D2 91\) is realized via two separate raw\-byte tokens\. In such cases, visually natural character boundaries are irrelevant; what matters is the boundary induced by the current merge graph\.

## Appendix BReachability Audit Details

Table[3](https://arxiv.org/html/2608.00582#A2.T3)gives the complete pinned audit behind the verification claims in §[4](https://arxiv.org/html/2608.00582#S4)\. Each result is reported as failures/tested items\. “Merge graph” calls the Rust BPE model directly on serialized model keys through ordinary rank\-ordered merging; “full pipeline” calls the tokenizer on decoded raw surfaces and also requires exact encode–decode roundtrips\. The guided\-build surface row covers transferred donor surfaces, whereas the direct\-transfer surface rows test every decodable inserted\-node surface as an isolated input\.

Table 3:Reachability failures/tested items under Hugging Face Tokenizers 0\.22\.1\. The upper block audits the BPE\-guided builds\. The lower block is an auxiliary runtime diagnostic using a byte\-level BPE donor trained on the Ukrainian HPLT slice in each target’s tokenizer family, not a matched\-inventory compression baseline: whole\-piece lookup emits valid isolated entries without repairing the merge graph\.Nemotron’s full model\-vocabulary denominator excludes 1,000 contents registered through the added\-token layer; these pass a separate full\-pipeline audit \(0/1,000 failures\)\. The guided inserted\-node totals exceed the donor\-surface totals by 159/166 because they additionally include 152/153 target\-script base nodes and 7/13 intermediate prerequisites\. The direct\-transfer surface audit excludes 8/11 inserted nodes that do not decode to valid UTF\-8 raw surfaces\. These distinct scopes therefore cannot be collapsed into a single “unreachable tokens” total\. Dependency\-safe selection restored 2 optional Nemotron prerequisites and 14 GPT\-OSS prerequisites, replacing each with the next eligible script\-selected row while keeping the slot budgets exact\. The iterative audit terminated with no newly broken retained entries; neither target required adding a mandatory\-reset dependent to the removal closure\.

## Appendix CToken Removal Details

Table[4](https://arxiv.org/html/2608.00582#A3.T4)separates the target\-script reset from the script\-selected fill rows\.

Table 4:Final replacement\-row budgets\. The target reset takes precedence over the configured selection filter; the other rows are selected under the writing\-system policy and dependency repair described in §[3](https://arxiv.org/html/2608.00582#S3)\.
## Appendix DReplaced Tokens by Writing System

Table[5](https://arxiv.org/html/2608.00582#A4.T5)gives the final manifest\-derived counts for every writing system selected in either target\.

Table 5:Selected replacement rows by primary Unicode writing\-system classification after dependency repair\. This is a construction breakdown, not an evaluation of language preservation; zero denotes a writing system not selected for that target\.
## Appendix EExtended Ukrainian Evaluation Metrics

Table[6](https://arxiv.org/html/2608.00582#A5.T6)reports exact token counts and fertility for the unmodified bases and our final tokenizers on every evaluated corpus\.

Table 6:Pinned tokenizer\-level evaluation\. Each cell reportstokens / tokens per whitespace\-delimited word; EU is shown as one micro\-aggregated row after evaluating 100k examples in each language\.
## Appendix FUkrainian Tokenizer Statistics

Table[7](https://arxiv.org/html/2608.00582#A6.T7)summarizes the surgery and validation counts for the ID\-preserving Ukrainian tokenizers\.

MetricNemotronGPT\-OSSBase modelNemotron\-3GPT\-OSS\-20BBase model\-vocabulary size131,072199,998Selected replacement rows28,13445,398Inserted donor surfaces27,97545,232Inserted target\-script base nodes152153Inserted intermediate prerequisite nodes713Total inserted BPE nodes28,13445,398Strict\-broken inserted nodes00Operationally broken donor surfaces \(lookup disabled\)00Dependency candidates restored/replaced214Newly strict\-broken retained rows00Strict\-broken full model\-vocabulary entries00Final model\-vocabulary size131,072199,998

Table 7:Tokenizer surgery statistics\. “Strict” and “operational” use the protocol definitions in §[3\.4](https://arxiv.org/html/2608.00582#S3.SS4)and §[4\.4](https://arxiv.org/html/2608.00582#S4.SS4); the full Nemotron model\-vocabulary audit excludes 1,000 contents registered through the added\-token layer and checks them operationally\.

Similar Articles

Pruned BPE: Post-training Visibility Pruning and Token Reallocation for Byte Pair Encoding

arXiv cs.CL

This paper proposes Pruned BPE, a post-training method that prunes low-exposure tokens from a BPE vocabulary and reallocates slots to better-exposed candidates, reducing encoded length without increasing model-visible vocabulary size. Experiments on English and Chinese corpora show approximately 0.27–0.36% encoded length reduction over standard BPE.

Incremental BPE Tokenization

arXiv cs.CL

This paper introduces an incremental algorithm for Byte Pair Encoding (BPE) tokenization that processes each byte in O(log^2 t) time, enabling efficient partial tokenization in streaming settings and achieving speedups over existing implementations.

Byte-level models

Reddit r/LocalLLaMA

Discusses whether byte-level tokenizers outperform subword tokenizers for precise tasks like distinguishing similar names, counting characters, and case sensitivity, and asks for current recommendations.