arXiv:2601.23223cs.CL2026-01被引 2

语言模型因分词错位导致预测出错,真实场景下问题严重且随模型变大更糟。

Are you going to finish that? A Practical Study of the Partial Token Problem

  • 在中文、代码等场景中,词与分词边界常不一致,引发预测偏差。
  • 未对齐时正确续写概率比对齐时低1000倍,且大模型更严重。
  • 提出实用缓解方案,适合部署者和推理优化研究者参考。

语言模型基于标记序列训练,而用户通过自然文本交互,这种差异导致了部分标记问题:当用户在预期下一个标记的中间结束提示时,会引发错误的后续预测。尽管已有研究使用任意字符前缀分析该问题,但其在尊重词边界的现实提示中的普遍性和严重性仍不清楚。本文发现三种词边界与标记边界常不一致的语言场景:无空格语言、高度复合语言和代码。例如,在中文中,高达25%的词边界与标记边界不重合,使得即使完整的词级提示也可能受影响。我们系统构建语义自然的以部分标记结尾的提示,在实验中发现这构成严重失效模式:前沿语言模型在未对齐情况下对正确延续的概率比对齐时低三个数量级,且该退化不随模型规模增加而缓解,反而在大模型中加剧。最后,我们评估了推理阶段的缓解方法,并验证了近期精确解决方案的有效性。总体上,本文揭示了真实使用场景中分词导致的概率扭曲的规模与严重性,并为模型推理提供实用建议。

原文摘要 · Abstract (English)

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.

语言模型分词问题推理优化

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