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

SuperBPE:语言模型的太空旅行

SuperBPE: Space Travel for Language Models

University of Washington(华盛顿大学);NVIDIA(英伟达);Allen Institute for AI(人工智能研究院)

Alisa Liu, Jonathan Hayase, Valentin Hofmann, Sewoong Oh, Noah A. Smith, Yejin Choi

AI总结:

本文提出超词分词器 SuperBPE,通过在 BPE 中加入预分词课程先学子词再学跨空白超词,在固定词表下减少最多 33% token,使 8B 模型下游任务平均提升 4.0% 且推理计算减少 27%。

摘要:

几乎所有语言模型(LM)分词方案的一个假设是,token 应当是子词(subword),即包含在词边界之内。虽然这看似提供了一个合理的归纳偏置,但这种常见做法是否限制了现代语言模型的潜力?空白字符并不是意义的可靠分隔符,多词表达(例如“by the way”)、表达一个概念所需词数在不同语言间的差异(例如“spacesuit helmet”在德语中是“raumanzughelm”),以及完全不使用空白字符的语言(例如中文)都证明了这一点。为了探索超越子词的分词潜力,我们引入了一种“超词”(superword)分词器 SuperBPE,它将一个简单的预分词课程(pretokenization curriculum)融入字节对编码(BPE)算法中,先学习子词,再学习跨越空白字符的超词。这带来了编码效率的显著提升:当词表大小固定为 200k 时,SuperBPE 对固定文本进行编码所需的 token 数量平均比 BPE 少最多 33%。在实验中,我们从头预训练 8B 参数的 Transformer 语言模型,同时固定模型大小、词表大小和训练计算量,仅改变学习词表的算法。我们使用 SuperBPE 训练的模型在 30 个下游任务上相比 BPE 基线平均取得了 +4.0% 的绝对提升(包括在 MMLU 上 +8.2%),同时在推理时所需的计算量减少 27%。在分析中,我们发现 SuperBPE 产生的文本切分在每个 token 的难度上更加均匀。从定性角度看,这可能是因为 SuperBPE 的 token 通常捕获了在语义上作为单一单元运作的常见多词表达。SuperBPE 是对分词的一种直接、局部的修改,它同时提高了编码效率和下游性能,从而整体上产生了更好的语言模型。

英文摘要:

The assumption across nearly all language model (LM) tokenization schemes is that tokens should be subwords, i.e., contained within word boundaries. While providing a seemingly reasonable inductive bias, is this common practice limiting the potential of modern LMs? Whitespace is not a reliable delimiter of meaning, as evidenced by multi-word expressions (e.g., "by the way"), crosslingual variation in the number of words needed to express a concept (e.g., "spacesuit helmet" in German is "raumanzughelm"), and languages that do not use whitespace at all (e.g., Chinese). To explore the potential of tokenization beyond subwords, we introduce a "superword" tokenizer, SuperBPE, which incorporates a simple pretokenization curriculum into the byte-pair encoding (BPE) algorithm to first learn subwords, then superwords that bridge whitespace. This brings dramatic improvements in encoding efficiency: when fixing the vocabulary size to 200k, SuperBPE encodes a fixed piece of text with up to 33% fewer tokens than BPE on average. In experiments, we pretrain 8B transformer LMs from scratch while fixing the model size, vocabulary size, and train compute, varying *only* the algorithm for learning the vocabulary. Our model trained with SuperBPE achieves an average +4.0% absolute improvement over the BPE baseline across 30 downstream tasks (including +8.2% on MMLU), while simultaneously requiring 27% less compute at inference time. In analysis, we find that SuperBPE results in segmentations of text that are more uniform in per-token difficulty. Qualitatively, this may be because SuperBPE tokens often capture common multi-word expressions that function semantically as a single unit. SuperBPE is a straightforward, local modification to tokenization that improves both encoding efficiency and downstream performance, yielding better language models overall.

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

↑