[论文解读] An Information-Theoretic Perspective on LLM Tokenizers
该论文将大型语言模型分词器视为结构化压缩器,展示训练数据规模、词汇量大小与领域如何影响压缩、熵与鲁棒性,并提出以信道为基础的视角来指导“以压缩为导向”的分词器设计。
Large language model (LLM) tokenizers act as structured compressors: by mapping text to discrete token sequences, they determine token count (and thus compute and context usage) and the statistical structure seen by downstream models. Despite their central role in LLM pipelines, the link between tokenization, compression efficiency and induced structure is not well understood. We empirically demonstrate that tokenizer training scale redistributes entropy: as training data grows, the token stream becomes more diverse in aggregate (higher unigram entropy) yet markedly more predictable in-context (lower higher-order conditional entropies), indicating that tokenization absorbs substantial short-range regularity although these gains degrade under train-test domain mismatch. To ground these observations, we first benchmark i) pretrained GPT-family tokenizers as black-box compressors across various domains, and ii) learned tokenizers across configurations spanning vocabulary size, training scale, and domain. Next, we study tokenization as a transform for universal compression and introduce a compression-aware BPE variant. Finally, we adopt a channel lens and introduce capacity-utilization metrics to analyze tokenizer behaviour and outline implications for downstream modeling. Put together, our results expose various trade-offs between compression, induced structure, and robustness under domain shift, and motivate principled, compression-aware tokenizer design.
研究动机与目标
- 在跨领域(新闻、代码、数学)和多语言情境下,将预训练GPT家族的分词器作为黑箱压缩器进行基准评估。
- 研究在不同词汇大小和训练规模下的学习型分词器,以识别熵与压缩的放大趋势。
- 在训练域与测试域不匹配及域对齐的训练/评估情形下考察分词器性能。
- 探究分词与通用压缩器的相互作用,并提出一个简化的容量利用信道视角来概括分词器行为。
- 基于经验与理论洞见,提出原则性、考虑压缩的分词器设计。
提出的方法
- 将分词器视为有限字母表的压缩器,并将其压缩效率与经典压缩器(gzip、zstd、LZMA)进行对比。
- 在多个域(C4新闻、Bigcode Starcoder代码、多语言中文/土耳其语/英文/其他)和不同词汇大小(16k、64k,中文测试拓展至500k)下训练和评估学习型分词器(BPE、Unigram、WordPiece、WordLevel)。
- 在测试 token 序列上计算两类指标:压缩比(每个 token 的字节数)和经验性n-gram熵(从 unigram 到 5-gram)。
- 通过在英语上训练的分词器对土耳其语、代码和中文进行评估来分析领域鲁棒性,并量化熵和压缩的变化。
- 将分词作为通用压缩器(类似LZ)的预处理变换进行探索,并提出一个LZ感知的BPE变体以优化下游gzip压缩。
- 采用信道理论视角定义容量利用率指标,并关联词汇量大小、token-频率偏斜与熵。
- 以跨域和分词器之间的内在文本可压缩性与分词密度之间的相关性来支撑结果。
实验结果
研究问题
- RQ1预训练的GPT家族分词器在不同域和语言中作为黑箱压缩器的表现如何?
- RQ2训练数据规模如何影响学习型分词器中的 unigram 熵和更高阶条件熵?
- RQ3训练-测试域不匹配对分词器压缩性能和所诱导的结构有何影响?
- RQ4分词是否能作为通用可压缩性的有益变换,我们能否设计考虑压缩的分词器(如LZ感知的BPE)以提升下游压缩?
- RQ5词汇量大小和 token-频率偏斜如何影响信道视角下的容量利用?
主要发现
- GPT家族分词器在英语、数学和代码中表现出稳定的压缩性,但在多语言设置下表现脆弱,常对非拉丁字符集过度分割。
- 学习型分词器呈现一致趋势:增加训练数据会提高 unigram 熵,同时降低高阶熵(2-gram 至 5-gram),表明短程规律被吸收进分词表示。
- 在训练-测试域不匹配情形下,分词器的压缩性能并不随着更多英文训练数据而呈显著提升,更高阶熵仍高于零,表明依赖于训练域属性。
- 分词可以提升通用压缩器(LZ风格)的性能,在使用分词ID而非原始UTF-8时比特/字符的增益较小;且LZ感知的BPE在降低压缩尺寸方面优于标准BPE。
- 以信道视角看,容量利用率(η)随训练规模上升并趋于饱和,同时高阶熵下降,表明分词在令牌数量、所诱发的结构以及鲁棒性之间存在权衡。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。