Tokenisation problems cannot be efficiently approximated by any algorithm
Tokenisation is not in APX
Computation and LanguageMachine Learning
Summary
This paper shows that finding the best way to split sequences into tokens is very hard for computers to do quickly and accurately. The authors prove that no fast algorithm can come close to the best solution by any fixed factor unless a major breakthrough happens in computer science. They show this applies to different tokenising methods and types of data, even very simple ones. This means we should not expect efficient algorithms that reliably get near-optimal tokenisation.
What this means in practice
- •For software engineers: Avoid seeking fast algorithms that guarantee near-optimal tokenisation in compression and language tasks due to proven hardness limits.
- •For algorithm designers: Focus on heuristic or approximate methods without performance guarantees for tokenisation problems as exact or closely approximate solutions are infeasible.
A theory result. No direct application yet.
Authors
Violeta Kastreva, Philip Whittington, Dennis Komm, Tiago Pimentel
Abstract
In this paper, we prove that, unless P=NP, no polynomial-time algorithm can find a tokeniser whose objective is within any constant factor of the optimum, meaning that tokenisation is not in the APX complexity class. We prove this for direct and bottom-up tokenisation, under both a compression or unigram log-likelihood objectives, and for binary or larger alphabets. We further show that, even over unary alphabets, direct tokenisation is APX-hard, and thus admits no polynomial-time approximation scheme.