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

从基于 token 的语言模型到基于字符的语言模型

From Language Models over Tokens to Language Models over Characters

City University of New York(纽约城市大学);McGill University(麦吉尔大学);Canada CIFAR AI Chair(加拿大CIFAR人工智能主席)

Tim Vieira, Ben LeBrun, Mario Giulianelli, Juan Luis Gastaldi, Brian DuSell, John Terilla, Timothy J. O'Donnell, Ryan Cotterell

AI总结:

本文提出将 token 级语言模型精确或近似转换为字符级模型的算法,实验表明其能快速准确近似字符分布并显著提升压缩率。

摘要:

现代语言模型在内部——以及数学上——是针对 token 字符串而非字符字符串的分布,这给在其之上构建用户应用的程序员带来了诸多挑战。例如,如果提示词被指定为字符串,则在将其传递给 token 级语言模型之前必须先进行分词。因此,分词器及后续处理对提示词的具体形式非常敏感(例如提示词是否以空格结尾)。本文提出了将 token 级语言模型转换为字符级语言模型的算法,包括精确算法和近似算法。在论文的实证部分,我们对实际运行时间和近似质量进行了基准测试。在四个公开可用的语言模型上,我们发现,即使计算预算很小,我们的方法也能以相当快的速度准确近似字符级分布,并且语言模型的压缩率(bits/byte)得到了显著提升。

英文摘要:

Modern language models are internally -- and mathematically -- distributions over $\it{token}$ strings rather than $\it{character}$ strings, posing numerous challenges for programmers building user applications on top of them. For example, if a prompt is specified as a character string, it must be tokenized before passing it to the token-level language model. Thus, the tokenizer and consequent processing are very sensitive to the specification of the prompt (e.g., whether the prompt ends with a space or not). This paper presents algorithms for converting token-level language models to character-level ones. We present both exact and approximate algorithms. In the empirical portion of the paper, we benchmark the practical runtime and approximation quality. Across four publicly available language models, we find that -- even with a small computation budget -- our method is able to accurately approximate the character-level distribution at reasonably fast speeds, and that a significant improvement in the language model's compression rate (bits/byte) is achieved.

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

↑