Joint Optimization for Greedy Longest-match Tokenization
Summary
This paper introduces JOLT, an integer programming approach to optimize subword tokenization for greedy left-to-right longest-match decoding (WordPiece). JOLT achieves near-optimal compression, closing most of the gap between BPE and the theoretical lower bound, reducing token count by up to 0.78% over BPE.
View Cached Full Text
Cached at: 07/28/26, 06:28 AM
# Joint Optimization for Greedy Longest-match Tokenization
Source: [https://arxiv.org/html/2607.23362](https://arxiv.org/html/2607.23362)
Adhiraj Singh Deepanshu Mody11footnotemark:1Ghina Al Shdaifat Hamza Alshamy Center for Data Science, New York University New York, NY, USA \{as19687,dm6262,gha2009,ha2486\}@nyu\.edu Adam Wiemerslage Varshini Reddy Craig W\. Schmidt Kensho Technologies Cambridge, MA, USA \{adam\.wiemerlsage,varshini\.bogolu,craig\.schmidt\}@kensho\.com
###### Abstract
Recent work shows that subword vocabularies can be trained to directly optimize compression for a specific inference rule, rather than relying on a greedy merge heuristic like Byte Pair Encoding \(BPE\)\. For example, ToaST targets split\-tree inference and ConvexTok targets shortest\-path inference\. We extend this approach to greedy left\-to\-right \(GL2R\) longest\-match decoding, the fast and widely used inference rule of WordPiece\. We introduceJoint Optimization for Greedy Longest\-match Tokenization \(JOLT\), which formulates GL2R vocabulary learning as an integer program \(IP\) over vocabulary\-selection and segmentation\-choice variables\. The key ingredient is a set of greedy\-consistency constraints that force each pretoken’s segmentation to match exactly what GL2R produces under the selected vocabulary, making the optimized token count equal to the count realized at deployment\. To solve the IP at scale, we use a linear program \(LP\) relaxation that escalates only unresolved pretokens to higher\-order segmentations\. The relaxation is near\-integral: rounded solutions fall within0\.0080\.008–0\.176%0\.176\\%of the LP lower bound, certifying near\-optimal GL2R compression on the training scope\. The same bound reveals that BPE already sits within11–2%2\\%of the LP lower bound on the training scope, confirming the heuristic is near\-optimal for GL2R inference; JOLT closes89\.689\.6–99\.4%99\.4\\%of this gap\. On held\-out validation across four training scopes \(N∈\{100k,200k,300k,400k\}N\\in\\\{100\\text\{k\},200\\text\{k\},300\\text\{k\},400\\text\{k\}\\\}\) and two vocabulary sizes \(\|V\|∈\{32k,64k\}\|V\|\\in\\\{32\\text\{k\},64\\text\{k\}\\\}\), JOLT yields up to0\.78%0\.78\\%fewer tokens than BPE, with gains growing with scope\. Together, these results show that most of the compression headroom between BPE and the LP lower bound can be recovered through inference\-aligned vocabulary optimization\.
## 1Introduction
Most NLP tasks use a tokenizer as a first step, converting text into a sequence of tokens drawn from a fixed vocabulary\. Byte Pair Encoding\(BPE; Sennrichet al\.,[2016](https://arxiv.org/html/2607.23362#bib.bib2)\)is among the most frequently used subword tokenizers; WordPiece\(Wuet al\.,[2016](https://arxiv.org/html/2607.23362#bib.bib11); Schuster and Nakajima,[2012](https://arxiv.org/html/2607.23362#bib.bib10)\)and UnigramLM\(Kudo,[2018](https://arxiv.org/html/2607.23362#bib.bib3)\)are also widely deployed\. Originally proposed as a general\-purpose compression algorithm\(Gage,[1994](https://arxiv.org/html/2607.23362#bib.bib13)\)and later adapted for NLP\(Sennrichet al\.,[2016](https://arxiv.org/html/2607.23362#bib.bib2)\), BPE greedily builds a vocabulary by repeatedly merging the most frequent adjacent token pair until it reaches its target size\. Producing shorter token sequences is valuable for language models: it increases the amount of text in a given context window, and reduces inference cost\. While the effect of compression on downstream accuracy is still contested\(Gallé,[2019](https://arxiv.org/html/2607.23362#bib.bib14); Rustet al\.,[2021](https://arxiv.org/html/2607.23362#bib.bib15); Aliet al\.,[2024](https://arxiv.org/html/2607.23362#bib.bib16); Goldmanet al\.,[2024](https://arxiv.org/html/2607.23362#bib.bib17); Schmidtet al\.,[2024](https://arxiv.org/html/2607.23362#bib.bib18)\), its practical benefits alone make compression worth optimizing\.
Recent work shows that vocabulary training need not be limited to greedy merge heuristics: ToaST\(Schmidtet al\.,[2026](https://arxiv.org/html/2607.23362#bib.bib9)\)and ConvexTok\(Tempuset al\.,[2026](https://arxiv.org/html/2607.23362#bib.bib8)\)show that one can directly optimize compression by formulating vocabulary training as an integer program \(IP\), relaxing it to a linear program \(LP\), and extracting a discrete vocabulary via rounding\.111Exact compression\-oriented training is NP\-complete in several standard formulations\(Whittingtonet al\.,[2025](https://arxiv.org/html/2607.23362#bib.bib5); Kastrevaet al\.,[2026](https://arxiv.org/html/2607.23362#bib.bib6)\), so corpus\-scale work solves an LP relaxation and rounds to a fixed vocabulary rather than optimizing the full IP\.This re\-frames tokenizer design from heuristic, procedure\-driven training to an inference\-specific optimization problem\. There is therefore no single notion of “best compressing tokenizer” independent of inference rule; optimality must be stated relative to the inference rule\.
Greedy left\-to\-right \(GL2R\) longest\-match decoding is a simple and fast tokenization inference rule, most commonly used by WordPiece\. Given a vocabulary, GL2R scans the input left to right and at each position emits the longest vocabulary token matching the bytes starting there, advancing by its length; with a full set of single\-byte tokens in the vocabulary, this always succeeds without unknown tokens\.Uzanet al\.\([2024](https://arxiv.org/html/2607.23362#bib.bib4)\)show that GL2R is effective even when applied to vocabularies trained by other methods\. However, there has not been a vocabulary construction technique designed specifically to work with GL2R\. We developJoint Optimization for Greedy Longest\-match Tokenization \(JOLT\), which follows the same high\-level recipe as ToaST and ConvexTok \(integer program→\\rightarrowLP relaxation→\\rightarrowrounding to a fixed vocabulary\) but formulates the model specifically for GL2R inference, making the optimized token count equal to the one realized at deployment\.
Empirically, JOLT reduces greedy\-L2R token counts on held\-out text by up to0\.78%0\.78\\%relative to BPE at equal vocabulary size across four training scopes \(N∈\{100k,200k,300k,400k\}N\\in\\\{100\\text\{k\},200\\text\{k\},300\\text\{k\},400\\text\{k\}\\\}\), with larger scopes consistently yielding equal or better compression\. Beyond the compression gains, the LP bound provides a structural diagnostic: BPE’s token count on the training scope falls within11–2%2\\%of the LP lower bound, revealing that the BPE heuristic is already near\-optimal under GL2R inference\. JOLT closes89\.689\.6–99\.4%99\.4\\%of this gap, and its rounded vocabularies fall within0\.0080\.008–0\.176%0\.176\\%of the LP bound, so rounding loses almost none of the LP\-achievable compression\. JOLT’s small margin over BPE on the held\-out validation set therefore reflects the limited headroom above the LP bound, not a rounding artifact\.
## 2JOLT Model
JOLT formulates vocabulary learning as a joint integer program over two coupled choices: which candidate tokens enter the vocabulary, and which candidate segmentation of each pretoken is selected\. Under GL2R, the longest matching vocabulary token wins at each position, so a segmentation is GL2R\-realizable only for vocabularies in which no longer token intrudes at any segment boundary\. Enforcing this validity condition explicitly \([Section˜2\.4](https://arxiv.org/html/2607.23362#S2.SS4)\) is what couples the vocabulary\-selection and segmentation\-choice variables\. Because the number of candidate segmentations grows exponentially in pretoken length, JOLT does not instantiate them all up front, but initially works with a small number of candidate segmentations per pretoken, adding more as needed\.
### 2\.1Pretokens, segmentations, and costs
#### Pretokens\.
We first segment the training corpus into pretokens using a regular expression222We use a length limited version of the GPT\-4o regex\. See[appendixC](https://arxiv.org/html/2607.23362#A3)for more details\.and aggregate identical pretokens by count\. LetPPbe the set of aggregated pretokens in the training data, with frequencycp∈ℕc\_\{p\}\\in\\mathbb\{N\}for each pretokenp∈Pp\\in P\. We work with byte\-level tokenization, so we definenp=\|p\|n\_\{p\}=\|p\|as the byte length of pretokenpp\.
For vocabulary training we retain theNNhighest\-count pretokens; throughout the IP below,PPdenotes this restricted top\-NNset with countscpc\_\{p\}, not the full pretoken vocabulary\.
#### Segmentations\.
A segmentationsspartitions a pretokenppinto contiguous, non\-empty candidate tokens\. We depict example segmentations visually divided by\|\|, e\.g\. segmentations=ta\|bles=\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}for pretokenp=tablep=\\texttt\{table\}\. The*order*ofssis the number of pieces \(tokens\) in the partition\. An order\-rrsegmentation is determined by choosingr−1r\-1internal split positions among thenp−1n\_\{p\}\-1byte gaps, so there are exactly\(np−1r−1\)\\binom\{n\_\{p\}\-1\}\{r\-1\}order\-rrcandidates forpp\. Summing over orders shows the total grows exponentially innpn\_\{p\}:
∑r=1np\(np−1r−1\)=2np−1\\sum\_\{r=1\}^\{n\_\{p\}\}\\binom\{n\_\{p\}\-1\}\{r\-1\}=2^\{n\_\{p\}\-1\}\(1\)In practice, however, a compression\-oriented vocabulary will tokenize most pretokens with a low\-order segmentation, so only a small fraction of the2np−12^\{n\_\{p\}\-1\}candidates need to be explicitly instantiated\.
To avoid the exponential number of potential segmentations, we instantiate only segmentations up to a bounded order per pretoken\. Letκp\\kappa\_\{p\}denote the maximum segmentation order currently instantiated forpp\. For a givenκp\\kappa\_\{p\}, letSpS\_\{p\}be the finite set of segmentation choices forpp: allsswithorder\(s\)≤κp\\mathrm\{order\}\(s\)\\leq\\kappa\_\{p\}, together with a fallbackℱ\\mathcal\{F\}\. The fallback is not itself a segmentation ofpp; choosingℱ\\mathcal\{F\}means that none of the currently instantiated segmentations suffice and the solver would prefer a partition of order greater thanκp\\kappa\_\{p\}\. We initially setκp=2\\kappa\_\{p\}=2, soSpS\_\{p\}contains only the whole pretoken, all order\-2 segmentations, andℱ\\mathcal\{F\}; these are the only segmentation options forppin the first round\. When the solver selectsℱ\\mathcal\{F\}forpp,κp\\kappa\_\{p\}is incremented and the next order of segmentations is appended toSpS\_\{p\}\([Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)\)\. Thus,
\|Sp\|=∑r=1κp\(np−1r−1\)\+1\.\|S\_\{p\}\|=\\sum\_\{r=1\}^\{\\kappa\_\{p\}\}\\binom\{n\_\{p\}\-1\}\{r\-1\}\+1\.\(2\)Escalation then increasesκp\\kappa\_\{p\}and enrichesSpS\_\{p\}only for those pretokens \([Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)\), rather than instantiating higher\-order segmentations for everyp∈Pp\\in Pup front\. This selective escalation avoids instantiating high\-order segmentations unnecessarily, reducing LP size and solve time\.
#### Tokens and costs\.
Training proceeds in a sequence of*rounds*\. In each round, every pretokenpphas a fixed limitκp\\kappa\_\{p\}on segmentation order, with a fixed finite setSpS\_\{p\}\. We build and solve the IP \(or its LP relaxation\); pretokens that select the fallbackℱ\\mathcal\{F\}trigger an increase inκp\\kappa\_\{p\}and a rebuild before the next round \([Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)\)\.
[Figure˜1](https://arxiv.org/html/2607.23362#S2.F1)\(a\) gives an example for the pretokenp=tablep=\\texttt\{table\}withnp=5n\_\{p\}=5\. There are2np−1=162^\{n\_\{p\}\-1\}=16potential segmentations, but with the initialκp=2\\kappa\_\{p\}=2only six are instantiated choices: the whole pretoken, four order\-2 segmentations, andℱ\\mathcal\{F\}\. When a pretoken selects the fallback, itsκp\\kappa\_\{p\}is increased by one in the next round and those new candidates are appended \([Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)\)\.[Figure˜1](https://arxiv.org/html/2607.23362#S2.F1)\(b\) shows the six extra order\-3 segmentations added whenκp\\kappa\_\{p\}increases to33; all2np−12^\{n\_\{p\}\-1\}segmentations enterSpS\_\{p\}only ifκp\\kappa\_\{p\}reachesnpn\_\{p\}\.
\(a\) Round 1 \(66instantiated /1616possible\)
VariableVisualcost\(p,s\)\\mathrm\{cost\}\(p,s\)ztable,tablez\_\{\\texttt\{table\},\\,\\texttt\{table\}\}table11ztable,t\|ablez\_\{\\texttt\{table\},\\,\\texttt\{t\}\\,\|\\,\\texttt\{able\}\}table22ztable,ta\|blez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}\}table22ztable,tab\|lez\_\{\\texttt\{table\},\\,\\texttt\{tab\}\\,\|\\,\\texttt\{le\}\}table22ztable,tabl\|ez\_\{\\texttt\{table\},\\,\\texttt\{tabl\}\\,\|\\,\\texttt\{e\}\}table22ztable,ℱz\_\{\\texttt\{table\},\\,\\mathcal\{F\}\}—κp\+1\\kappa\_\{p\}\{\+\}1
\(b\) Added if fallback selected in Round 1 \(six new order\-3 segmentations\)
VariableVisualcost\(p,s\)\\mathrm\{cost\}\(p,s\)ztable,t\|a\|blez\_\{\\texttt\{table\},\\,\\texttt\{t\}\\,\|\\,\\texttt\{a\}\\,\|\\,\\texttt\{ble\}\}table33ztable,t\|ab\|lez\_\{\\texttt\{table\},\\,\\texttt\{t\}\\,\|\\,\\texttt\{ab\}\\,\|\\,\\texttt\{le\}\}table33ztable,t\|abl\|ez\_\{\\texttt\{table\},\\,\\texttt\{t\}\\,\|\\,\\texttt\{abl\}\\,\|\\,\\texttt\{e\}\}table33ztable,ta\|b\|lez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}table33ztable,ta\|bl\|ez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{bl\}\\,\|\\,\\texttt\{e\}\}table33ztable,tab\|l\|ez\_\{\\texttt\{table\},\\,\\texttt\{tab\}\\,\|\\,\\texttt\{l\}\\,\|\\,\\texttt\{e\}\}table33
Figure 1:Instantiated segmentationsSpS\_\{p\}for pretokenp=tablep=\\texttt\{table\}\(np=5n\_\{p\}\{=\}5\)\.\(a\)Round 1 \(κp=2\\kappa\_\{p\}\{=\}2\): whole pretoken, four order\-2 segmentations, and fallbackℱ\\mathcal\{F\}\.\(b\)Round 2: six order\-3 segmentations added whenℱ\\mathcal\{F\}was selected in round 1 \([Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)\)\.LetBBdenote the set of all 256 single\-byte tokens which are always retained in the extracted vocabulary \([Equation˜8](https://arxiv.org/html/2607.23362#S2.E8)\) to avoid unknown tokens\. For eachp∈Pp\\in Pand non\-fallbacks∈Sps\\in S\_\{p\}, letEp,sE\_\{p,s\}be the set of distinct token strings \(byte subsequences\) used by segmentationss\. The global*candidate token set*for that round is
T=B∪⋃p∈P⋃s∈Sp∖\{ℱ\}Ep,s\.T\\;=\\;B\\;\\cup\\;\\bigcup\_\{p\\in P\}\\;\\bigcup\_\{s\\in S\_\{p\}\\setminus\\\{\\mathcal\{F\}\\\}\}E\_\{p,s\}\.\(3\)Elementst∈Tt\\in Tare byte strings; whenever anySpS\_\{p\}grows, new segmentations may introduce token strings absent from the currentTT, soTTis*recomputed*before the next LP solve\.
For non\-fallback segmentations,cost\(p,s\)\\mathrm\{cost\}\(p,s\)equals the order ofss\(token count underss\)\. The fallback enters the objective through a stage\-dependent cost:
cost\(p,ℱ\)=\{κp\+1,intermediate rounds,np,final repricing round,\\mathrm\{cost\}\(p,\\mathcal\{F\}\)=\\begin\{cases\}\\kappa\_\{p\}\+1,&\\text\{intermediate rounds\},\\\\ n\_\{p\},&\\text\{final repricing round\},\\end\{cases\}\(4\)In intermediate rounds,cost\(p,ℱ\)=κp\+1\\mathrm\{cost\}\(p,\\mathcal\{F\}\)=\\kappa\_\{p\}\+1is intentionally one token above the largest cost among currently instantiated segmentations of order≤κp\\leq\\kappa\_\{p\}, so any non\-fallback segmentation is strictly cheaper thanℱ\\mathcal\{F\}\.[Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)uses this pricing to decide when to enrichSpS\_\{p\}; the final round setscost\(p,ℱ\)=np\\mathrm\{cost\}\(p,\\mathcal\{F\}\)=n\_\{p\}so the reported score reflects the worst\-case GL2R token count for any remaining fallback pretokens onceSpS\_\{p\}has converged\.
### 2\.2Decision variables and objective
#### Vocabulary\-selection variables\.
For each candidate tokent∈Tt\\in T, define
xt∈\{0,1\}∀t∈T,x\_\{t\}\\in\\\{0,1\\\}\\quad\\forall t\\in T,\(5\)wherext=1x\_\{t\}=1means tokenttis in the vocabulary\. For example, for pretokentable,xtab=1x\_\{\\texttt\{tab\}\}=1meanstabis globally available as a candidate token\.
#### Segmentation\-choice variables\.
For eachp∈Pp\\in Pand eachs∈Sps\\in S\_\{p\}, we introduce a binary decision variable
zp,s∈\{0,1\}∀p∈P,∀s∈Sp,z\_\{p,s\}\\in\\\{0,1\\\}\\quad\\forall p\\in P,\\ \\forall s\\in S\_\{p\},\(6\)wherezp,s=1z\_\{p,s\}=1indicates that segmentationssis selected for pretokenpp; the greedy\-consistency constraints \([Section˜2\.4](https://arxiv.org/html/2607.23362#S2.SS4)\) then enforce that the active segmentation is exactly the one GL2R produces\. Becausecost\(p,s\)<cost\(p,ℱ\)\\mathrm\{cost\}\(p,s\)<\\mathrm\{cost\}\(p,\\mathcal\{F\}\)for every non\-fallbackss, selectingℱ\\mathcal\{F\}\(i\.e\.,zp,ℱ=1z\_\{p,\\mathcal\{F\}\}=1in the integer problem, or LP mass onzp,ℱ≥θz\_\{p,\\mathcal\{F\}\}\\geq\\thetain the relaxation; we useθ=0\.01\\theta=0\.01\) is the signal that the currentSpS\_\{p\}is too coarse;[Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)acts on that signal to increaseκp\\kappa\_\{p\}and reduce the use of fallbacks\.
#### Optimization objective\.
We minimize the corpus\-weighted token count: each pretokenppselects exactly one segmentations∈Sps\\in S\_\{p\}, payingcost\(p,s\)\\mathrm\{cost\}\(p,s\)tokens, weighted by the aggregated countcpc\_\{p\}\. The objective is:
minx,z∑p∈P∑s∈Spcpcost\(p,s\)zp,s\\min\_\{x,z\}\\sum\_\{p\\in P\}\\sum\_\{s\\in S\_\{p\}\}c\_\{p\}\\,\\mathrm\{cost\}\(p,s\)\\,z\_\{p,s\}\(7\)
### 2\.3Feasibility constraints
#### Byte\-completeness constraint\.
Single\-byte tokens must be included in the vocabulary, ensuring any input can be tokenized without unknown\-token failures:
xb=1∀b∈B\.x\_\{b\}=1\\quad\\forall b\\in B\.\(8\)
#### Vocabulary\-budget constraint\.
We optimize a vocabulary of desired size\|V\|\|V\|:
∑t∈Txt≤\|V\|\.\\sum\_\{t\\in T\}x\_\{t\}\\leq\|V\|\.\(9\)
#### Exactly\-one\-segmentation constraint\.
Exactly one segmentation is active per pretoken:
∑s∈Spzp,s=1∀p∈P\.\\sum\_\{s\\in S\_\{p\}\}z\_\{p,s\}=1\\quad\\forall p\\in P\.\(10\)
#### Linking constraint\.
For non\-fallbackss, recall from[Section˜2\.1](https://arxiv.org/html/2607.23362#S2.SS1)thatEp,sE\_\{p,s\}is the set of tokensttused in segmentationssof pretokenpp\. A segmentation can be activated only if all of its tokens are selected in the vocabulary:
zp,s≤xt∀p∈P,∀s∈Sp∖\{ℱ\},∀t∈Ep,s\.z\_\{p,s\}\\leq x\_\{t\}\\quad\\forall p\\in P,\\ \\forall s\\in S\_\{p\}\\setminus\\\{\\mathcal\{F\}\\\},\\ \\forall t\\in E\_\{p,s\}\.\(11\)For example, splittingtableasta\|blerequires bothtaandbleto be in the vocabulary\. The blue rows of[Figure˜2](https://arxiv.org/html/2607.23362#S2.F2)show this for two example segmentations\.
### 2\.4Greedy\-consistency constraints
\(a\)s=ta\|bles=\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}TypeInequalitySegmentationLinkingztable,ta\|ble≤xtaz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}\}\\leq x\_\{\\texttt\{ta\}\}tableztable,ta\|ble≤xblez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}\}\\leq x\_\{\\texttt\{ble\}\}tableGreedyconsist\.ztable,ta\|ble≤1−xtabz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}\}\\leq 1\-x\_\{\\texttt\{tab\}\}tableztable,ta\|ble≤1−xtablz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}\}\\leq 1\-x\_\{\\texttt\{tabl\}\}tableztable,ta\|ble≤1−xtablez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}\}\\leq 1\-x\_\{\\texttt\{table\}\}table
\(b\)s=ta\|b\|les=\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}TypeInequalitySegmentationLinkingztable,ta\|b\|le≤xtaz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq x\_\{\\texttt\{ta\}\}tableztable,ta\|b\|le≤xbz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq x\_\{\\texttt\{b\}\}tableztable,ta\|b\|le≤xlez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq x\_\{\\texttt\{le\}\}tableGreedyconsist\.ztable,ta\|b\|le≤1−xtabz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq 1\-x\_\{\\texttt\{tab\}\}tableztable,ta\|b\|le≤1−xtablz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq 1\-x\_\{\\texttt\{tabl\}\}tableztable,ta\|b\|le≤1−xtablez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq 1\-x\_\{\\texttt\{table\}\}tableztable,ta\|b\|le≤1−xblz\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq 1\-x\_\{\\texttt\{bl\}\}tableztable,ta\|b\|le≤1−xblez\_\{\\texttt\{table\},\\,\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\}\\leq 1\-x\_\{\\texttt\{ble\}\}table
Figure 2:Linking and greedy\-consistency rows forp=tablep=\\texttt\{table\}\.\(a\)s=ta\|bles=\\texttt\{ta\}\\,\|\\,\\texttt\{ble\}\.\(b\)s=ta\|b\|les=\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}\. Blue: required token; red: forbidden longer prefix at that segment start\.The feasibility constraints above \([Equations8](https://arxiv.org/html/2607.23362#S2.E8)to[11](https://arxiv.org/html/2607.23362#S2.E11)\) ensure budget compliance and that an activated segmentation uses tokens selected in the vocabulary, but they do not yet enforce that it is the segmentation GL2R would actually produce for the given vocabulary\. A segmentationssis*GL2R\-realizable*\(under vocabularyVV\) if it is exactly the segmentation GL2R longest\-prefix decoding emits on pretokenpp\.*Greedy\-consistency*means that every choice withzp,s=1z\_\{p,s\}=1is GL2R\-realizable; we enforce this with[Equation˜13](https://arxiv.org/html/2607.23362#S2.E13)\.
A*segment*ggis one contiguous piece of a segmentationss; fors=ta\|b\|les=\\texttt\{ta\}\\,\|\\,\\texttt\{b\}\\,\|\\,\\texttt\{le\}the segments areta,b, andle\. LetGs−G\_\{s\}^\{\-\}denote the*non\-final*segments ofss\(heretaandb\); the final segment has nothing downstream to displace, so it imposes no constraint\. For byte stringsu,vu,vwe writeu⪯vu\\preceq vifuuis a prefix ofvv, andu≺vu\\prec vif additionallyu≠vu\\neq v\. Under GL2R,ssis GL2R\-realizable only if at the start of each non\-final segment, no longer vocabulary token extends past that segment, otherwise GL2R would emit the longer token and shift all downstream boundaries\. The red rows of[Figure˜2](https://arxiv.org/html/2607.23362#S2.F2)illustrate this for two example segmentations\.
Consider a non\-final segmentg∈Gs−g\\in G\_\{s\}^\{\-\}, and letwwbe the suffix ofppthat starts atgg\(sowwbegins withgg, i\.e\.g⪯wg\\preceq w\)\. For example, withp=tablep=\\texttt\{table\}andg=tag=\\texttt\{ta\}we havew=tablew=\\texttt\{table\}; withg=bg=\\texttt\{b\}we havew=blew=\\texttt\{ble\}\. The*forbidden\-prefix set*Lp,s,gL\_\{p,s,g\}comprises candidate tokens that strictly extendggwhile still matching the upcoming bytes ofpp:
Lp,s,g=\{t∈T:g≺t⪯w\}∀p∈P,∀s∈Sp∖\{ℱ\},∀g∈Gs−\.L\_\{p,s,g\}\\;=\\;\\bigl\\\{\\,t\\in T\\;:\\;g\\prec t\\preceq w\\,\\bigr\\\}\\quad\\forall\\,p\\in P,\\ \\forall\\,s\\in S\_\{p\}\\setminus\\\{\\mathcal\{F\}\\\},\\ \\forall\\,g\\in G\_\{s\}^\{\-\}\.\(12\)
Forp=tablep=\\texttt\{table\},g=tag=\\texttt\{ta\}, andw=tablew=\\texttt\{table\},[Equation˜12](https://arxiv.org/html/2607.23362#S2.E12)yieldsLp,s,g=\{tab,tabl,table\}L\_\{p,s,g\}=\\\{\\texttt\{tab\},\\texttt\{tabl\},\\texttt\{table\}\\\}\. Noteg≺tg\\prec talone is not enough:taxextendstabut is not inLp,s,gL\_\{p,s,g\}, sincetax⋠table\\texttt\{tax\}\\not\\preceq\\texttt\{table\}means GL2R never considers it here\. A forbidden longer prefix need not be a segment ofss\(e\.g\.tab∈Lp,s,g\\texttt\{tab\}\\in L\_\{p,s,g\}forta\|blealthoughtabis not one of its segments\)\.
If anyt∈Lp,s,gt\\in L\_\{p,s,g\}is in the vocabulary,sscannot be selected:
zp,s≤1−xt∀p∈P,∀s∈Sp∖\{ℱ\},∀g∈Gs−,∀t∈Lp,s,g\.z\_\{p,s\}\\leq 1\-x\_\{t\}\\qquad\\forall\\,p\\in P,\\ \\forall\\,s\\in S\_\{p\}\\setminus\\\{\\mathcal\{F\}\\\},\\ \\forall\\,g\\in G\_\{s\}^\{\-\},\\ \\forall\\,t\\in L\_\{p,s,g\}\.\(13\)
Together with the linking constraint[Equation˜11](https://arxiv.org/html/2607.23362#S2.E11), which guarantees each segment string is itself in the vocabulary,[Equation˜13](https://arxiv.org/html/2607.23362#S2.E13)ensures that wheneverzp,s=1z\_\{p,s\}=1each chosen segment is the*longest*vocabulary match at its start position, exactly the segmentation GL2R longest\-prefix decoding emits with vocabularyVV\.
### 2\.5Fallback\-driven escalation
[Equation˜13](https://arxiv.org/html/2607.23362#S2.E13)must be enforced for every segmentation variable we instantiate, so the size of the IP in[Equations7](https://arxiv.org/html/2607.23362#S2.E7)to[13](https://arxiv.org/html/2607.23362#S2.E13)is driven by\|Sp\|\|S\_\{p\}\|in each round\.[Section˜2\.1](https://arxiv.org/html/2607.23362#S2.SS1)explained why naively instantiating all orders for every pretoken in the top\-NNset would introduce too many variables and constraints, making the LP slow to solve; here we describe the schedule that keeps each solve tractable while preserving a globally coupled objective\.
#### Fallback as model\-size control\.
Every pretoken has a distinctℱ∈Sp\\mathcal\{F\}\\in S\_\{p\}with variablezp,ℱz\_\{p,\\mathcal\{F\}\}; setting it to11pays the highercost\(p,ℱ\)\\mathrm\{cost\}\(p,\\mathcal\{F\}\)rather than committing to any instantiated segmentation\. This is not a soft penalty but a*model\-size control*: it lets us omit higher\-order segmentations until the solver signals the current family is too coarse forpp\.
#### Fallback\-driven iterative escalation\.
Training solves a sequence of LP relaxations of the globally coupled IP, each with the same structure[Equations8](https://arxiv.org/html/2607.23362#S2.E8)to[13](https://arxiv.org/html/2607.23362#S2.E13)and objective[Equation˜7](https://arxiv.org/html/2607.23362#S2.E7), but with pretoken segmentation setsSpS\_\{p\}growing from round to round, and the candidate setTTrecomputed accordingly\.
*Round 1\.*For everyp∈Pp\\in P, setκp=2\\kappa\_\{p\}=2and initializeSpS\_\{p\}to the unsplit pretoken, all order\-2 segmentations \(one internal split per byte gap\), andℱ\\mathcal\{F\}\. To shrink the first LP, theNtop=8000N\_\{\\mathrm\{top\}\}\{=\}8000highest\-count pretokens start withκp=1\\kappa\_\{p\}\{=\}1\(whole pretoken andℱ\\mathcal\{F\}only\): these extremely frequent tokens \(common words likethe,is,in, and common punctuation\) carry the bulk of corpus mass and are near\-certain vocabulary members as whole units regardless of budget, making their order\-2 splits almost never worthwhile; omitting them removes a large fraction of variables and greedy\-consistency rows \([Equation˜13](https://arxiv.org/html/2607.23362#S2.E13)\) with little empirical impact\. Any pretoken that nonetheless activatesℱ\\mathcal\{F\}is promoted to the full order\-2 family before the next round\.
*Escalation loop\.*After the solution of each LP \([Section˜2\.6](https://arxiv.org/html/2607.23362#S2.SS6)\) with optimal fractional values\(x⋆,z⋆\)\(x^\{\\star\},z^\{\\star\}\)in roundii, read off the fallback\-active setFi=\{p∈P:zp,ℱ⋆≥θ\}F\_\{i\}=\\\{p\\in P:z\_\{p,\\mathcal\{F\}\}^\{\\star\}\\geq\\theta\\\}from the fractional solution\. Only pretokens inFiF\_\{i\}haveκp\\kappa\_\{p\}incremented \(up to capM=3M\{=\}3\), their order\-\(κp\+1\)\(\\kappa\_\{p\}\{\+\}1\)segmentations appended toSpS\_\{p\},TTand the full IP rebuilt, and re\-solved;[Figure˜1](https://arxiv.org/html/2607.23362#S2.F1)\(b\) illustrates the order\-3 segmentations added forp=table∈Fip=\\texttt\{table\}\\in F\_\{i\}\. The loop continues untilFi=∅F\_\{i\}=\\emptysetor noκp\\kappa\_\{p\}changes\.
*Final repricing\.*When the structure stabilizes, one last solve freezes eachSpS\_\{p\}and setscost\(p,ℱ\)=np\\mathrm\{cost\}\(p,\\mathcal\{F\}\)=n\_\{p\}via[Equation˜4](https://arxiv.org/html/2607.23362#S2.E4), so resolved pretokens carry their exact GL2R inference cost while any remaining fallback mass is assigned a conservative byte\-level upper bound\. LP relaxation and vocabulary extraction from the final fractional solution are described in the next subsection\.
### 2\.6LP relaxation and weighted rounding
The IP instances in[Equations7](https://arxiv.org/html/2607.23362#S2.E7)to[13](https://arxiv.org/html/2607.23362#S2.E13)are too large to solve to optimality at corpus scale, even after iterative enrichment of the segmentation families\. Following ToaST, JOLT works with an LP relaxation that replaces the binary domains in[Equations5](https://arxiv.org/html/2607.23362#S2.E5)to[6](https://arxiv.org/html/2607.23362#S2.E6)by
0≤xt≤1∀t∈T,0\\leq x\_\{t\}\\leq 1\\quad\\forall t\\in T,\(14\)0≤zp,s≤1∀p∈P,∀s∈Sp\.0\\leq z\_\{p,s\}\\leq 1\\quad\\forall p\\in P,\\ \\forall s\\in S\_\{p\}\.\(15\)
Solving the resulting LP with Gurobi\(Gurobi Optimization, LLC,[2026](https://arxiv.org/html/2607.23362#bib.bib19)\)yields optimal fractional values\(x⋆,z⋆\)\(x^\{\\star\},z^\{\\star\}\)\. Relaxing integrality allows segmentation mass to split fractionally acrossSpS\_\{p\}, but the relaxation remains globally coupled across pretokens: high\-countppstill pulls token mass toward compressing segmentations that survive GL2R linking and greedy\-consistency coupling\. In practice the final\-round solution is empirically near\-integral on our instances \(manyxt⋆x\_\{t\}^\{\\star\}near0or11\), which makes a simple rounding rule effective to construct a budget\-feasible vocabulary under[Equation˜9](https://arxiv.org/html/2607.23362#S2.E9)without solving the full IP to optimality\. The optimal objective value is a valid lower bound on the corresponding instantiated IP objective\.
#### Contribution\-based rounding\.
We extract the vocabulary from\(x⋆,z⋆\)\(x^\{\\star\},z^\{\\star\}\)using the contribution\-based weighted rounding of ToaST\. The rule is unchanged: although JOLT’s segmentation variableszp,sz\_\{p,s\}range over GL2R\-realizable segmentations rather than split\-tree ones, rounding treats them only as generic segmentation variables, so the procedure transfers verbatim\. Tokens withxt⋆≥1−ϵx\_\{t\}^\{\\star\}\\geq 1\-\\epsilonare admitted toVVoutright \([appendix˜B](https://arxiv.org/html/2607.23362#A2)\); the remaining budget is filled from the fractional tier by*objective contribution*Ct⋆C^\{\\star\}\_\{t\}, the count\-weightedz⋆z^\{\\star\}\-mass flowing throughtt\([Equation˜16](https://arxiv.org/html/2607.23362#A2.E16)in[appendix˜B](https://arxiv.org/html/2607.23362#A2)\)\. Selection therefore favors tokens the relaxation already used to compress high\-frequency pretokens, rather than tokens with largext⋆x\_\{t\}^\{\\star\}but little segmentation support\. Inference applies GL2R decoding withVV\.
## 3Experimental Setup
### 3\.1Data and pretokenization
We train and evaluate all tokenizers on MiniPile\(Kaddour,[2023](https://arxiv.org/html/2607.23362#bib.bib12)\), a subset of The Pile\(Gaoet al\.,[2020](https://arxiv.org/html/2607.23362#bib.bib21)\), using a document\-level 75%/25% train/validation split\. Both splits are pretokenized withGPT4O\_REGEX\_16\(details in[appendix˜C](https://arxiv.org/html/2607.23362#A3)\), which segments text into words, numbers, punctuation, and whitespace runs; tokens cannot cross pretoken boundaries\. We writePvalP\_\{\\mathrm\{val\}\}for the full set of aggregated pretoken types on the validation holdout \(100% of validation count mass\); all token counts, % decrease, and Rényi efficiency in[Section˜4](https://arxiv.org/html/2607.23362#S4)are evaluated onPvalP\_\{\\mathrm\{val\}\}\.
### 3\.2Baselines and Configurations
#### Baselines\.
BPE, WordPiece, and UnigramLM are trained on the full training corpus using standard HuggingFace pipelines\.BPE\-nativedecodes with the standard BPE merge rule;BPE\-greedyapplies GL2R longest\-prefix decoding to the same vocabulary, isolating the effect of inference rule from vocabulary construction\. WordPiece\-greedy and UnigramLM\-greedy analogously pair standard vocabularies with GL2R decoding at evaluation\. UnigramLM\-greedy serves as a diagnostic for training\-objective mismatch: it applies the same GL2R inference as JOLT but was trained to maximize unigram language\-model likelihood rather than minimize token count, so its substantially higher token counts reflect training\-objective divergence\. All methods are evaluated at matched vocabulary sizes\|V\|∈\{32,000,64,000\}\|V\|\\in\\\{32\{,\}000,64\{,\}000\\\}; % improvements are relative to BPE\-native merge decoding\.
#### JOLT configurations\.
We evaluate JOLT at four training scopes \(N∈\{100k,200k,300k,400k\}N\\in\\\{100\\text\{k\},200\\text\{k\},300\\text\{k\},400\\text\{k\}\\\}\) and both vocabulary budgets, with all runs capped at escalation orderM=3M\{=\}3\.333We verifiedM=3M\{=\}3is sufficient:M=4M\{=\}4at\|V\|=32\|V\|\{=\}32k/N=100N\{=\}100k emits368\.7368\.7M tokens onPvalP\_\{\\mathrm\{val\}\}vs\.368\.6368\.6M atM=3M\{=\}3\(≈0\.05%\{\\approx\}0\.05\\%apart\)\. Higher order adds substantial LP size with no compression gain\.Because corpus\-scale LP solves are far more expensive than standard baseline training, JOLT trains exclusively on the top\-NNpretokens \(the setPPof[Section˜2\.1](https://arxiv.org/html/2607.23362#S2.SS1)\), while baselines train on the full distribution; both are evaluated on the samePvalP\_\{\\mathrm\{val\}\}\. Pretoken frequencies are highly skewed, so even the smallest scope \(N=100N\{=\}100k\) covers≈95\.8%\\approx 95\.8\\%of training count mass, rising to≈98\.3%\\approx 98\.3\\%atN=400N\{=\}400k; nevertheless, this asymmetry can disadvantage JOLT for tail pretokens not seen during optimization, so reported validation margins may understate its compression quality on the training scope where LP certificates apply\. The two larger scopes \(N=300N\{=\}300k andN=400N\{=\}400k\) use the round\-2\-only protocol of[Section˜3\.3](https://arxiv.org/html/2607.23362#S3.SS3)to assess training scope sensitivity\.
### 3\.3Extended\-scope protocol \(N=300N\{=\}300k andN=400N\{=\}400k\)
Full\-pipeline runs atN=100N\{=\}100k/200200k provide our LP optimality certificates; extended scopes atN=300N\{=\}300k/400400k use a round\-2\-only protocol within our compute budget and are reported to assess whether validation compression continues to improve asNNgrows, not to claim an equivalent final\-round bound\. AtN=300N\{=\}300k andN=400N\{=\}400k the final repricing LP becomes prohibitively expensive within our compute budget \(See the full breakdown of solve times in[Table˜2](https://arxiv.org/html/2607.23362#A5.T2),[appendix˜E](https://arxiv.org/html/2607.23362#A5)\), so we stop after iter\-2 and skip the final LP; the iter\-2 vocabulary from contribution\-based rounding is directly used for validation scoring in[Table˜1](https://arxiv.org/html/2607.23362#S4.T1)\.
To keep gap\-closed and round\-gap diagnostics comparable across all training scopes in[Table˜4](https://arxiv.org/html/2607.23362#A10.T4), we report the raw Gurobi iter\-2 LP objective and the greedy\-L2R token count onPPfrom the iter\-2 vocabulary\. We do not correct the iter\-2 fallback cost \(κp\+1=3\\kappa\_\{p\}\{\+\}1\{=\}3\) to the final\-round byte\-level penaltynpn\_\{p\}: doing so after the fact would invalidate the relaxation bound, sincez⋆z^\{\\star\}was optimized under the original costs \([appendix˜I](https://arxiv.org/html/2607.23362#A9)\)\.
Because the full pipeline remains affordable atN=100N\{=\}100k andN=200N\{=\}200k, we use those runs as a sanity check: extracting the iter\-2 vocabulary and rounded count from saved checkpoints recovers full\-pipeline rounded objectives to within0\.03%0\.03\\%and validation token counts to within≈0\.5\{\\approx\}0\.5M tokens \([appendix˜I](https://arxiv.org/html/2607.23362#A9)\), justifying the round\-2\-only protocol at largerNN\.
## 4Results and Analysis
### 4\.1Optimality Bounds and Gap Closure
[Figure˜3](https://arxiv.org/html/2607.23362#S4.F3)shows the LP bound, rounded JOLT token count, and BPE\-greedy on the training scopePP\(not onPvalP\_\{\\mathrm\{val\}\}\) for the four full\-pipeline runs \(N∈\{100k,200k\}N\\in\\\{100\\text\{k\},200\\text\{k\}\\\}, both vocabulary budgets\)\. The LP objective is a*valid lower bound*on achievable GL2R token count under our formulation, and all four instances solve toOPTIMAL\([appendices˜J](https://arxiv.org/html/2607.23362#A10)and[D](https://arxiv.org/html/2607.23362#A4)\)\. The rounded score exceeds this LP bound by only0\.0080\.008–0\.176%0\.176\\%, so the extracted vocabularies nearly attain the relaxation optimum onPP\. Because rounded JOLT vocabularies sit this close to the LP bound, any margin over BPE\-native onPvalP\_\{\\mathrm\{val\}\}reflects genuine LP\-level compression gains, not rounding loss\. On the matched training scopePP\(not onPvalP\_\{\\mathrm\{val\}\}, where tail pretokens outsidePPdilute the comparison\), JOLT closes89\.689\.6–99\.4%99\.4\\%of the BPE\-greedy\-to\-LP gap, confirming most achievable compression under our formulation is recovered\. BPE\-greedy already sits near the LP lower bound onPP, which is why heuristic training leaves only a small absolute margin onPvalP\_\{\\mathrm\{val\}\}\. Intuitively, BPE’s left\-to\-right merge order naturally favors longer, more frequent substrings, which aligns structurally with GL2R’s longest\-match rule\. Even though BPE was not designed for GL2R, the two procedures share a preference for greedy length maximization that keeps BPE close to the GL2R\-optimal bound\.
Figure 3:LP bound, rounded greedy\-L2R objective, and BPE\-greedy token count on training scopePP\(in millions\), with gap\-closed % and round\-gap annotated per group\. JOLT closes89\.689\.6–99\.4%99\.4\\%of the BPE\-greedy\-to\-LP slack; rounded solutions sit within0\.0080\.008–0\.176%0\.176\\%of the LP bound\. Full\-pipeline runs only \(N∈\{100k,200k\}N\\in\\\{100\\text\{k\},200\\text\{k\}\\\}\); extended\-scope rows in[Table˜4](https://arxiv.org/html/2607.23362#A10.T4)\.
### 4\.2Validation Compression Across Training Scopes
[Table˜1](https://arxiv.org/html/2607.23362#S4.T1)reports greedy\-L2R intrinsic metrics onPvalP\_\{\\mathrm\{val\}\}for all four training scopes\. Rows marked†use the round\-2\-only protocol \([Section˜3\.3](https://arxiv.org/html/2607.23362#S3.SS3)\) and report validation compression only; LP optimality certificates come from the full pipeline atN=100N\{=\}100k/200200k \([Section˜4\.1](https://arxiv.org/html/2607.23362#S4.SS1)\)\.
MethodRényi efficiencyα=2\.5\\alpha=2\.532k64k32k64k32k64kBPE\-native merge decoding370\.8351\.9——0\.4860\.448BPE\-greedy370\.4351\.6\+0\.08\+0\.080\.4860\.449WordPiece\-greedy372\.3352\.8−0\.42\-0\.42−0\.25\-0\.250\.4870\.449UnigramLM\-greedy476\.0460\.6−28\.37\-28\.37−30\.91\-30\.910\.3520\.334JOLTN=100kN\{=\}100k\(ours\)368\.6354\.1\+0\.59−0\.63\-0\.630\.4850\.450JOLTN=200kN\{=\}200k\(ours\)367\.9351\.1\+0\.77\+0\.230\.4850\.448JOLTN=300kN\{=\}300k\(ours\)†367\.9351\.0\+0\.76\+0\.260\.4850\.449JOLTN=400kN\{=\}400k\(ours\)†367\.9350\.8\+0\.78\+0\.310\.4850\.448Table 1:Intrinsic token\-count comparison onPvalP\_\{\\mathrm\{val\}\}\([Section˜3\.1](https://arxiv.org/html/2607.23362#S3.SS1)\)\. JOLT trains on the top\-NNpretokens; baselines train on the full corpus \([Section˜3](https://arxiv.org/html/2607.23362#S3)\)\. Token counts in millions \(M\); % decrease relative to BPE\-native \(positive = fewer tokens\)\.†Round\-2\-only protocol \([Section˜3\.3](https://arxiv.org/html/2607.23362#S3.SS3)\)\. Rényi efficiencies cluster tightly across methods; differences in compression appear in token counts, not the Rényi spread\.At\|V\|=32\|V\|\{=\}32k, JOLT beats BPE\-native at every evaluated scope:\+0\.59%\+0\.59\\%atN=100N\{=\}100k,\+0\.77%\+0\.77\\%atN=200N\{=\}200k,\+0\.76%\+0\.76\\%atN=300N\{=\}300k, and\+0\.78%\+0\.78\\%atN=400N\{=\}400k\. At\|V\|=64\|V\|\{=\}64k, whether JOLT beats BPE\-native depends entirely on scope:N=100N\{=\}100k trails by0\.63%0\.63\\%, whileN≥200N\\geq 200k consistently beats it with the margin growing from\+0\.23%\+0\.23\\%to\+0\.31%\+0\.31\\%asNNincreases\. BPE\-native and BPE\-greedy differ by only0\.08%0\.08\\%at both vocabulary budgets, confirming that for BPE vocabularies the inference rule is almost irrelevant to compression\. The gap between BPE and JOLT therefore reflects vocabulary construction, not inference\-rule mismatch\. WordPiece\-greedy, despite being designed for GL2R inference, attains worse compression than BPE\-native \(−0\.42%\-0\.42\\%at3232k,−0\.25%\-0\.25\\%at6464k\), consistent with its training objective—maximizing unigram language\-model likelihood rather than minimizing token count—diverging from compression minimization\. The rate of improvement withNNdiffers by vocabulary budget: at\|V\|=32\|V\|\{=\}32k gains plateau nearN=200N\{=\}200k but show a slight further increase atN=400N\{=\}400k \(\+0\.78%\+0\.78\\%\), while at\|V\|=64\|V\|\{=\}64k compression improves more steadily throughN=400N\{=\}400k \(\+0\.31%\+0\.31\\%\)\. The smaller budget saturates earlier because3232k tokens already cover a large fraction of the high\-frequency pretoken tail atN=200N\{=\}200k, whereas the larger vocabulary has more slots to account for the tail of lower frequency pretokens\. Fallback mass after round 1 stays below1\.6%1\.6\\%of training count, halves after order\-3 escalation, and validation counts improve monotonically with each round; full diagnostics are in[appendix˜F](https://arxiv.org/html/2607.23362#A6)\. In[appendices˜G](https://arxiv.org/html/2607.23362#A7)and[H](https://arxiv.org/html/2607.23362#A8)we compare rank\-frequency profiles and token\-length distributions across tokenizers; the overall profiles are largely similar, with the main structural signature being a modest shift toward length\-1 tokens under JOLT\.
## 5Conclusion
We developed a vocabulary construction method tailored to GL2R longest\-match decoding, a widely deployed inference rule that lacked an inference\-specific training method\. JOLT fills this gap with a joint integer program whose greedy\-consistency constraints force each pretoken’s segmentation to match exactly what GL2R realizes under the chosen vocabulary\.
The optimizer behaves as designed: rounded JOLT vocabularies close89\.689\.6–99\.4%99\.4\\%of the BPE\-greedy\-to\-LP gap on full\-pipeline runs\. Yet the headroom is small: BPE already sits within11–2%2\\%of the bound, because its left\-to\-right merge order rewards the long, frequent substrings that GL2R also prefers at decode time\. The residual gap is driven primarily by vocabulary construction rather than the inference rule\. Thus, JOLT’s margin — up to0\.78%0\.78\\%fewer held\-out tokens, increasing with scope — comes from reshaping the vocabulary, not from changing inference\.
The lasting contribution is therefore not the size of the margin but the ability to certify it relative to an LP lower bound\. The LP bound separates optimizer quality from the headroom the inference rule allows, turning “how much better can a GL2R tokenizer be?” from an open question into a measured one\. It also provides a reusable test for whether an inference\-specific optimizer is worth building for any other decoding rule\.
## Limitations
All experiments use MiniPile, a predominantly English corpus, with a single train/validation split and a fixed regex pretokenizer\. Optimality claims are relative to the pretoken boundaries induced by this pretokenizer, and we do not evaluate transfer to languages without whitespace\-delimited words\. The IP covers only the top\-NNpretokens \(≈95\.8\\approx 95\.8–98\.3%98\.3\\%of count\-weighted training mass\); the tail is excluded entirely from optimization\. Within the training scope, segmentations above order capM=3M\{=\}3\([Section˜3\.2](https://arxiv.org/html/2607.23362#S3.SS2)\) are priced conservatively withnpn\_\{p\}rather than optimized\. Our certificates are empirical LP\-gap measurements on the training scope, not proven general approximation bounds: the IP is never solved to integral optimality, and the rounding step carries no worst\-case guarantee\. Finally, our evaluation is intrinsic only\. Our contribution lies in the joint modeling of vocabulary construction and GL2R segmentation, alongside the certification methodology, rather than a claim of downstream performance\.
## References
- M\. Ali, M\. Fromm, K\. Thellmann, R\. Rutmann, M\. Lübbering, J\. Leveling, K\. Klug, J\. Ebert, N\. Doll, J\. Buschhoff, C\. Jain, A\. Weber, L\. Jurkschat, H\. Abdelwahab, C\. John, P\. Ortiz Suarez, M\. Ostendorff, S\. Weinbach, R\. Sifa,et al\.\(2024\)Tokenizer choice for LLM training: negligible or crucial?\.InFindings of the Association for Computational Linguistics,Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- P\. Gage \(1994\)A new algorithm for data compression\.The C Users Journal12\(2\),pp\. 23–38\.Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- M\. Gallé \(2019\)Investigating the effectiveness of BPE: the power of shorter sequences\.InProceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing \(EMNLP\-IJCNLP\),Hong Kong, China,pp\. 1375–1381\.Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- L\. Gao, S\. Biderman, S\. Black, L\. Golding, T\. Hoppe, C\. Foster, J\. Phang, H\. He, A\. Thite, N\. Nabeshima,et al\.\(2020\)The Pile: an 800GB dataset of diverse text for language modeling\.arXiv preprint arXiv:2101\.00027\.Cited by:[§3\.1](https://arxiv.org/html/2607.23362#S3.SS1.p1.2)\.
- O\. Goldman, A\. Caciularu, M\. Eyal, K\. Cao, I\. Szpektor, and R\. Tsarfaty \(2024\)Unpacking tokenization: evaluating text compression and its correlation with model performance\.InFindings of the Association for Computational Linguistics: ACL 2024,Bangkok, Thailand,pp\. 2274–2286\.Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- Gurobi Optimization, LLC \(2026\)Gurobi Optimizer Reference Manual\.Note:Version 11\.0External Links:[Link](https://www.gurobi.com/)Cited by:[Appendix D](https://arxiv.org/html/2607.23362#A4.p1.1),[§2\.6](https://arxiv.org/html/2607.23362#S2.SS6.p2.6)\.
- J\. Kaddour \(2023\)The minipile challenge for data\-efficient language models\.External Links:2304\.08442,[Link](https://arxiv.org/abs/2304.08442)Cited by:[§3\.1](https://arxiv.org/html/2607.23362#S3.SS1.p1.2)\.
- V\. Kastreva, P\. Whittington, D\. Komm, and T\. Pimentel \(2026\)Tokenisation over bounded alphabets is hard\.InThe Fourteenth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=Xhf9YqwlM4)Cited by:[footnote 1](https://arxiv.org/html/2607.23362#footnote1)\.
- T\. Kudo \(2018\)Subword regularization: improving neural network translation models with multiple subword candidates\.InProceedings of the 56th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),I\. Gurevych and Y\. Miyao \(Eds\.\),Melbourne, Australia,pp\. 66–75\.External Links:[Link](https://aclanthology.org/P18-1007/),[Document](https://dx.doi.org/10.18653/v1/P18-1007)Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- P\. Rust, J\. Pfeiffer, I\. Vulić, S\. Ruder, and I\. Gurevych \(2021\)How good is your tokenizer? on the monolingual performance of multilingual language models\.InProceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing \(Volume 1: Long Papers\),Online,pp\. 3118–3135\.Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- C\. W\. Schmidt, M\. Krumdick, A\. Wiemerslage, S\. Ebner, V\. Reddy, Y\. Pinter, and C\. Tanner \(2026\)Tokenization with split trees\.External Links:2605\.22705,[Link](https://arxiv.org/abs/2605.22705)Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p2.1)\.
- C\. W\. Schmidt, V\. Reddy, H\. Zhang, A\. Alameddine, O\. Uzan, Y\. Pinter, and C\. Tanner \(2024\)Tokenization is more than compression\.InProceedings of the 2024 Conference on Empirical Methods in Natural Language Processing,Miami, Florida, USA,pp\. 678–702\.Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- M\. Schuster and K\. Nakajima \(2012\)Japanese and korean voice search\.In2012 IEEE International Conference on Acoustics, Speech and Signal Processing \(ICASSP\),Vol\.,pp\. 5149–5152\.External Links:[Document](https://dx.doi.org/10.1109/ICASSP.2012.6289079)Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- R\. Sennrich, B\. Haddow, and A\. Birch \(2016\)Neural machine translation of rare words with subword units\.InProceedings of the 54th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),K\. Erk and N\. A\. Smith \(Eds\.\),Berlin, Germany,pp\. 1715–1725\.External Links:[Link](https://aclanthology.org/P16-1162/),[Document](https://dx.doi.org/10.18653/v1/P16-1162)Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
- J\. Tempus, P\. Whittington, C\. W\. Schmidt, D\. Komm, and T\. Pimentel \(2026\)Tokenisation via convex relaxations\.External Links:2605\.22821,[Link](https://arxiv.org/abs/2605.22821)Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p2.1)\.
- O\. Uzan, C\. W\. Schmidt, C\. Tanner, and Y\. Pinter \(2024\)Greed is all you need: an evaluation of tokenizer inference methods\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 2: Short Papers\),L\. Ku, A\. Martins, and V\. Srikumar \(Eds\.\),Bangkok, Thailand,pp\. 813–822\.External Links:[Link](https://aclanthology.org/2024.acl-short.73/),[Document](https://dx.doi.org/10.18653/v1/2024.acl-short.73)Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p3.2)\.
- P\. Whittington, G\. Bachmann, and T\. Pimentel \(2025\)Tokenisation is NP\-complete\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),W\. Che, J\. Nabende, E\. Shutova, and M\. T\. Pilehvar \(Eds\.\),Vienna, Austria,pp\. 28133–28153\.External Links:[Link](https://aclanthology.org/2025.acl-long.1365/),[Document](https://dx.doi.org/10.18653/v1/2025.acl-long.1365),ISBN 979\-8\-89176\-251\-0Cited by:[footnote 1](https://arxiv.org/html/2607.23362#footnote1)\.
- Y\. Wu, M\. Schuster, Z\. Chen, Q\. V\. Le, M\. Norouzi, W\. Macherey, M\. Krikun, Y\. Cao, Q\. Gao, K\. Macherey, J\. Klingner, A\. Shah, M\. Johnson, X\. Liu, Ł\. Kaiser, S\. Gouws, Y\. Kato, T\. Kudo, H\. Kazawa, K\. Stevens, G\. Kurian, N\. Patil, W\. Wang, C\. Young, J\. Smith, J\. Riesa, A\. Rudnick, O\. Vinyals, G\. Corrado, M\. Hughes, and J\. Dean \(2016\)Google’s neural machine translation system: bridging the gap between human and machine translation\.External Links:1609\.08144Cited by:[§1](https://arxiv.org/html/2607.23362#S1.p1.1)\.
## Appendix AJOLT Training Algorithm
The pseudocode in Algorithm[1](https://arxiv.org/html/2607.23362#alg1)summarizes the full training pipeline and experimental protocol\.
Algorithm 1Greedy\-L2R Joint MIP with Fallback\-Driven Escalation1:Aggregated pretokens
PPwith counts
cpc\_\{p\}, target vocabulary cardinality
\|V\|\|V\|, byte set
BB, max segmentation order
MM, fallback\-active threshold
θ\\theta\(default 0\.01\)
2:Learned vocabulary
V⊆TV\\subseteq Twith
\|V\|\|V\|tokens
3:Initialize escalation map
κp←2\\kappa\_\{p\}\\leftarrow 2for all
p∈Pp\\in P
4:Initialize fallback\-active set
F←∅F\\leftarrow\\varnothing
5:repeat
6:
T←BT\\leftarrow B⊳\\trianglerightglobal candidate tokens forxtx\_\{t\}
7:foreach pretoken
p∈Pp\\in Pdo
8:ifwhole\-only shortcut active for
ppand
p∉Fp\\notin Fthen
9:
Sp←\{whole,ℱ\}S\_\{p\}\\leftarrow\\\{\\texttt\{whole\},\\mathcal\{F\}\\\}⊳\\trianglerightmodel\-size shortcut for top\-NtopN\_\{\\text\{top\}\}
10:else
11:
Sp←\{whole\}∪⋃r=2κp\{order\-rsegmentations ofp\}∪\{ℱ\}S\_\{p\}\\leftarrow\\\{\\texttt\{whole\}\\\}\\cup\\bigcup\_\{r=2\}^\{\\kappa\_\{p\}\}\\\{\\text\{order\-\}r\\text\{ segmentations of \}p\\\}\\cup\\\{\\mathcal\{F\}\\\}
12:endif
13:Add all tokens used by
SpS\_\{p\}to the candidate token set
TT
14:endfor
15:Create variables
xt∈\{0,1\}∀t∈Tx\_\{t\}\\in\\\{0,1\\\}\\ \\forall t\\in T,
zp,s∈\{0,1\}∀p∈P,s∈Spz\_\{p,s\}\\in\\\{0,1\\\}\\ \\forall p\\in P,\\ s\\in S\_\{p\}
16:Add constraints:
17:\([8](https://arxiv.org/html/2607.23362#S2.E8)\):
xb=1,∀b∈Bx\_\{b\}=1,\\ \\forall b\\in B⊳\\trianglerightbyte completeness
18:\([9](https://arxiv.org/html/2607.23362#S2.E9)\):
∑t∈Txt≤\|V\|\\sum\_\{t\\in T\}x\_\{t\}\\leq\|V\|⊳\\trianglerightvocabulary budget
19:\([10](https://arxiv.org/html/2607.23362#S2.E10)\):
∑s∈Spzp,s=1,∀p∈P\\sum\_\{s\\in S\_\{p\}\}z\_\{p,s\}=1,\\ \\forall p\\in P⊳\\trianglerightexactly one segmentation per pretoken
20:\([11](https://arxiv.org/html/2607.23362#S2.E11)\):
zp,s≤xt,∀p,∀s∈Sp∖\{ℱ\},∀t∈Ep,sz\_\{p,s\}\\leq x\_\{t\},\\ \\forall p,\\ \\forall s\\in S\_\{p\}\\setminus\\\{\\mathcal\{F\}\\\},\\ \\forall t\\in E\_\{p,s\}⊳\\trianglerightlinking
21:\([13](https://arxiv.org/html/2607.23362#S2.E13)\):
zp,s≤1−xt,∀p,∀s∈Sp∖\{ℱ\},∀g∈Gs−,∀t∈Lp,s,gz\_\{p,s\}\\leq 1\-x\_\{t\},\\ \\forall p,\\ \\forall s\\in S\_\{p\}\\setminus\\\{\\mathcal\{F\}\\\},\\forall g\\in G\_\{s\}^\{\-\},\\ \\forall t\\in L\_\{p,s,g\}⊳\\trianglerightgreedy\-consistency
22:Set objective \([7](https://arxiv.org/html/2607.23362#S2.E7)\):
min∑p∈P∑s∈Spcpcost\(p,s\)zp,s\\min\\sum\_\{p\\in P\}\\sum\_\{s\\in S\_\{p\}\}c\_\{p\}\\,\\mathrm\{cost\}\(p,s\)\\,z\_\{p,s\}
23:Solve LP relaxation \(or MIP variant\) with Gurobi
24:Extract fallback\-active set
F←\{p∈P:zp,ℱ⋆≥θ\}F\\leftarrow\\\{p\\in P:\\ z\_\{p,\\mathcal\{F\}\}^\{\\star\}\\geq\\theta\\\}⊳\\trianglerightfromz⋆z^\{\\star\}before rounding
25:
V←WeightedRound\(x⋆,z⋆,\|V\|\)V\\leftarrow\\textsc\{WeightedRound\}\(x^\{\\star\},z^\{\\star\},\|V\|\)⊳\\trianglerightper\-iteration rounded vocabulary
26:foreach
p∈Fp\\in Fdo
27:Escalate only fallback\-active pretokens:
κp←min\(κp\+1,M\)\\kappa\_\{p\}\\leftarrow\\min\(\\kappa\_\{p\}\+1,M\)
28:endfor
29:until
F=∅F=\\varnothingor no
κp\\kappa\_\{p\}changes
30:*Final repricing round:*set
cost\(p,ℱ\)←\|p\|\\mathrm\{cost\}\(p,\\mathcal\{F\}\)\\leftarrow\|p\|, rebuild and re\-solve LP once
31:
V←WeightedRound\(x⋆,z⋆,\|V\|\)V\\leftarrow\\textsc\{WeightedRound\}\(x^\{\\star\},z^\{\\star\},\|V\|\)⊳\\trianglerightfinal vocabulary
32:returnselected vocabulary
VV, objectives, bounds, fallback stats
33:
34:procedureWeightedRound\(
x⋆,z⋆,\|V\|x^\{\\star\},\\,z^\{\\star\},\\,\|V\|\)⊳\\trianglerightwithϵ=10−6\\epsilon=10^\{\-6\}
35:
T1←\{t∈T:xt⋆≥1−ϵ\}T\_\{1\}\\leftarrow\\\{t\\in T:\\ x\_\{t\}^\{\\star\}\\geq 1\-\\epsilon\\\}⊳\\trianglerightnear\-integral, accept all;B⊆T1B\\subseteq T\_\{1\}via \([8](https://arxiv.org/html/2607.23362#S2.E8)\)
36:
TF←\{t∈T:ϵ<xt⋆<1−ϵ\}T\_\{F\}\\leftarrow\\\{t\\in T:\\ \\epsilon<x\_\{t\}^\{\\star\}<1\-\\epsilon\\\}⊳\\trianglerightfractional candidates
37:
β←\|V\|−\|T1\|\\beta\\leftarrow\|V\|\-\|T\_\{1\}\|⊳\\trianglerightremaining budget fromTFT\_\{F\}
38:Compute
Ct⋆←∑\(p,s\):t∈Ep,scpzp,s⋆C^\{\\star\}\_\{t\}\\leftarrow\\sum\_\{\(p,s\):\\,t\\in E\_\{p,s\}\}c\_\{p\}\\,z^\{\\star\}\_\{p,s\}for each
t∈TFt\\in T\_\{F\}
39:return
T1∪top\-β\(TF,C⋅⋆\)T\_\{1\}\\cup\\mathrm\{top\}\\text\{\-\}\\beta\\,\(T\_\{F\},\\,C^\{\\star\}\_\{\\cdot\}\)⊳\\trianglerightcardinality\|V\|\|V\|by construction
40:endprocedure
## Appendix BContribution\-Based Weighted Rounding
We give the full rounding procedure summarized in[Section˜2\.6](https://arxiv.org/html/2607.23362#S2.SS6); it is ToaST’s rule applied to JOLT’s LP solution\(x⋆,z⋆\)\(x^\{\\star\},z^\{\\star\}\)\. LetV⊆TV\\subseteq Tdenote the vocabulary with desired size\|V\|\|V\|\. PartitionTTby the LP valuext⋆x\_\{t\}^\{\\star\}:
T1\\displaystyle T\_\{1\}=\{t∈T:xt⋆≥1−ϵ\},\\displaystyle=\\\{t\\in T:x\_\{t\}^\{\\star\}\\geq 1\-\\epsilon\\\},TF\\displaystyle T\_\{F\}=\{t∈T:ϵ<xt⋆<1−ϵ\},\\displaystyle=\\\{t\\in T:\\epsilon<x\_\{t\}^\{\\star\}<1\-\\epsilon\\\},T0\\displaystyle T\_\{0\}=\{t∈T:xt⋆≤ϵ\},\\displaystyle=\\\{t\\in T:x\_\{t\}^\{\\star\}\\leq\\epsilon\\\},withϵ=10−6\\epsilon=10^\{\-6\}\. Everyt∈T1t\\in T\_\{1\}is admitted intoVVoutright\. The budget still requiresβ=\|V\|−\|T1\|\\beta=\|V\|\-\|T\_\{1\}\|additional tokens, all drawn from the fractional tierTFT\_\{F\}\(tokens inT0T\_\{0\}are discarded\)\.
For each fractionalt∈TFt\\in T\_\{F\}, define the*objective contribution*
Ct⋆=∑p∈P∑s∈Sp∖\{ℱ\}:t∈Ep,scpzp,s⋆\.C^\{\\star\}\_\{t\}\\;=\\;\\sum\_\{p\\in P\}\\;\\sum\_\{s\\in S\_\{p\}\\setminus\\\{\\mathcal\{F\}\\\}\\,:\\,t\\in E\_\{p,s\}\}c\_\{p\}\\,z^\{\\star\}\_\{p,s\}\.\(16\)Ct⋆C^\{\\star\}\_\{t\}is the count\-weightedzz\-mass forttat the LP optimum: it measures how much of the relaxed objective is already “buying”ttvia the segmentations that depend on it\. RankTFT\_\{F\}in descending order ofCt⋆C^\{\\star\}\_\{t\}and take the topβ\\betatokens:
V=T1∪top\-β\(TF,C⋅⋆\)\.V\\;=\\;T\_\{1\}\\;\\cup\\;\\textrm\{top\-\}\\beta\\,\(T\_\{F\},\\,C^\{\\star\}\_\{\\cdot\}\)\.By construction, exactly\|V\|\|V\|tokens are selected\.
## Appendix CGPT4O\_REGEX\_16Pretokenization Pattern
We useGPT4O\_REGEX\_16as the fixed regex pretokenizer for all experiments\. This pattern is based on the publicly available GPT\-4o/o200k\_base\-styletiktokenregex pretokenizer, but with explicit length caps added for computational tractability\. The regex is used only to create the initial pretoken/count universe; the learned vocabulary is subsequently optimized by the LP/MIP formulation described in the main text\.
The pattern consists of seven alternatives: lower\-case\-dominant Unicode word spans with optional contractions, upper\-case\-dominant Unicode word spans with optional contractions, numeric chunks of length 1–3, punctuation/symbol runs, newline\-associated whitespace, trailing whitespace, and general whitespace\. The bounded version caps word\-like spans through 32\-character letter/mark groups and caps punctuation or whitespace runs at 16 characters\.
GPT4O\_REGEX\_PARTS\_16=\[
r"\[^\\r\\n\\p\{L\}\\p\{N\}\]?"
r"\[\\p\{Lu\}\\p\{Lt\}\\p\{Lm\}\\p\{Lo\}\\p\{M\}\]\{0,32\}"
r"\[\\p\{Ll\}\\p\{Lm\}\\p\{Lo\}\\p\{M\}\]\{1,32\}"
r"\(?i:'s\|'t\|'re\|'ve\|'m\|'ll\|'d\)?",
r"\[^\\r\\n\\p\{L\}\\p\{N\}\]?"
r"\[\\p\{Lu\}\\p\{Lt\}\\p\{Lm\}\\p\{Lo\}\\p\{M\}\]\{1,32\}"
r"\[\\p\{Ll\}\\p\{Lm\}\\p\{Lo\}\\p\{M\}\]\{0,32\}"
r"\(?i:'s\|'t\|'re\|'ve\|'m\|'ll\|'d\)?",
r"\\p\{N\}\{1,3\}",
r"?\[^\\s\\p\{L\}\\p\{N\}\]\{1,16\}\[\\r\\n/\]\{0,16\}",
r"\\s\{0,15\}\[\\r\\n\]\{1,16\}",
r"\\s\{1,16\}\(?\!\\S\)",
r"\\s\{1,16\}",
\]
GPT4O\_REGEX\_16="\|"\.join\(GPT4O\_REGEX\_PARTS\_16\)
Listing 1:Bounded GPT\-4o\-style regex pretokenizer used in our experiments\.In this work,GPT4O\_REGEX\_16should therefore be interpreted as a deterministic preprocessing rule, not as a tokenizer training objective or learned vocabulary\. Its role is to define stable pretoken boundaries before candidate segmentation generation, fallback escalation, and greedy\-L2R vocabulary optimization\.
## Appendix DGurobi Solver Setup and Reproducibility
All LP relaxations and MIP solves are run on a single host with Gurobi 11\.0\(Gurobi Optimization, LLC,[2026](https://arxiv.org/html/2607.23362#bib.bib19)\)\(academic license\), Python 3\.11, and the officialgurobipyPython bindings\. We give the exact solver configuration we used so that the experiments can be reproduced from the pretoken/count universe alone\.
#### Hardware\.
Runs are executed on single shared\-memory nodes \(one solve per node\) with at least 220 GB of RAM\. We do not cap Gurobi’s thread count, so it uses all available cores, between 18 and 30 threads across our runs; we do not pin threads or NUMA nodes\. No GPU is used\. The barrier factorization dominates memory: it peaks at roughly 10 GB for the largestN=100kN\{=\}100kLP \(32k, iter\-2/final\) and roughly 30 GB for the largestN=200kN\{=\}200kLP \(32k, iter\-2/final\), comfortably within the 220–230 GB memory limit we impose\.
#### Solver parameters\.
We solve the LP relaxation with Gurobi’s default LP method \(concurrent, which on our models selects barrier followed by crossover\) and default presolve and cut settings; we do not overrideMethod,Crossover,Presolve, orCuts\. We setMIPGap=0andConcurrentMIP=1\. For the final repricing round we rebuild the model with the updated fallback cost \(cost\(p,ℱ\)=np\\mathrm\{cost\}\(p,\\mathcal\{F\}\)\{=\}n\_\{p\}\), accept LP warm\-start hints from the previous round \(LPWarmStart=2\), and raiseNumericFocus=2for tighter numerics; the reported solve times in[Table˜2](https://arxiv.org/html/2607.23362#A5.T2)therefore include this warm start\.
#### Limits\.
We impose a per\-solve soft memory limit \(MemLimit\) of 220–230 GB and a generous wall\-clock limit \(up to4×1054\\times 10^\{5\}s for the largestN=200kN\{=\}200kconfiguration\)\. Neither limit is binding: every solve in[Table˜2](https://arxiv.org/html/2607.23362#A5.T2)reachesOPTIMALvia barrier, with factorization memory peaking near 30 GB\. Solve time, however, spans three orders of magnitude across configurations, from 420 s \(N=100kN\{=\}100k, 32k, iter\-1\) to 337,686\.7 s \(≈93\.8\{\\approx\}93\.8h;N=200kN\{=\}200k, 32k, final repricing round\), so theN=200kN\{=\}200kruns require multi\-day budgets while theN=100kN\{=\}100kruns finish within hours \(largest 32k final, 35,020\.9 s\)\. We log Gurobi’s final status, objective bound, simplex/barrier iteration counts, and final residuals after every solve\.
#### Determinism\.
We do not set a solver seed and leave Gurobi’s concurrent LP at its default, so the LP objective is reproducible only up to floating\-point summation order and solver concurrency \(these depend on host and thread count\)\. Given the LP solution, however, the rest of the pipeline is fully deterministic: contribution\-based rounding breaks ties inCt⋆C^\{\\star\}\_\{t\}lexicographically ontt, so the extracted vocabulary is uniquely determined by the \(fixed\) pretoken/count input and segmentation\-family construction order\.
## Appendix ECompute Time
VariablesConstraintsConfig\#xtx\_\{t\}\#\(zp,s\+zp,ℱ\)\(z\_\{p,s\}\{\+\}z\_\{p,\\mathcal\{F\}\}\)\#linking\#consist\.\#otherNumNZsSolve time32k, 100k, i\-1372,010758,7321,217,7702,415,746100,1558,397,774420\.2 s32k, 100k, i\-2491,3501,370,2513,052,3359,215,293100,15526,396,8575,123\.5 s32k, 100k, final491,3501,370,2513,052,3359,215,293100,15526,396,85735,020\.9 s64k, 100k, i\-1372,010758,7321,217,7702,415,746100,1558,397,774727\.6 s64k, 100k, i\-2412,236896,6481,631,5183,946,349100,15512,464,6182,039\.3 s64k, 100k, final412,236896,6481,631,5183,946,349100,15512,464,6186,287\.7 s32k, 200k, i\-1722,6761,586,1352,572,5795,169,227200,15517,792,4233,039\.1 s32k, 200k, i\-21,009,7103,530,8558,406,74726,816,605200,15574,987,26964,795\.3 s32k, 200k, final1,009,7103,530,8558,406,74726,816,605200,15574,987,269337,686\.7 s64k, 200k, i\-1722,6761,586,1352,572,5795,169,227200,15517,792,4232,591\.9 s64k, 200k, i\-2938,0982,655,1845,779,72617,407,409200,15549,967,55222,531\.3 s64k, 200k, final938,0982,655,1845,779,72617,407,409200,15549,967,55269,055\.7 sTable 2:LP problem\-size and solve\-time diagnostics for JOLT \(N=100kN\{=\}100kandN=200kN\{=\}200ktraining scopes\)\. \#xtx\_\{t\}: vocabulary\-selection variables; \#\(zp,s\+zp,ℱ\)\(z\_\{p,s\}\{\+\}z\_\{p,\\mathcal\{F\}\}\): segmentation plus fallback variables; \#consist\.: greedy\-consistency rows \([Equation˜13](https://arxiv.org/html/2607.23362#S2.E13)\)\. In the configuration column,iidenotes escalation iteration\.Detailed computational results are given in[Table˜2](https://arxiv.org/html/2607.23362#A5.T2)\. TheN=200kN\{=\}200kfull\-pipeline configuration \(full2→32\\\!\\to\\\!3escalation and a final repricing round\) is the most expensive among the full\-pipeline runs: end\-to\-end about113113hours of wall\-clock time at the 32k vocabulary budget and about2626hours at 64k, with the 32k final\-round LP alone taking 337,686\.7 s \(≈93\.8\{\\approx\}93\.8h\)\. The wall\-clock cost is dominated by the final\-round LP solve in[Table˜2](https://arxiv.org/html/2607.23362#A5.T2); the earlier rounds and the entire model\-build phase together contribute roughly one to two additional hours\. The cheaperN=100kN\{=\}100kvariant runs in approximately 11 hours at 32k and under 3 hours at 64k \(32k final\-round LP solve of 35,020\.9 s\), a∼10×\{\\sim\}10\\timesspeedup for only a∼2\.9×\{\\sim\}2\.9\\timessmaller constraint matrix\. Within each scope, cost also varies with how binding the budget is:\|V\|=64\|V\|\{=\}64k is cheaper than\|V\|=32\|V\|\{=\}32k because the LP is less fractional\.
## Appendix FFallback and Escalation Diagnostics
This section reports stage\-wise fallback diagnostics for all JOLT configurations \([Section˜2\.5](https://arxiv.org/html/2607.23362#S2.SS5)\)\. Each row gives the number of pretokens with LP mass onℱ\\mathcal\{F\}at or above thresholdθ=0\.01\\theta\{=\}0\.01, the count\-weighted fallback mass, and greedy\-L2R token totals on the training scopePPand validation holdoutPvalP\_\{\\mathrm\{val\}\}after contribution\-based rounding at that stage\. We report both fallback count and weighted mass by stage because they can move differently under repricing and rounding\.
ConfigStageFallbackTrain tokensonPPVal tokensonPvalP\_\{\\mathrm\{val\}\}CountWeighted%\|V\|=32k\|V\|\{=\}32kN=100kN\{=\}100kIter\-1 \(κp=2\\kappa\_\{p\}\{=\}2\)19,7129,387,0961\.014986,263,187370,921,284Iter\-2 \(κp=3\\kappa\_\{p\}\{=\}3\)9,7854,922,5760\.531985,967,502369,039,323Final repricing4,6054,967,8390\.536986,252,419368,576,235\|V\|=64k\|V\|\{=\}64kN=100kN\{=\}100kIter\-1 \(κp=2\\kappa\_\{p\}\{=\}2\)4,2141,252,3830\.135943,020,279354,762,017Iter\-2 \(κp=3\\kappa\_\{p\}\{=\}3\)438148,1630\.016942,586,891354,171,929Final repricing1,039480,5530\.052942,556,161354,108,243\|V\|=32k\|V\|\{=\}32kN=200kN\{=\}200kIter\-1 \(κp=2\\kappa\_\{p\}\{=\}2\)62,49614,968,9251\.5911,024,420,706369,466,239Iter\-2 \(κp=3\\kappa\_\{p\}\{=\}3\)34,3148,529,5930\.9071,024,042,423368,120,996Final repricing19,7729,225,4750\.9801,025,212,967367,886,014\|V\|=64k\|V\|\{=\}64kN=200kN\{=\}200kIter\-1 \(κp=2\\kappa\_\{p\}\{=\}2\)31,4944,910,1590\.522978,678,879352,409,163Iter\-2 \(κp=3\\kappa\_\{p\}\{=\}3\)12,9021,991,1090\.212978,390,997351,401,677Final repricing5,5002,190,0780\.233978,705,696351,064,086Table 3:Stage\-wise fallbacks for JOLT atN=100kN\{=\}100kandN=200kN\{=\}200ktraining scopes\. Greedy\-L2R token columns score the optimization scopePPand validation holdoutPvalP\_\{\\mathrm\{val\}\}, respectively\. The % column is the weighted fallback mass as a fraction of the full top\-NNpretoken count mass \(926\.2926\.2M atN=100kN\{=\}100k,940\.9940\.9M atN=200kN\{=\}200k\)\.Figure 4:Fallback diagnostics per escalation round for all four configurations \(\|V\|=32\|V\|\{=\}32k pink,\|V\|=64\|V\|\{=\}64k purple;N=100N\{=\}100k solid,N=200N\{=\}200k dashed\)\. Left: number of pretokens routed to the fallback \(log scale\)\. Right: weighted fallback mass as a percentage of the full top\-NNpretoken count mass \(cf\.[Table˜3](https://arxiv.org/html/2607.23362#A6.T3)\)\. The iter\-2 dip and slight final\-round rise in fallback count reflect the repricing solve \([Equation˜4](https://arxiv.org/html/2607.23362#S2.E4)\), while validation scores continue to track the declining fallback mass\.
## Appendix GToken Rank\-Frequency on the Validation Holdout
To test whether JOLT’s compression gains reshape the global vocabulary usage profile or arise from local segmentation choices, we plot log\-log token rank–frequency curves after greedy\-L2R decoding on the full validation holdoutPvalP\_\{\\mathrm\{val\}\}\([Section˜3\.1](https://arxiv.org/html/2607.23362#S3.SS1)\)\. Each curve ranks every token emitted onPvalP\_\{\\mathrm\{val\}\}by its count; BPE\-greedy uses a vocabulary trained on the full training holdout, and JOLT curves use the rounded vocabularies from ourN=100kN\{=\}100kand200k200koptimization scopes\.
At\|V\|=32\|V\|\{=\}32k \(left panel of[Figure˜5](https://arxiv.org/html/2607.23362#A7.F5)\), all three series overlap across ranks\. At\|V\|=64\|V\|\{=\}64k \(right panel\), the high\-frequency head remains aligned but the tails separate:N=200kN\{=\}200ktracks BPE\-greedy more closely in the rare\-token regime than the cheaperN=100kN\{=\}100kscope, consistent with its stronger validation margin in[Table˜1](https://arxiv.org/html/2607.23362#S4.T1)\. No series introduces a qualitatively different Zipf shape; the effect is a modest tail adjustment rather than a wholesale redistribution\.
Figure 5:Log\-log token rank\-frequency on the greedy\-L2R\-decoded validation setPvalP\_\{\\mathrm\{val\}\}for BPE\-greedy and JOLT \(N=100kN\{=\}100kand200k200koptimization scopes\), at both vocabulary budgets \(\|V\|=32\|V\|\{=\}32k, left;\|V\|=64\|V\|\{=\}64k, right\)\. Series overlap on the high\-frequency head; they diverge only in the low\-frequency tail at\|V\|=64\|V\|\{=\}64k\.
## Appendix HToken\-Length Distribution: BPE\-greedy vs\. JOLT
Beyond aggregate token\-count metrics, we compare the*token\-length distribution*each vocabulary induces under greedy\-L2R decoding onPvalP\_\{\\mathrm\{val\}\}\([Section˜4\.2](https://arxiv.org/html/2607.23362#S4.SS2)\), because local shifts in emitted token lengths can accompany even small changes in total count\.[Figure˜6](https://arxiv.org/html/2607.23362#A8.F6)reports count\-weighted shares of output tokens by byte length, for both vocabulary budgets and the two full\-pipeline scopes \(N=100kN\{=\}100kandN=200kN\{=\}200k\)\. BPE\-greedy uses a vocabulary trained on the full training holdout; relative to it, JOLT shifts a modest amount of count\-weighted mass toward length\-1 tokens \(by≈0\.9\{\\approx\}0\.9percentage points at\|V\|=32\|V\|\{=\}32k and≈1\.2\{\\approx\}1\.2at\|V\|=64\|V\|\{=\}64k for the top\-100100K scope\), while every other length stays within about11percentage point\. This counter\-intuitive increase in single\-byte token usage is a consequence of the greedy\-consistency constraints: GL2R can emit a long token at positioniionly if no longer vocabulary token starts atii, so JOLT sometimes retains short \(including single\-byte\) tokens precisely to*suppress*competing prefixes and allow a longer match a few bytes later, a trade that reduces total token count even though it raises the single\-byte share\. Enlarging JOLT’s optimization scope from100k100kto200k200kpretokens shifts mass slightly away from length\-2 tokens \(a relative drop of∼2%\{\\sim\}2\\%at\|V\|=32\|V\|\{=\}32k and∼7%\{\\sim\}7\\%at\|V\|=64\|V\|\{=\}64k\) and into the length\-3–4 range, consistent with the LP using its larger budget on a longer pretoken tail\. The shift is modest relative to BPE\-greedy, complementing the token\-count margins in[Table˜1](https://arxiv.org/html/2607.23362#S4.T1)\.
Figure 6:Greedy\-L2R token\-length distribution onPvalP\_\{\\mathrm\{val\}\}\(count\-weighted\) for BPE\-greedy and JOLT atN=100kN\{=\}100kand200k200k, at both vocabulary budgets\.
## Appendix IExtended\-Scope Protocol
#### Round\-2\-only reporting in[Table˜4](https://arxiv.org/html/2607.23362#A10.T4)\.
ForN=300N\{=\}300k andN=400N\{=\}400k we report the raw Gurobi iter\-2 LP relaxation objective \(fallback cost33\) and the true greedy\-L2R token count onPPfrom the iter\-2 vocabulary\. The LP objective is reported as\-is: substituting the true byte\-level costnpn\_\{p\}for fallback cost33in the saved solutionz⋆z^\{\\star\}would break the relaxation lower bound—z⋆z^\{\\star\}was optimized under cost33—and can inflate gap\-closed above100%100\\%\.
#### What the skipped final repricing round would change\.
In iter\-2 the fallback cost iscost\(p,ℱ\)=κp\+1=3\\mathrm\{cost\}\(p,\\mathcal\{F\}\)=\\kappa\_\{p\}\{\+\}1\{=\}3for every remaining fallback pretoken, regardless of byte lengthnpn\_\{p\}\([Equation˜4](https://arxiv.org/html/2607.23362#S2.E4)\)\. The full pipeline’s final repricing round rebuilds the model withcost\(p,ℱ\)=np\\mathrm\{cost\}\(p,\\mathcal\{F\}\)=n\_\{p\}, re\-solves, and may add whole\-word tokens for long rare pretokens\. To see why this matters for validation, considerĠlipopolysaccharide\(np=19n\_\{p\}\{=\}19bytes\): in iter\-2 it is charged only33tokens if it falls back, far below its true cost of1919bytes, so Gurobi has no incentive to cover it\. The full pipeline corrects this in the final repricing LP, addingĠlipopolysaccharide,Ġcerebrovascular, and similar rare but long pretokens as whole tokens, improving validation scores by approximately0\.460\.46M tokens at\|V\|=32\|V\|\{=\}32k/N=100N\{=\}100k; the round\-2\-only protocol trades this refinement for the ability to optimize over a much larger pretoken scope\.
#### Sanity check\.
Because the full pipeline remains affordable atN=100N\{=\}100k andN=200N\{=\}200k but not atN=300N\{=\}300k/400400k, we validate the round\-2\-only protocol on the smaller scopes before trusting it at scale\. We extract the iter\-2 vocabulary and rounded greedy\-L2R count onPPfrom saved checkpoints for theN=100N\{=\}100k andN=200N\{=\}200k runs and compare against their full\-pipeline values\. Iter\-2 rounded objectives agree with full\-pipeline rounded objectives to within0\.03%0\.03\\%across all four full\-run configurations; validation token counts differ by at most≈0\.5\{\\approx\}0\.5M tokens\. This close agreement gives us confidence that the round\-2\-only numbers atN=300N\{=\}300k andN=400N\{=\}400k are comparable to the full\-pipeline results\.
## Appendix JLP Bound and Rounding Diagnostics \(All Training Scopes\)
[Table˜4](https://arxiv.org/html/2607.23362#A10.T4)reports the LP relaxation objective and the greedy\-L2R token count from contribution\-based rounding on the JOLT optimization scopePPfor all configurations\. For the full\-pipeline runs \(N∈\{100k,200k\}N\\in\\\{100\\text\{k\},200\\text\{k\}\\\}\) the LP objective is the final\-round bound with conservative byte\-level fallback cost, and is a valid lower bound on achievable GL2R token count under our formulation\. For the round\-2\-only runs \(N∈\{300k,400k\}N\\in\\\{300\\text\{k\},400\\text\{k\}\\\}\) the LP column is the raw Gurobi iter\-2 relaxation objective \(fallback cost33\); the rounded column is the true greedy\-L2R count onPPwith the iter\-2 vocabulary \([appendix˜I](https://arxiv.org/html/2607.23362#A9)\)\. These rows close75\.275\.2–86\.5%86\.5\\%of the BPE\-greedy\-to\-iter\-2\-LP slack—informative, but not equivalent to the final\-round certificate above\.
ConfigLPobj\. \(M\)Roundedobj\. \(M\)Roundgap %BPE\-greedyonPP\(M\)Gapclosed %Full pipeline \(final repricing LP; valid lower bound\)\|V\|=32k\|V\|\{=\}32k,N=100kN\{=\}100k984\.5986\.3\+0\.176\+0\.1761,001\.289\.6\|V\|=64k\|V\|\{=\}64k,N=100kN\{=\}100k942\.5942\.6\+0\.008\+0\.008955\.199\.4\|V\|=32k\|V\|\{=\}32k,N=200kN\{=\}200k1,025\.11,025\.2\+0\.008\+0\.0081,037\.499\.4\|V\|=64k\|V\|\{=\}64k,N=200kN\{=\}200k978\.0978\.7\+0\.070\+0\.070988\.093\.1Round\-2\-only \(raw iter\-2 LP†\)\|V\|=32k\|V\|\{=\}32k,N=300kN\{=\}300k1,036\.61,040\.7\+0\.398\+0\.3981,053\.375\.2\|V\|=64k\|V\|\{=\}64k,N=300kN\{=\}300k992\.3993\.7\+0\.138\+0\.1381,002\.586\.5\|V\|=64k\|V\|\{=\}64k,N=400kN\{=\}400k1,001\.11,002\.7\+0\.163\+0\.1631,011\.183\.8\|V\|=32k\|V\|\{=\}32k,N=400kN\{=\}400k1,046\.01,050\.6\+0\.439\+0\.4391,062\.872\.5Table 4:LP bound vs\. rounded greedy\-L2R token count on the JOLT training scopePPfor all configurations\. Round gap is100×\(rounded−LP\)/rounded100\\times\(\\text\{rounded\}\-\\text\{LP\}\)/\\text\{rounded\}\. BPE\-greedy uses the same\|V\|\|V\|and GL2R decoding onPP\(vocabulary trained on the full training holdout\)\. Gap closed is100×\(BPE\-greedy−rounded\)/\(BPE\-greedy−LP\)100\\times\(\\text\{BPE\-greedy\}\-\\text\{rounded\}\)/\(\\text\{BPE\-greedy\}\-\\text\{LP\}\)\.†Round\-2\-only: iter\-2 Gurobi LP objective \(fallback cost33\); rounded is greedy\-L2R onPPwith the iter\-2 vocabulary\. Skipping final repricing leaves fallback costs understated relative to the full pipeline \([Sections˜3\.3](https://arxiv.org/html/2607.23362#S3.SS3)and[I](https://arxiv.org/html/2607.23362#A9)\), but the raw objective remains a valid relaxation lower bound under the iter\-2 formulation\.Similar Articles
Finding Optimal Tokenizers
This blog post presents an algorithm using integer linear programming to compute optimal tokenizers for language models, drawing parallels to solving the Traveling Salesman Problem. It notes that while the result is theoretically interesting, practical tokenizers are already near-optimal and the method may not generalize well.
Incremental BPE Tokenization
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.
Compute Optimal Tokenization (2 minute read)
This paper systematically derives compression-aware neural scaling laws by training nearly 1,300 models, demonstrating that the widely used heuristic of 20 tokens per parameter is an artifact of specific tokenizers. The authors propose a tokenizer-agnostic scaling law based on bytes, offering a new framework for compute-efficient training across diverse languages and modalities.
Breaking Safety at the Token Boundary: How BPE Tokenization Creates Exploitable Gaps in LLM Alignment
This paper identifies that BPE tokenization fragments safety-critical words into subword pieces, creating exploitable gaps in LLM alignment. Character-level perturbations can bypass safety by disrupting token boundaries, achieving 80-100% refusal flip on HarmBench prompts with 48% harmful outputs across five model families.
Writing-System-Level Tokenizer Adaptation for Byte-Level BPE
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.