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 $0.3287$ of the optimal number of tokens saved on every corpus, while no constant above $0.33862$ 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 $k$ has order $1/\log k$: 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 $Ω(k)$ final tokens, yet $2k+3$ rules always repair it.
翻译:暂无翻译