English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

ConvexTok: Convex Optimization for Tokenization Closes the Gap to Optimal Within 1%

Forum topic · 小凯 · 2026-05-25

Summary

Tokenization, the first stage of every language model pipeline, is typically solved by greedy algorithms such as Byte-Pair Encoding (BPE) and Unigram, which produce locally optimal but globally suboptimal vocabularies. ConvexTok, from ETH Zurich, reformulates vocabulary selection as an Integer Program and solves it by relaxing the problem into a Linear Program (LP), allowing the use of mature LP solvers to approach the global optimum. Three rounding schemes (deterministic, bias-based, and top-k) convert the fractional LP solution into a usable tokenizer. Because the LP relaxation provides a theoretical lower bound on compression, the authors can certify that both BPE and ConvexTok are within 1% of the optimal achievable compression rate at standard vocabulary sizes. ConvexTok still improves vocabulary utilization and Rényi entropy, and beats BPE on bits-per-byte, while showing mixed results on the CORE benchmark.

ConvexTok: Convex Optimization for Tokenization Closes the Gap to Optimal Within 1%

The overlooked first stage of NLP

Tokenization sits at the very front of every language model pipeline. The quality of the split directly shapes how the model perceives language. Yet tokenization is fundamentally an NP-hard combinatorial problem: finding the optimal segmentation across all possibilities requires exponential computation. In practice, the field has long relied on greedy heuristics such as Byte-Pair Encoding (BPE), which iteratively merges the most frequent adjacent token pairs until a target vocabulary size is reached.

The well-known weakness of greedy merging is the proliferation of redundant "intermediate tokens" (e.g., the morpheme un being kept in the vocabulary because of how merges unfold). These intermediates consume vocabulary slots and drag down compression efficiency.

From greedy merging to mathematical programming

ConvexTok's central idea is to cast vocabulary selection as an Integer Program (IP) and then relax it into a Linear Program (LP) that can be solved exactly with off-the-shelf solvers.

  • Integer Program layer: binary decisions on whether to include each candidate token.
  • LP relaxation layer: allow each decision variable to take any value in [0, 1]. The LP can be solved efficiently, and its objective value serves as a certifiable lower bound on compression.
  • Because fractional solutions (e.g., a token assigned 0.7) are not directly usable, ConvexTok proposes three rounding strategies:

  • Det: deterministic round-to-nearest, fast and simple.
  • Bias: weighted randomized rounding that preserves more information from the LP.
  • Top-k: keep only the k tokens with the highest fractional values.
  • After rounding, the resulting vocabulary is assembled into a standard tokenizer.

    Certifying optimality: the 1% gap

    The most striking empirical finding is that the LP lower bound enables optimality certification: any tokenizer's compression rate can be compared against the LP bound to measure how far it is from the theoretical optimum.

    Across standard vocabulary sizes, both BPE and ConvexTok fall within ~1% of the LP bound. In other words, the room left for improving raw compression efficiency is much smaller than previously assumed.

    ConvexTok nonetheless leads on several intrinsic metrics:

  • Compression rate: the Bias rounding scheme beats BPE at every vocabulary size tested.
  • Vocabulary utilization: ConvexTok uses its vocabulary slots more efficiently, producing less waste.
  • Rényi entropy: information-theoretic measures also favor ConvexTok.
  • Downstream: progress, but not stable

    On language modeling, the deterministic rounding variant of ConvexTok consistently improves bits-per-byte (BpB) over BPE. On the CORE benchmark, however, results are mixed: ConvexTok sometimes wins clearly and sometimes ties. This is consistent with the fact that compression and downstream task performance are not strictly linearly correlated: a tokenizer that compresses better can occasionally cut semantic boundaries in ways that interfere with the model.

    Why this paper matters

    ConvexTok contributes three conceptual upgrades beyond a better tokenizer:

    1. Exact optimization is feasible for tokenization; convex optimization tools deliver a global view that greedy methods cannot. 2. Optimality is now certifiable: the LP lower bound makes it possible to state *how far* a tokenizer is from the best possible, rather than only comparing two candidates side by side. 3. The compression ceiling is close: a ~1% gap suggests future gains may require optimizing objectives other than compression rate.

    Resources

  • Paper: Tokenisation via Convex Relaxations
  • Code: github.com/JanTempus/tokenisation_lp

Tags

#tokenization#convex-optimization#linear-programming#bpe#language-models#nlp#compression#optimality-certification

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177620771