arXiv:2607.23362cs.CL2026-07

JOLT优化字节匹配分词,让模型压缩率接近理论极限。

Joint Optimization for Greedy Longest-match Tokenization

  • 将词汇表学习建模为整数规划,确保训练与推理分词一致。
  • 相比BPE,JOLT在验证集上减少0.78%分词数量,提升随训练范围增长。
  • 提供近最优性证明,适用于追求极致压缩的部署场景。

近期研究显示,子词词汇表可针对特定推理规则训练以优化压缩效果,而非依赖如字节对编码(BPE)之类的贪心启发式方法。本文将该思路扩展至广泛使用的贪心左到右最长匹配解码,提出联合优化贪心最长匹配分词(JOLT)。JOLT将词汇选择与分段决策建模为整数规划问题,并通过贪心一致性约束保证优化后的分段与所选词汇下的最长匹配解码结果完全一致,使训练目标与部署时分词行为对齐。为实现可扩展性,采用线性规划松弛,并仅对未解决的预分词引入高阶分段。该松弛结果近乎整数:四舍五入解距LP下界仅差0.008%-0.176%。边界分析表明,BPE已处于贪心最长匹配解码下最优压缩的1%-2%范围内,而JOLT填补了其中89.6%-99.4%的差距。在四个训练范围、32,000和64,000词汇量的保留验证数据上,JOLT最多比BPE少0.78%分词,且性能提升随训练范围增大而增强。结果表明,对齐推理的词汇优化可恢复大部分被BPE遗留的压缩潜力,并提供近最优性证书。

原文摘要 · Abstract (English)

Recent work has shown that subword vocabularies can be trained to optimize compression for a specific inference rule rather than relying on greedy heuristics such as Byte Pair Encoding (BPE). We extend this approach to greedy left-to-right longest-match decoding, the fast and widely used inference rule underlying WordPiece. We introduce Joint Optimization for Greedy Longest-Match Tokenization (JOLT), which formulates vocabulary learning as an integer program over vocabulary-selection and segmentation-choice variables. Greedy-consistency constraints ensure that each optimized segmentation exactly matches the segmentation produced by longest-match decoding under the selected vocabulary, aligning the training objective with deployment-time tokenization. To scale the optimization, we solve a linear programming relaxation and selectively introduce higher-order segmentations only for unresolved pretokens. The resulting relaxation is nearly integral: rounded solutions fall within 0.008 - 0.176 % of the LP lower bound on the training scope. The bound also shows that BPE is already within 1 - 2 % of the best achievable compression under greedy longest-match decoding, while JOLT closes 89.6 - 99.4 % of the remaining gap. On held-out validation data across four training scopes and vocabulary sizes of 32,000 and 64,000, JOLT produces up to 0.78 % fewer tokens than BPE, with improvements generally increasing as the training scope grows. These results demonstrate that inference-aligned vocabulary optimization can recover most of the limited compression headroom left by BPE while providing a certificate of near-optimality.

分词优化压缩效率贪心算法语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。