研究词元化方式如何影响模型对文字的概率判断。
Causal Estimation of Tokenisation Bias
- 用因果推断方法分析词元化差异对概率的影响。
- 小模型中词元存在可使对应字符概率最高提升17倍。
- 适合关注模型设计与训练偏差的研究者阅读。
现代语言模型通常在子词序列上训练,但最终为字符串分配概率。理想情况下,词元化器(将字符串映射为子词)的选择不应影响底层字符串的概率;但实际上会。我们定义这种不一致为词元化偏差。本文量化了一种特定类型的词元化偏差:即一个子词(如⟨hello⟩)是否被包含在词元化器词汇表中,对模型赋予对应字符串(如“hello”)概率的影响。由于每个模型仅使用一种词元化器,该效应难以直接估计。为此,我们将其视为因果效应,采用回归不连续设计进行估算。利用词元化算法按排名选取前K个子词加入词汇表的特性,通过比较接近阈值的相似子词来估计因果效应。实验发现,词元化对模型输出的影响在不同规模、词汇表和词元化器间均显著。特别地,在小模型中,子词的存在可使对应字符概率最高提升17倍,凸显词元化作为语言建模关键设计选择的重要性。
原文摘要 · Abstract (English)
Modern language models are typically trained over subword sequences, but ultimately define probabilities over character-strings. Ideally, the choice of the tokeniser -- which maps character-strings to subwords -- should not affect the probability assigned to the underlying character-string; in practice, it does. We define this mismatch as tokenisation bias. In this work, we quantify one particular type of tokenisation bias: the effect of including or not a subword (e.g., $\langle hello \rangle$) in a tokeniser's vocabulary on the probability a trained model assigns to the corresponding characters (i.e., \textit{``hello''}). Estimating this effect is challenging because each model is trained with only one tokeniser. We address this by framing tokenisation bias as a causal effect and estimating it using the regression discontinuity design. Specifically, we exploit the fact that tokenisation algorithms rank subwords and add the first $K$ to a tokeniser's vocabulary, where $K$ is an arbitrary cutoff point. As such, we can estimate a causal effect by comparing similar subwords around this cutoff. Experimentally, we find that tokenisation consistently affects models' outputs across scales, vocabularies, and tokenisers. Notably, a subword's presence in a small model's vocabulary may increase its characters' probability by up to 17 times, highlighting tokenisation as a key design choice in language modelling.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。