Tokenisation over Bounded Alphabets is Hard
This paper proves that tokenisation over bounded alphabets, including binary and unary cases, is fundamentally NP-complete and APX-hard, establishing that its computational intractability is an inherent barrier rather than an artifact of large input alphabets and explaining the necessity of heuristic approaches in current practical algorithms.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to send a secret message to a friend, but the only way to send it is by breaking your words into tiny, pre-approved chunks. If you send "superduper," you might have to break it into "super" and "duper" instead of the whole word, because your friend's dictionary only has those two pieces. This is the heart of tokenization, the first step in teaching computers to understand human language. Before a computer can read a sentence, it must chop it up into these manageable "tokens" (like Lego bricks). The goal is to chop the text up in a way that uses the fewest bricks possible, making the message shorter and faster to send. This is called compression. If you can compress a book into fewer bricks, the computer can read it faster and learn from it more efficiently. For years, scientists have been building clever, greedy algorithms—like a child grabbing the biggest available Lego piece they can find—to do this chopping automatically. But a big question has lingered: Is there a perfect, mathematically optimal way to chop any text, or are we stuck with "good enough" guesses?
This paper, titled "Tokenisation Over Bounded Alphabets Is Hard," dives into the deep end of that question. The authors, a team of researchers from ETH Zürich and Sofia University, set out to prove whether finding that perfect chopping method is actually a nightmare for computers, even when the rules are simple. They focus on two main ways of chopping: Direct Tokenisation, where you pick the best set of Lego bricks (a vocabulary) all at once, and Bottom-Up Tokenisation, where you start with single letters and keep gluing pairs together until you run out of glue (merges). The big twist in their story is that they test these methods not on the infinite, chaotic alphabet of all possible human sounds, but on the tiny, fixed sets we actually use in computers: binary (just 0s and 1s, like a light switch) and unary (just one single symbol, like a string of identical beads).
The paper's main finding is a resounding "No, you cannot easily find the perfect solution." The authors prove that even with the simplest possible alphabets—like a world made only of zeros and ones—finding the optimal way to compress text is NP-complete and APX-hard. In plain English, this means that no matter how much computing power you throw at the problem, there is no fast, efficient algorithm that can guarantee the best possible result. It's not just that the problem is hard; it's that it's fundamentally hard. The paper explicitly rules out the idea that the difficulty comes from the complexity of human language or huge alphabets. Instead, they show that the barrier exists even in the simplest, most restricted scenarios. Furthermore, they prove that you can't even get "close enough" to the perfect answer in a reasonable amount of time; there is no polynomial-time approximation scheme (PTAS) that can get arbitrarily close to the best solution unless a major mathematical mystery (P = NP) is solved.
The researchers also tackle the unary case, where the alphabet has only one symbol (think of a message made entirely of the letter "a"). You might think, "If I only have one letter, how hard can it be?" Surprisingly, they prove that even here, finding the optimal way to chop the text is strongly NP-complete. This is a heavy mathematical result suggesting that the difficulty isn't just a quirk of large data sets; it's baked into the very logic of trying to compress text optimally.
So, what does this mean for the future? The paper doesn't offer a new, magical algorithm to solve the problem. Instead, it explains why the tools we use today, like BPE (Byte-Pair Encoding) and UnigramLM, are forced to be heuristic—meaning they use clever shortcuts and guesses rather than calculating the perfect answer. The authors argue that because the perfect answer is computationally impossible to find quickly, researchers should stop chasing the "holy grail" of the optimal tokeniser and instead focus on building better, provably good approximation methods. The door to perfection is locked, and the key doesn't exist; the best we can do is learn to pick the best lock-pick we have.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.