Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Tokenization: Hardness and Bicriteria Approximation Algorithms

Binary tokenization has no polynomial-time approximation unless P equals NP

  • Problem Earlier hardness results for choosing a tokenizer vocabulary ruled out only constant-factor approximations. Compression guarantees don't carry over to the remaining token count.
  • Method The authors encode Vertex Cover as a binary corpus, so a small vocabulary must match a small cover. A token count below R would then decide Vertex Cover.
  • Results The authors prove that no deterministic polynomial-time algorithm keeps the token count within n^(1-ε) of the optimum for any fixed ε in (0, 1) unless P = NP.

Why the vocabulary choice is hard to approximate

Tokenization splits each document into units drawn from a vocabulary, and that vocabulary shapes both sequence length and model size. A longer or more specialized entry shortens sequences, but it also enlarges the embedding and output layers. The design question is which substrings to keep under a vocabulary budget K so that the corpus needs as few tokens as possible.

Once a vocabulary is fixed, segmenting each document is easy, but the choice itself couples every document in the corpus. Overlapping candidate substrings compete for the same positions, so raw frequency doesn't tell you how much an entry is worth.

Earlier complexity work showed that the decision versions are NP-complete and that APX-hardness holds even over a binary alphabet. Those results rule out polynomial-time approximation schemes unless P = NP, but they stop at constant factors. The strongest earlier bound rules out approximation ratios below c = 1.000002 unless P = NP. Compression-savings guarantees don't carry over, because they don't imply multiplicative approximations for the remaining token count.

The authors instead show that no deterministic polynomial-time algorithm can keep the token count within n^(1−ε) of the optimum, for any fixed ε in (0, 1), unless P = NP. The proof starts from a nontrivial Vertex Cover instance and runs the assumed algorithm at budget K = 3m + Φ. It then checks the token count with PathPiece, which returns the optimal segmentation for a given vocabulary.

Where the earlier bound rules out a ratio of 1.000002, this bound rules out a ratio of n^(1−ε), which grows with the corpus. Because the gap grows with n, a YES instance would need a token count below R, which the NO case rules out.

The paper pairs this hardness with bicriteria algorithms that allow more vocabulary entries in exchange for a bounded token count. Its cardinality algorithm uses at most γK entries and at most γOPT_K tokens, with γ = O(√(M log n)). The authors also note that a 1/log n approximation is easy, by taking the top K tokens by frequency.

From Vertex Cover to a binary tokenization instance

The hardness proof encodes Vertex Cover as a corpus, so that a small vocabulary is forced to match a small cover. The route goes through Word Factorization, whose goal is the smallest generating set for a set of words. Each vertex gets a singleton letter, and each edge e = (u_e, v_e) gets three private letters c_e, λ_e and ρ_e. Each edge then contributes the four words {u_e c_e v_e, u_e c_e ρ_e, λ_e c_e v_e, λ_e c_e ρ_e}, and the source corpus is their union.

Lemma 3.1 gives rk(X_G) = 3m + τ(G), so a vertex cover of size Φ corresponds to a rank budget B = 3m + Φ. The rank bound is the bridge: τ(G) ≤ Φ implies rk(X_G) ≤ B, and τ(G) > Φ implies rk(X_G) > B.

Each letter is turned into binary blocks, and each block is kept whole so the tokenizer never splits a letter's code. To guarantee that some copy of each letter sits on aligned boundaries, every letter is repeated R times, with R = pq, q = ⌈4/ε⌉ and p = N + 2q + 10. Each pair of a letter and a phase receives a distinct b-bit label, with b = max(1, ⌈log2(|A|·R)⌉), and a block of length l = 2b + 3.

Concatenating the blocks of each word gives a corpus of 4m distinct documents, each of length 3Rl, with total length n = 12mRl.

Proposition 3.2 links this corpus to the rank: when rk(X_G) is at most B, the encoded corpus admits a vocabulary with OPT_K(D_R) ≤ 8m. When rk(X_G) exceeds B, every vocabulary of size at most K needs at least R + 4m tokens. The gap between 8m and R + 4m is what the argument exploits, because R grows with q and therefore with 1/ε. A hypothetical approximation at budget K = 3m + Φ would push the YES-case token count below R, while NO instances force at least R + 4m tokens.

Testing whether the token count is below R would then decide Vertex Cover in polynomial time, which is impossible unless P = NP.

Bundles, greedy cover and chunk vocabulary

The algorithm picks its vocabulary by pricing each candidate word's disjoint occurrences as one bundle. A bundle for word w is a nonempty set of pairwise disjoint occurrences, with cost λ plus one unit per occurrence it contains. Its density is the number of newly uncovered positions it gains divided by its cost, so a word covering many positions cheaply scores high.

Singletons cost 1 and have density 1, so a bundle is taken only when its density exceeds 1. Each iteration runs this search for every candidate word, takes the densest bundle, and removes its newly covered positions from U.

For a fixed word, the algorithm sorts its occurrences by start position and computes the best gain for exactly j disjoint occurrences. The recurrence F_w(i, j) = max{F_w(i−1, j), g_i + F_w(p_i, j−1)} either skips occurrence I_i or takes it and fills the remaining j−1 slots among the first p_i occurrences. Here g_i = |U ∩ I_i| counts the still uncovered positions in I_i, and p_i marks the last earlier occurrence that doesn't overlap I_i.

