arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.18376cs.CLcs.AI
收藏

分词不止于压缩

Tokenization Is More Than Compression

Kensho Technologies(肯寿科技公司);Harvard Univ(哈佛大学);Ben-Gurion University(本-古里安大学);MIT(麻省理工学院)

Craig W. Schmidt, Varshini Reddy, Haoran Zhang, Alec Alameddine, Omri Uzan, Yuval Pinter, Chris Tanner

AI总结:

该研究提出PathPiece分词器检验“token越少下游性能越好”的假设,发现假设不成立,进而分析分词三阶段的设计因素,训练并公开了64个不同参数规模的语言模型,为分词器设计提供新见解。

摘要:

Tokenization(分词)是自然语言处理(NLP)任务中的基础步骤,搭建起原始文本与语言模型之间的桥梁。现有的分词方法如Byte-Pair Encoding(BPE,字节对编码)源自数据压缩领域,且有观点认为BPE的有效性源于其能将文本压缩为数量相对较少的token(词元)。我们通过提出PathPiece——一种新型分词器,可在给定词表下将文档文本分割为最少数量的token——来检验“token数量越少,下游性能越好”这一假设。通过大量实验,我们发现该假设并不成立,这让人们对有效分词的原因的理解产生了质疑。为探究哪些其他因素在发挥作用,我们评估了分词三个阶段的设计决策:预分词、词表构建和分割,为有效分词器的设计提供了新的见解。具体而言,我们阐明了预分词的重要性,以及使用BPE初始化词表构建的益处。我们训练了64个采用不同分词方式的语言模型,参数规模从350M到2.4B不等,所有模型均已公开。

英文摘要:

Tokenization is a foundational step in natural language processing (NLP) tasks, bridging raw text and language models. Existing tokenization approaches like Byte-Pair Encoding (BPE) originate from the field of data compression, and it has been suggested that the effectiveness of BPE stems from its ability to condense text into a relatively small number of tokens. We test the hypothesis that fewer tokens lead to better downstream performance by introducing PathPiece, a new tokenizer that segments a document's text into the minimum number of tokens for a given vocabulary. Through extensive experimentation we find this hypothesis not to be the case, casting doubt on the understanding of the reasons for effective tokenization. To examine which other factors play a role, we evaluate design decisions across all three phases of tokenization: pre-tokenization, vocabulary construction, and segmentation, offering new insights into the design of effective tokenizers. Specifically, we illustrate the importance of pre-tokenization and the benefits of using BPE to initialize vocabulary construction. We train 64 language models with varying tokenization, ranging in size from 350M to 2.4B parameters, all of which are made publicly available.

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

↑