Greedy BPE with Replacement Counts Achieves the Tight Approximation Ratio
Abstract
Byte-Pair Encoding (BPE) builds the tokenisers of many language models by repeatedly merging a most frequent adjacent pair of symbols. Kozma and Voderholzer showed that greedy merges save, in the worst case, between and of what the best merges save, and asked for the exact constant. We resolve this question for the replacement-count rule they analyse. For every string and weighted word table, every budget , and every tie-breaking rule, greedy saves at least of the optimum. This establishes the exact worst-case approximation ratio , approached as but never attained. The proof is based on a shadow inequality: after greedy steps, the optimum is at most , where is greedy's saving so far and its next gain. We also show that the worst-case ratio at budget exceeds the limiting constant by . For the overlapping-count rule used by deployed trainers, we prove a lower bound greater than and an asymptotic upper bound of approximately ; determining its exact constant remains open.
Create a lesson
Metadata
- Categories
- cs.DS, cs.CL
- Comments
- 58 pages. v3 supersedes v2 (0.391 bound), establishing the exact worst-case approximation ratio for replacement-count BPE, a finite-budget convergence result, and bounds for overlapping-count BPE. Code and certificates: https://doi.org/10.5281/zenodo.24451469
Related papers
Greedy+Singleton for knapsack-constrained monotone submodular maximization has approximation ratio exactly β^\star ≈ 0.42944
Shared title terminologycs.DSKundan Baliga, Aiden Xie, Aditya Byju
Tight Query Depth of Recursive Randomized Greedy MIS
Shared title terminologycs.DSSlobodan Mitrović, Wen-Horng Sheu
Tight Cycle-Cover Inequalities and Improved Approximation for Shortest Common Superstring with Reverse Complements
Shared title terminologycs.DSRyosuke Yamano, Tetsuo Shibuya
The Approximation Ratio of k-means++ Is 2\ln k+O(1)
Shared title terminologycs.DSAravind Reddy
GreedTok Is a 0.3287-Approximation, and Greedy Tokenizers Lose Order 1/\log k on Fixed Alphabets
Shared title terminologycs.DSKundan Baliga, Aiden Xie, Aditya Byju
Tight Analysis for Online Generalized Network Design with Power Functions
Shared title terminologycs.DSKarl Li, Yanzhi Li, Viswanath Nagarajan