Tokenisation via Convex Relaxations
AuthorsJan Tempus, Philip Whittington, Craig W. Schmidt, Dennis Komm, Tiago Pimentel
Resources
This paper turns tokenization from a greedy heuristic into a convex optimization problem, producing a tokenizer that can be near-optimal and often slightly better for language models.
Key results
ConvexTok was trained and evaluated on the ClimbMix400B corpus using this many documents.
The experiments sweep vocabulary budgets from 8k up to 256k, in power-of-two increments.
The LP relaxation was empirically certified to be within 1% of the optimum at common vocabulary sizes.
At 128k and 256k, over 90% of colour variables were fixed to 0 or 1, indicating a highly integral relaxation.
The Det rounding scheme achieved 0.7033 validation bits-per-byte at 32k and depth 24, compared with BPE's 0.7042.
The Det rounding scheme achieved 0.6951 validation bits-per-byte at 128k, compared with BPE's 0.6968.
What the paper found
Tokenisation via Convex Relaxations reframes subword vocabulary construction as a shortest-path optimisation problem on a tokenisation graph, then converts that problem into a large linear program solved with NVIDIA CuOPT PDLP. The resulting method, ConvexTok, replaces greedy BPE merges with a global objective over 593,920 ClimbMix400B documents and vocabularies from 8k to 256k. The LP relaxation is remarkably tight: across common vocabulary sizes, the certified gap to optimum is within 1%, and the relaxed solutions become increasingly integral as vocabulary size grows, with over 90% of colour variables fixed to 0 or 1 at 128k and 256k. After rounding, the deterministic scheme Det gives the best language-model compression, improving bits-per-byte over BPE on all 12-layer models and usually remaining ahead at deeper settings; for example, at 32k and depth 24, Det reaches 0.7033 BpB versus BPE’s 0.7042, and at 128k it reaches 0.6951 versus 0.6968. On intrinsic tokeniser metrics, the Bias rounding scheme is strongest overall, consistently improving vocabulary utilisation, type-token ratio, and tokens per line, while Det is more stable for downstream LM training. The paper’s central novelty is not a new merge heuristic but a certified convex optimisation formulation that can quantify how close any tokeniser is to compression optimality on a dataset, turning tokeniser design into a problem with explicit lower bounds rather than heuristic search.
Original abstract
Tokenisation is an integral part of the current NLP pipeline. Current tokenisation algorithms such as BPE and Unigram are greedy algorithms -- they make locally optimal decisions without considering the resulting vocabulary as a whole. We instead formulate tokeniser construction as a linear program and solve it using convex optimisation tools, yielding a new algorithm we call ConvexTok. We find ConvexTok consistently improves intrinsic tokenisation metrics and the bits-per-byte (BpB) achieved by language models; it also improves downstream task performance, but less consistently. Furthermore, ConvexTok allows the user to certify how far their tokeniser is from optimal, with respect to a certain objective, via a lower bound, and we empirically find it to be within 1\% of optimal at common vocabulary sizes.
Read the original paperMore in Natural Language Processing
Browse all 29 papers →Contextual Embeddings Beyond the Gold Chunk
Sedigheh Eslami, Markus Krimmel, William Barber, Antoine Chaffin, Maximilian Schall, Jonas Golde, Louis Milliken, Ekaterina Glazkova, Denis Bykov, Bo Wang
A new retriever learns to surface both the chunks that answer a question and the evidence that supports those answers.
Grammar Control for Language Learning with Sequential Monte Carlo and Small Language Models
Kate McCurdy, Jacob Hoover Vigly, Thomas Hikaru Clark, Karolina Stańczak, Yahya Emara, Joshua B. Tenenbaum, Alexander K. Lew, Ryan Cotterell, Timothy J. O'Donnell
A sampling-based method helps small language models produce dialogue that reliably practices specific grammar skills.
The uneven rise of AI-generated web content
Adam Visokay, Soumyakanti Pan, Molly Griston, Polina Iasakova, Mark Nepf, Denis Peskoff, Riya Sinha, Jikai Sun, Isabelle Thiara, Letao Wang, Yiwei Wu, Lauren Yan, Tyler H. McCormick
A study of over five million webpages finds that AI-written text is spreading unevenly, with the fastest growth on less-central pages.