Imagine you're packing a moving truck. You have hundreds of oddly shaped boxes and one truck. Finding the absolute best packing is hard—that's NP-hard, old news. But what if someone told you that no fast algorithm can even get you within, say, twice the best possible packing? That you can't even guarantee a truck that's half-efficiently packed? That's the difference between NP-hard and not-in-APX, and that's what this paper proves about tokenization. The committed claim: unless P=NP, no polynomial-time algorithm can find a tokenizer whose compression or unigram log-likelihood objective is within ANY constant factor of the optimum. Tokenization—the step that chops raw text into the subword units that every modern language model consumes—is not merely hard to solve exactly. It is hard to approximate. The authors prove this for both direct tokenization (choosing a vocabulary from scratch) and bottom-up tokenization (the merge-based approach used by BPE and friends), under both compression and unigram objectives, for binary or larger alphabets. Even over a unary alphabet (just one character!), direct tokenization remains APX-hard, meaning no polynomial-time approximation scheme exists. The proof technique is a reduction from Maximum Independent Set, one of the canonical hard-to-approximate problems in complexity theory. The authors construct gadget strings that encode graph structure so that finding a good tokenizer vocabulary is equivalent to finding a large independent set—a problem known to be inapproximable within n^(1−ε) for any ε>0. The reduction is clean and the result is strong: it doesn't just say 'this is hard,' it says 'this is hard even if you relax your standards arbitrarily.' What makes this matter beyond theory is the gap between practice and provable guarantees. BPE, the workhorse tokenizer behind GPT, Llama, and virtually every production LLM, is a greedy heuristic. Unigram LM tokenization (used in SentencePiece) uses an EM-like procedure. Neither has approximation guarantees, and this paper says: they can't. No polynomial algorithm can. The heuristics we use aren't lazy shortcuts—they're the only game in town, and there's no principled way to know how far from optimal they land. The scope is carefully bounded. The hardness results apply to the combinatorial optimization problem of choosing a vocabulary given a corpus and a size budget. They do not directly address whether the objectives themselves (compression, unigram log-likelihood) are the right objectives for downstream LLM performance—that's a separate, empirical question. But the paper forecloses the possibility that someone will come along with a clever algorithm and 'solve' tokenization in a principled, approximation-guaranteed way. For practitioners, the implication is clarifying rather than alarming. BPE works well enough empirically, and this result explains why: there's no better polynomial-time alternative to compare it against. The result also quietly validates the growing interest in tokenizer-free or character-level models—if the tokenization step is provably intractable to optimize, maybe the right move is to sidestep it entirely. The paper is a clean piece of computational complexity work applied to a problem the ML community mostly treats as an engineering detail. It won't change anyone's training pipeline tomorrow, but it draws a hard line under a question that was previously open: can we do better than greedy heuristics for tokenization? The answer is no, not in any provable sense.
The analogy
Imagine packing a moving truck: NP-hard means you can't find the perfect packing fast. This paper proves something worse—no fast algorithm can even guarantee you a packing within any fixed multiple of the best one. You're not just far from perfect; you can't even promise 'pretty good.'
Truck packing
No fast algorithm guarantees even a constant-factor approximation to the densest possible arrangement of irregular boxes
Tokenizer search
No polynomial-time algorithm guarantees even a constant-factor approximation to the optimal vocabulary under compression or unigram objectives
Honest assessment
A clean, significant complexity result that moves tokenization hardness from NP-hard to inapproximable—a genuine category upgrade. It won't change anyone's pipeline tomorrow, but it closes a theoretical door permanently and subtly strengthens the case for tokenizer-free architectures. Most useful to researchers designing next-generation LLM preprocessing, and to anyone who wondered whether a clever algorithm could 'solve' BPE's limitations.
What Is CLAIMS?
73
/ 100
BedrockNews applies a structured analytical framework called CLAIMS to academic papers and technical research releases.
How CLAIMS worksClaim
4/5
Ladder
4/5
Architecture
4/5
Integrity
5/5
Milestone
2/5
Successor
3/5
What is this paper actually committing to?
Strong impossibility result. Moves tokenization from NP-hard (exact) to not-in-APX (inapproximable), covering direct, bottom-up, compression, unigram, and unary variants. A genuine step past prior hardness results.
The field fight
Is tokenization a solved engineering problem or a theoretically broken bottleneck that should be eliminated?
Side A
BPE and Unigram work well enough in practice; tokenization is a commodity preprocessing step
Held by: GPT, Llama, most production LLM pipelines
Side B
Tokenization is an unprincipled hack with no guarantees; character-level or byte-level models should replace it
Held by: ByT5, MegaByte, CANINE, this paper
Milestone tracker
Unlocks: Understanding how far practical tokenizers actually land from optimal, even without guarantees
Current
not-in-APX
complexity class
this paper
Next
O(1)
empirical approx ratio
BPE gap measurement
Unknown — requires large-scale empirical study on real corpora
Verified Facts (6)
Tokenisation is not in the APX complexity class unless P=NP
Results hold for direct and bottom-up tokenisation under compression and unigram log-likelihood objectives
Results hold for binary or larger alphabets
Direct tokenisation is APX-hard even over unary alphabets
No polynomial-time approximation scheme exists for direct tokenisation over unary alphabets
Reduction is from Maximum Independent Set
Practical Implications (4)
No future polynomial-time tokenizer can claim provable constant-factor approximation guarantees under compression or unigram objectives—stop looking for one.
BPE and Unigram LM heuristics are not lazy; they're the best class of approach available, and their empirical success is not contradicted by this result.
Strengthens the theoretical motivation for tokenizer-free or byte-level models (ByT5, MegaByte) as a way to sidestep an inherently intractable preprocessing step.
If you're designing a new tokenization objective, this paper's proof technique tells you which objective families will inherit inapproximability and which might escape it.
More latest news
Read all