Algorithm 1 chooses the j that maximizes F_w(m_w, j) / (λ + j) and backtracks to recover the bundle. Bundles of different words can overlap, so the greedy cover isn't yet a valid segmentation.

The vocabulary keeps every distinct chunk of length at least two, so its size is controlled by q for each selected word. The outer loop tries trial token counts t in increasing order and sets λ = t/(Kη), where η is a positive rational tradeoff parameter. It accepts the first cover with λA + R ≤ (1 + ln n) t (1 + 1/η), where A is the number of selected words and R the selected occurrence count.

A minimum-token segmentation over the chunk vocabulary together with the single characters is then computed, and the algorithm outputs it. Remark 3.10 sets η = h/q and q = ⌈√M⌉, which gives the factor γ_q = O(√(M log n)).

What the cardinality bounds guarantee

The cost analysis starts from Lemma 3.6, which bounds the cost of an induced segmentation cover by λK + t. Each greedy selection is at least as cheap per newly covered position as the best optimal bundle or singleton. Summing the per-iteration charges over the shrinking uncovered set gives a harmonic sum, which is bounded by (1 + lnn). Lemma 3.7 therefore gives a total cost of at most (1 + lnn)(λK + OPT_K), so the harmonic factor H_n ≤ 1 + ln n drives the bound.

The parameter η trades vocabulary size against token count, and the algorithm sets λ from each guess t and η. Because the guesses run in increasing order, the first accepted guess satisfies t̂ ≤ OPT_K. That acceptance step yields |V| ≤ (1 + η)(1 + lnn)qK and T(D,V) ≤ (1 + 1/η)(1 + lnn)hOPT_K.

Lemma 3.8 builds, for each word, a suffix vocabulary of at most q substrings in which every suffix splits into at most h tokens. Lemma 3.9 applies this construction to a whole cover, turning it into a valid segmentation with at most hR tokens. The chunk vocabulary grows by at most a factor q over the number of selected bundles, so |V| ≤ q|C_W|.

Setting η = h/q and q = ⌈√M⌉ makes both factors equal, giving γ_q = O(√(M log n)). Corollary 3.11 gives a second pair of equal factors, the minimum of 1 + 12√(n/K) and ln n times the minimum over q of (2q − 1 + ⌈M/q⌉). These factors hold for 1 ≤ K ≤ n and M ≥ 2.

The storage-budget variant of binary tokenization

Under the storage budget, a vocabulary is charged for the total length of its distinct spellings rather than for its number of entries. The primitive bits 0 and 1 are free, so only the added substrings count against the budget B. The authors restrict this model to 2 ≤ B < n, because B below 2 makes primitives exact and B at least n permits buying every nonprimitive document.

Under the storage model, an (α, β) bicriteria algorithm returns storage at most αB and token count at most β·OPT_stB.

Theorem 3.12 gives a deterministic polynomial-time algorithm for this model, with D_B = ⌈log2 B⌉ and any positive rational η. The algorithm returns a vocabulary with c(V) ≤ (1+η) ln(n) D_B B, so the storage overshoot is controlled by η. Its token count satisfies T(D,V) ≤ (1 + 1/η) ln(n) D_B OPT_stB, so the two factors trade off through η.

For the storage version, the proof replaces the chunk construction with a binary decomposition of each selected word.

Setting η = 1 gives both factors equal to 2 ln(n) ⌈log2 B⌉, which the paper writes as O(log n log B). The authors defer the proof to Appendix C, so the guarantee is stated here without its derivation. Because the bound uses ⌈log2 B⌉ rather than the word length, it stays logarithmic in the storage budget. The bicriteria pair therefore keeps the same form as the cardinality result, but both factors grow with log n and log B.

Limitations: what the bounds do not cover

The bicriteria algorithms exceed the vocabulary budget by a factor γ, so they answer a looser question than the strict budget K. The guarantee bounds the vocabulary at most γK entries and the tokens at most γOPT K, rather than meeting both limits exactly. The cardinality factor grows with M and log n, so it remains a polynomial-factor statement rather than a constant one.

Remark 3.10 sets η = h/q and q = ⌈√M⌉ to reach the factor γ = O(√M log n).

The cardinality results cover 1 ≤ K ≤ n, so budgets outside that range fall outside the analysis. Corollary 3.11 states its bicriteria factors only for 1 ≤ K ≤ n and M ≥ 2. For the storage model, the paper states the interesting range as 2 ≤ B < n, because B < 2 makes primitives exact and B ≥ n permits buying all documents. The trivial cases are handled separately, so the bounds don't speak to them.

The hardness result is for fixed ε in (0, 1), so it gives no factor for ε at or beyond that range.

The authors don't report any experimental evaluation, so the bounds are not checked on real corpora. The paper's definitions use a binary alphabet, although the occurrence-cover arguments also work over general finite alphabets.

Paper info

Authors
Atieh Bastan, Xiaoling He, A. Pavan, N. V. Vinodchandran
Venue
arXiv · Preprint
First published
2026-11-11
Added
2026-11-13
Updated
2026-11-11
Version
v1
arXiv
2611.15074
Category
cs.DS · cs.AI · cs.CC
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

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. 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.

Quote from the paper

Atieh Bastan, Xiaoling He, A. Pavan, N. V. Vinodchandran (2026). Tokenization: Hardness and Bicriteria Approximation Algorithms. arXiv:2611.15074v1. https://arxiv.org/abs/2611.15074v1

BibTeX
@misc{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 = {https://arxiv.org/abs/2611.15074v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up