arXiv:2601.03368cs.CLcs.LG2026-01被引 2

解析分词如何让语言模型更贴近自然语言的统计规律。

A path to natural language through tokenisation and transformers

  • 用香农熵分析语料,推导出槽位熵期望的闭式表达。
  • BPE递归分词使词频趋近齐普夫定律,熵随深度增长。
  • 分词越深,模型预测熵越接近理论值,局部依赖减弱。

自然语言具有显著的统计规律,如齐普夫定律和希普斯定律。然而,这些特性与现代Transformer模型中使用的分词方案之间的关系仍不清晰。本文在齐普夫频率分布假设下,分析了多种语料的信息含量(以香农熵衡量),推导出槽位熵的期望闭式表达。随后,通过实证研究发现,字节对编码(BPE)的递归应用使词频趋向齐普夫幂律,并导致经验熵呈现特定增长模式。利用Transformer学习上下文相关词频分布的能力,在不同BPE深度下训练语言模型,结果表明模型预测熵随BPE深度增加而逐渐逼近齐普夫推导值。注意力诊断进一步显示,更深的分词降低了局部词元依赖性,使实际分布更接近弱依赖(近似独立同分布)状态。综合来看,这些结果阐明了BPE不仅是压缩机制,更是一种重构自然语言关键信息属性的统计变换。

原文摘要 · Abstract (English)

Natural languages exhibit striking regularities in their statistical structure, including notably the emergence of Zipf's and Heaps' laws. Despite this, it remains broadly unclear how these properties relate to the modern tokenisation schemes used in contemporary transformer models. In this note, we analyse the information content (as measured by the Shannon entropy) of various corpora under the assumption of a Zipfian frequency distribution, and derive a closed-form expression for the slot entropy expectation value. We then empirically investigate how byte--pair encoding (BPE) transforms corpus statistics, showing that recursive applications of BPE drive token frequencies toward a Zipfian power law while inducing a characteristic growth pattern in empirical entropy. Utilizing the ability of transformers to learn context dependent token probability distributions, we train language models on corpora tokenised at varying BPE depths, revealing that the model predictive entropies increasingly agree with Zipf-derived predictions as the BPE depth increases. Attention-based diagnostics further indicate that deeper tokenisation reduces local token dependencies, bringing the empirical distribution closer to the weakly dependent (near IID) regime. Together, these results clarify how BPE acts not only as a compression mechanism but also as a statistical transform that reconstructs key informational properties of natural language.

分词信息熵齐普夫定律Transformer

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。