你应该对可能的分词方式进行边际化吗?
Should you marginalize over possible tokenizations?
AI总结:
研究自回归语言模型中忽略分词边际化是否合理,提出基于重要性采样的算法计算边际概率估计,发现多数情况下对数似然差距不超过0.5%,但在长复杂单词数据中差距更明显。
摘要:
自回归语言模型将词元序列映射为概率。计算任何字符串(如英语句子)概率的通常做法是先将其转换为模型评分的词元序列。然而,对于任何给定字符串,存在指数级多的词元序列表示。要真正计算字符串的概率,应该对所有分词方式进行边际化,这通常是难以处理的。在此,我们分析忽略边际化的做法是否合理。为此,我们设计了一种基于重要性采样的算法,计算边际概率的估计值,并在一系列最先进的模型和数据集中将其与默认程序进行比较。结果显示,在大多数情况下对数似然的差距不超过0.5%,但对于包含长复杂单词的数据,差距变得更加明显。
英文摘要:
Autoregressive language models (LMs) map token sequences to probabilities. The usual practice for computing the probability of any character string (e.g. English sentences) is to first transform it into a sequence of tokens that is scored by the model. However, there are exponentially many token sequences that represent any given string. To truly compute the probability of a string one should marginalize over all tokenizations, which is typically intractable. Here, we analyze whether the practice of ignoring the marginalization is justified. To this end, we devise an importance-sampling-based algorithm that allows us to compute estimates of the marginal probabilities and compare them to the default procedure in a range of state-of-the-art models and datasets. Our results show that the gap in log-likelihood is no larger than 0.5% in most cases, but that it becomes more pronounced for data with long complex words.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。