arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.08688cs.CLcs.AI
收藏

通过字符匹配进行子词补全的令牌对齐

Token Alignment via Character Matching for Subword Completion

AWS AI Labs(亚马逊云科技人工智能实验室)

Ben Athiwaratkun, Shiqi Wang, Mingyue Shang, Yuchen Tian, Zijian Wang, Sujan Kumar Gonugondla, Sanjay Krishna Gouda, Rob Kwiatowski, Ramesh Nallapati, Bing Xiang

AI总结:

本文提出令牌对齐方法,通过回溯至完整令牌并确保生成与提示对齐,缓解生成模型处理部分令牌时的分词伪影,在代码补全等场景中显著提升性能。

摘要:

生成模型广泛应用于各种应用,但常常在处理与部分令牌对应的提示时遇到困难。这一困难源于分词过程,在推理期间,部分令牌会偏离分布,导致输出不正确或无意义。本文研究了一种缓解生成模型中文本补全分词伪影的技术,即使在常规非子词情况下也能保持性能。该方法称为令牌对齐,涉及回溯到最后一个完整令牌,并确保模型的生成与提示对齐。该方法在众多部分令牌场景中展现出显著改进,包括空格前缀和部分缩进等细微情况,且仅增加少量时间开销。本文详述的技术和分析有助于生成模型在处理部分输入方面的持续进步,对代码补全和文本自动补全等应用具有重要意义。

英文摘要:

Generative models, widely utilized in various applications, can often struggle with prompts corresponding to partial tokens. This struggle stems from tokenization, where partial tokens fall out of distribution during inference, leading to incorrect or nonsensical outputs. This paper examines a technique to alleviate the tokenization artifact on text completion in generative models, maintaining performance even in regular non-subword cases. The method, termed token alignment, involves backtracking to the last complete tokens and ensuring the model's generation aligns with the prompt. This approach showcases marked improvement across many partial token scenarios, including nuanced cases like space-prefix and partial indentation, with only a minor time increase. The technique and analysis detailed in this paper contribute to the continuous advancement of generative models in handling partial inputs, bearing relevance for applications like code completion and text autocompletion.

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

↑