尽管已有大量研究试图在语言建模中规避分词(Clark et al., 2022; Xue et al., 2022),当前共识仍是:分词是设计最先进高性能语言模型的必要初始步骤。本文从理论视角研究分词问题,考察Transformer在简单数据生成过程上的行为。当在来自某些简单k阶马尔可夫过程(k > 1)的数据上训练时,Transformer表现出一个令人惊讶的现象——在没有分词的情况下,它们在经验上无法学到正确的分布,而是按照一元模型(unigram model)来预测字符(Makkuva et al., 2024)。然而,加入分词后,我们在经验上观察到Transformer突破了这一障碍,能够近乎最优地建模来自该源的序列概率,并取得较小的交叉熵损失。以这一观察为出发点,我们研究了Transformer在有分词和无分词情况下所取得的端到端交叉熵损失。我们证明,在采用适当分词的情况下,即使是Transformer学到的最简单的一元模型(基于token)也能近乎最优地建模来自k阶马尔可夫源的序列概率。通过研究Transformer在马尔可夫数据上的行为,我们的分析为实践中使用分词提供了理论依据。
英文摘要:
While there has been a large body of research attempting to circumvent tokenization for language modeling (Clark et al., 2022; Xue et al., 2022), the current consensus is that it is a necessary initial step for designing state-of-the-art performant language models. In this paper, we investigate tokenization from a theoretical point of view by studying the behavior of transformers on simple data generating processes. When trained on data drawn from certain simple $k^{\text{th}}$-order Markov processes for $k > 1$, transformers exhibit a surprising phenomenon - in the absence of tokenization, they empirically fail to learn the right distribution and predict characters according to a unigram model (Makkuva et al., 2024). With the addition of tokenization, however, we empirically observe that transformers break through this barrier and are able to model the probabilities of sequences drawn from the source near-optimally, achieving small cross-entropy loss. With this observation as starting point, we study the end-to-end cross-entropy loss achieved by transformers with and without tokenization. With the appropriate tokenization, we show that even the simplest unigram models (over tokens) learnt by transformers are able to model the probability of sequences drawn from $k^{\text{th}}$-order Markov sources near optimally. Our analysis provides a justification for the use of tokenization in practice through studying the behavior of transformers on Markovian data.
MultiTok: Variable-Length Tokenization for Efficient LLMs Adapted from LZW Compression
University of Texas at Austin(德克萨斯大学奥斯汀分校);Nokia Bell Labs(诺基亚贝尔实验室);Boğaziçi University(博雅大学);Georgia Institute of Technology(佐治亚理工学院);Massachusetts Institute of Technology (MIT)(麻省理工学院(MIT))
Morphemes Without Borders: Evaluating Root-Pattern Morphology in Arabic Tokenizers and LLMs
Saudi Data & AI Authority (SDAIA)(沙特数据与人工智能局);Mohamed bin Zayed University of Artificial Intelligence (MBZUAI)(穆罕默德·本·扎耶德人工智能大学);Princess Nourah Bint Abdulrahman University (PNU)(普罗瑟·努拉·本·阿卜杜勒拉赫曼大学)
HIGHT: Hierarchical Graph Tokenization for Molecule-Language Alignment
MBZUAI(穆罕默德·本·扎耶德人工智能大学);Carnegie Mellon University(卡内基梅隆大学);The Chinese University of Hong Kong(香港中文大学);Tsinghua University(清华大学);University of Maryland, College Park(马里兰大学学院市分校);National University of Singapore(新加坡国立大学)
The Lookahead Limitation: Why Multi-Operand Addition is Hard for LLMs
German Research Center for Artificial Intelligence (DFKI)(德国人工智能研究中心);Centre for European Research in Trusted AI (CERTAIN)(欧洲可信人工智能研究中心);Saarland University(萨尔大学)
Beyond Fertility: Analyzing STRR as a Metric for Multilingual Tokenization Evaluation
University of Alberta(阿尔伯塔大学);Princess Nourah Bint Abdulrahman University(努拉·阿卜杜勒拉赫曼王后大学);Dialpad Qatar Computing Research Institute(阿联酋迪拜计算研究所);Amazon AGI(亚马逊人工智能研究所)
School of Computer Science and Engineering, Nanjing University of Science and Technology(南京理工大学计算机科学与工程学院);School of Computer Science and Engineering, Central South University(中南大学计算机科学与工程学院);College of Information Science and Technology and Artificial Intelligence, Nanjing Forestry University(南京林业大学信息科学技术与人工智能学院)
xVal: A Continuous Numerical Tokenization for Scientific Language Models
Flatiron Institute(弗莱蒂伦研究所);Lawrence Berkeley National Laboratory(劳伦斯伯克利国家实验室);University of Cambridge(剑桥大学);Université Paris-Saclay(巴黎萨克雷大学);Université Paris Cité(巴黎西岱大学);CEA(法国原子能和替代能源委员会);CNRS(法国国家科学研究中心);University of Colorado Boulder(科罗拉多大学博尔德分校);New York University(纽约大学);Prescient Design;Genentech(基因泰克公司);Princeton University(普林斯顿大学)