GreedTok Is a 0.3287-Approximation, and Greedy Tokenizers Lose Order on Fixed Alphabets
Abstract
A tokenizer's vocabulary is built once and used on every input, so it matters how much compression a greedy construction can lose. We study two greedy constructions: GreedTok (Lim et al., 2025), which adds the string that saves the most tokens, and byte-pair encoding (BPE), which merges a most frequent adjacent pair. We prove that GreedTok saves at least of the optimal number of tokens saved on every corpus, while no constant above is possible. The key idea is that, given the order of greedy's choices, the damage inside an optimal token is fixed by two numbers. On a fixed alphabet both algorithms are asymptotically optimal and their worst deficit with budget has order : one counting argument gives the upper bound for both, and one binary corpus, whose first greedy commitment erases a boundary between optimal tokens, gives the matching lower bound for both (for GreedTok, on its committed segmentation), even if greedy's continuation may use almost twice the budget. For BPE on one binary string, a forced first merge can cost final tokens, yet rules always repair it.
Create a lesson
Metadata
- Comments
- 69 pages, 6 figures, 7 tables. v2 adds fixed-alphabet results for GreedTok and greedy BPE (deficit of order 1/log k, tight), a binary-string repair theorem for BPE, and an EPTAS for fixed alphabets; the 0.3287 bound is unchanged. Code and checkers: https://doi.org/10.5281/zenodo.24451478
Related papers
Improved Approximation Algorithms for Multi-Path TSP and Ordered TSP
Shared title terminologycs.DSMorteza Alimi, Michael Ruderer
Tokenization: Hardness and Bicriteria Approximation Algorithms
Shared title terminologycs.DSAtieh Bastan, Xiaoling He, A. Pavan et al.
Greedy+Singleton for knapsack-constrained monotone submodular maximization has approximation ratio exactly β^\star ≈ 0.42944
Shared title terminologycs.DSKundan Baliga, Aiden Xie, Aditya Byju
Greedy BPE with Replacement Counts Achieves the Tight Approximation Ratio (1-e^{-2})/2
Shared title terminologycs.DSKundan Baliga, Aiden Xie, Aditya Byju
An Order-Optimal Square-Root Bound for Online Maximin Share Allocation with Known Types
Shared title terminologycs.DSZheyu Zhou
First-Order Entropic Sampling of Words with Prescribed Letter Counts in Linear Time
Shared title terminologycs.DSOlivier Bodini, Francis Durand