你打算完成那个吗?对部分标记问题的实用研究
Are you going to finish that? A Practical Study of the Partial Token Problem
AI总结:
本文研究了部分标记问题对语言模型预测的影响,发现词边界与令牌边界不一致导致严重预测偏差,并提出缓解措施。
摘要:
语言模型(LMs)是在令牌序列上进行训练的,而用户则是通过文本与LMs交互。这种不匹配导致了部分标记问题,即当用户在预期的下一个令牌中结束提示时,会导致下一个令牌预测失真。尽管这个问题已经被用来任意字符前缀进行研究,但在尊重词边界的真实提示中其普遍性和严重性仍被忽视。在本工作中,我们识别出三个领域,其中令牌和“词”边界往往不一致:不使用空格的语言、高度复合的语言和代码。例如,在中文中,多达25%的词边界不与令牌边界对齐,使得即使自然、词完整的提示也容易受到这个问题的影响。我们系统地构建了语义自然的提示,以部分令牌结束;在实验中,我们发现它们构成了一种严重的故障模式:前沿LMs在提示被“回退”以与令牌对齐时,对正确延续的置信度低至正确延续的三阶数量级。这种退化不会随着规模的增加而减少,而且对于更大的模型往往更严重。最后,我们评估了推理时间对部分标记问题的缓解措施,并验证了最近精确解决方案的有效性。总体而言,我们展示了由令牌化在真实使用案例中造成的概率失真规模和严重性,并为模型推理提供者提供了实用的建议。
英文摘要:
Language models (LMs) are trained over sequences of tokens, whereas users interact with LMs via text. This mismatch gives rise to the partial token problem, which occurs when a user ends their prompt in the middle of the expected next-token, leading to distorted next-token predictions. Although this issue has been studied using arbitrary character prefixes, its prevalence and severity in realistic prompts respecting word boundaries remains underexplored. In this work, we identify three domains where token and "word" boundaries often do not line up: languages that do not use whitespace, highly compounding languages, and code. In Chinese, for example, up to 25% of word boundaries do not line up with token boundaries, making even natural, word-complete prompts susceptible to this problem. We systematically construct semantically natural prompts ending with a partial tokens; in experiments, we find that they comprise a serious failure mode: frontier LMs consistently place three orders of magnitude less probability on the correct continuation compared to when the prompt is "backed-off" to be token-aligned. This degradation does not diminish with scale and often worsens for larger models. Finally, we evaluate inference-time mitigations to the partial token problem and validate the effectiveness of recent exact solutions. Overall, we demonstrate the scale and severity of probability distortion caused by tokenization in realistic use cases, and provide practical recommentions for model inference providers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。