Tokenization: Hardness and Bicriteria Approximation Algorithms

Atieh Bastan, Xiaoling He, A. Pavan, N. V. Vinodchandran
11/11/2026
cs.DScs.AIcs.CC

No confident code implementation found for this paper.

Abstract

We study Binary Tokenization: given a corpus of binary strings over $\{0,1\}$ and a vocabulary budget $K$, select at most $K$ substrings (called vocabulary) to minimize the total number of tokens needed to represent the corpus. The primitive symbols $0$ and $1$ are always available, and each document must be segmented separately.

Show full abstract

Letting $n$ denote the total corpus length and $M$ for the maximum document length, we prove that, for every fixed $\varepsilon\in(0,1)$, Binary Tokenization problem does not have polynomial-time $n^{1-\varepsilon}$-approximation algorithms unless $\mathsf{P}=\mathsf{NP}$. To complement the hardness result, we give a polynomial-time $(γ,γ)$-bicriteria algorithm, with $γ= \sqrt{M}\log n$: The algorithm outputs a vocabulary of size at most $γK$ with number of tokens at most $γ{\rm OPT}_K$, where ${\rm OPT}_K$ is the optimal number of tokens under the original budget $K$. We also study a storage-budget variant, in which the sum of the selected substrings' lengths is bounded by $B$. For $2\le B<n$, we obtain an $(O(\log n\log B),O(\log n\log B))$-bicriteria approximation algorithm.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{bastan2026tokenization,
  title  = {Tokenization: Hardness and Bicriteria Approximation Algorithms},
  author = {Atieh Bastan and Xiaoling He and A. Pavan and N. V. Vinodchandran},
  year   = {2026},
  eprint = {2611.15074},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.15074v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.15074.svg)](https://codeofpaper.com/paper/2611.15074)

Discussion