arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.03368cs.CLcs.LGstat.ML
收藏

通过分词和转换器模型实现自然语言的一条路径

A path to natural language through tokenisation and transformers

Centre for Theoretical Physics, Queen Mary University of London(理论物理中心,伦敦女王学院)

David S. Berman, Alexander G. Stapleton

AI总结:

本文研究了BPE分词对自然语言统计特性的影响,发现其不仅压缩数据,还重构了语言的信息属性。

摘要:

自然语言在其统计结构中表现出显著的规律性,包括 notably Zipf's 和 Heaps' 法律的出现。尽管如此,仍然普遍不清楚这些特性如何与现代分词方案相关联,这些方案用于当前的转换器模型。在本笔记中,我们分析了各种语料库的信息含量(以香农熵测量),并假设Zipfian频率分布,推导出槽熵期望值的闭式表达式。然后我们经验性地研究了字对编码(BPE)如何转换语料库统计信息,显示递归应用BPE会将词频推向Zipfian幂律,同时诱导出经验熵的特征增长模式。利用转换器模型学习上下文依赖词概率分布的能力,我们在不同BPE深度的语料库上训练语言模型,发现随着BPE深度的增加,模型预测熵越来越符合Zipf推导的预测。基于注意力的诊断进一步表明,更深入的分词会减少局部词依赖性,使经验分布更接近弱依赖(近独立同分布)的区域。这些结果阐明了BPE不仅作为压缩机制,还作为统计转换器,重建了自然语言的关键信息属性。

英文摘要:

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.

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

↑