Lune

Abstract

Recent works have shown that tokenisation is NP-complete. However, these works assume tokenisation is applied to inputs with unboundedly large alphabets-an unrealistic assumption, given that in practice tokenisers operate over fixed-size alphabets, such as bytes or Unicode characters. We close this gap by analysing tokenisation over bounded n-ary alphabets, considering two natural variants: bottom-up tokenisation and direct tokenisation, where we must, respectively, select a sequence of merge operations or a vocabulary whose application optimally compresses a dataset. First, we note that proving hardness results for an n-ary alphabet proves the same results for alphabets of any larger size. We then prove that even with binary alphabets, both variants are not only NP-complete, but admit no polynomial-time approximation scheme (unless P = NP). We further show that direct tokenisation remains NP-complete even when applied to unary alphabets. While unary alphabets may not be practically useful, this result establishes that the computational intractability of tokenisation is not an artifact of large alphabets or complex constructions, but a fundamental barrier. Overall, our results explain why practical algorithms such as BPE and UnigramLM are heuristic, and points toward approximation algorithms being an important path going forward for tokenisation research.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • A Partition Cover Approach to Tokenization cites Unpacking Tokenization: Evaluating Text Compression and its Correlation with Model Performance
  • Tokenization Is More Than Compression cites Unpacking Tokenization: Evaluating Text Compression and its Correlation with Model Performance
  • Unpacking Tokenization: Evaluating Text Compression and its Correlation with Model Performance cites How Good is Your Tokenizer? On the Monolingual Performance of Multilingual Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on5

  1. Finding the Optimal Vocabulary Size for Neural Machine TranslationThamme Gowda, Jonathan MayEMNLP Findings 2020 · 44 citations
  2. Tokenization Is More Than CompressionCraig W. Schmidt, Varshini Reddy, Haoran Zhang, Alec Alameddine et al.EMNLP 2024 · 16 citations
  3. Unpacking Tokenization: Evaluating Text Compression and its Correlation with Model PerformanceOmer Goldman, Avi Caciularu, Matan Eyal, Kris Cao et al.ACL Findings 2024 · 12 citations
  4. A Partition Cover Approach to TokenizationJia Peng Lim, Shawn Tan, Davin Choo, Hady W. LauwNeurIPS 2025 · 6 citations
  5. How Good is Your Tokenizer? On the Monolingual Performance of Multilingual Language ModelsPhillip Rust, Jonas Pfeiffer, Ivan Vulic, Sebastian Ruder et al.ACL 2021

Related papers

  1. Tokenisation is NP-CompletePhilip Whittington, Gregor Bachmann, Tiago PimentelACL 2025 · 6 citations
  2. Improving Tokenisation by Alternative Treatment of SpacesEdward Gow-Smith, Harish Tayyar Madabushi, Carolina Scarton, Aline VillavicencioEMNLP 2022 · 6 citations
  3. Multilingual Tokenization through the Lens of Indian Languages: Challenges and InsightsMaharaj Brahma, Karthika NJ, Rajat Verma, Nagasai Saketh Naidu et al.ACL Findings 2026
  4. Parity-Aware Byte-Pair Encoding: Improving Cross-lingual Fairness in TokenizationNegar Foroutan, Clara Meister, Debjit Paul, Joel Niklaus et al.ACL 2026 · 14 citations
  5. Which Pieces Does Unigram Tokenization Really Need?Sander Land, Yuval PinterACL Findings 2026
Dusk over the sea between two cliffs drawn in fine vertical lines