arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2501.06246cs.CLcs.AIcs.DS
收藏

一种面向分词的分区覆盖方法

A Partition Cover Approach to Tokenization

Singapore Management University(新加坡管理大学);MIT-IBM Watson AI Lab(MIT-IBM沃森人工智能实验室);Harvard University(哈佛大学);National University of Singapore(新加坡国立大学)

Jia Peng Lim, Shawn Tan, Davin Choo, Hady W. Lauw

AI总结:

本文将分词建模为优化问题并证明其 NP-hard,提出多项式贪心算法 GreedTok,实验表明其压缩效果优于 BPE 和 Unigram,并可提升十亿参数语言模型的每字节比特效率。

摘要:

分词是将字符串编码为固定词汇表大小的 token 的过程,广泛应用于自然语言处理任务。当前主流的分词算法是 Byte-Pair Encoding(BPE,字节对编码),它将分词问题表述为压缩问题,并通过执行一系列合并来解决。在本研究中,我们将分词表述为一个优化目标,通过从顶点覆盖问题进行简单归约证明其为 NP-hard,并提出了一种多项式时间贪心算法 GreedTok。我们的表述可自然松弛为已被充分研究的加权最大覆盖问题,该问题具有简单的 (1 - 1/e) 近似算法 GreedWMC。通过在真实语料库上的实证评估,我们表明 GreedTok 在压缩性能上优于 BPE 和 Unigram,并取得了与 GreedWMC 相当的覆盖分数。最后,我们对两个具有 10 亿参数的基于 transformer 的语言模型进行了大规模预训练,比较选择 BPE 和 GreedTok 作为分词器的效果,结果表明:即使在控制总数据集比例或总训练 token 数的情况下,GreedTok 也实现了更低的每字节比特数。

英文摘要:

Tokenization is the process of encoding strings into tokens of a fixed vocabulary size, and is widely utilized in Natural Language Processing applications. The leading tokenization algorithm today is Byte-Pair Encoding (BPE), which formulates the tokenization problem as a compression problem and tackles it by performing sequences of merges. In this work, we formulate tokenization as an optimization objective, show that it is NP-hard via a simple reduction from vertex cover, and propose a polynomial-time greedy algorithm GreedTok. Our formulation naturally relaxes to the well-studied weighted maximum coverage problem which has a simple $(1 - 1/e)$-approximation algorithm GreedWMC. Through empirical evaluations on real-world corpora, we show that GreedTok outperforms BPE and Unigram on compression and achieves a covering score comparable to GreedWMC. Finally, our extensive pre-training for two transformer-based language models with 1 billion parameters, comparing the choices of BPE and GreedTok as the tokenizer, shows that GreedTok achieves a lower bit per byte even when we control for either the total dataset proportion or total training tokens.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