arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.07671cs.FLcs.CLcs.LG
收藏

构建BPE分词DFA

Constructing a BPE Tokenization DFA

Department of Computing Science, Umeå University(乌梅大学计算机科学系);Department of Computer Science, Stellenbosch University(斯坦福博芝大学计算机科学系);National Institute for Theoretical and Computational Sciences, South Africa(南非理论与计算科学国家研究所)

Martin Berglund, Willeke Martens, Brink van der Merwe

AI总结:

本文提出一种高效构建DFA的算法,该DFA直接处理BPE分词,支持模式匹配、词典等价检查等应用,并确立状态复杂度渐近界,同时构建输入确定性转换器精确描述字符串与分词关系。

摘要:

许多自然语言处理系统通过文本分词来处理开放词汇问题。本文给出并分析了一种高效构建确定性有限自动机(DFA)的算法,该自动机旨在直接处理由流行的字节对编码(BPE)技术产生的分词。这使得许多现有技术和算法能够应用于分词场景,例如模式匹配、分词词典的等价性检查以及以多种方式组合分词语言。该构建保留了自动机的某些关键属性,我们利用这一点来确立所得自动机状态复杂度的渐近界。最后,我们演示了如何构建一个输入确定性的(后续)字符串到字符串转换器,该转换器精确描述了字符串与其正确分词之间的关系。

英文摘要:

Many natural language processing systems operate over tokenizations of text to address the open-vocabulary problem. In this paper, we give and analyze an algorithm for the efficient construction of deterministic finite automata (DFA) designed to operate directly on tokenizations produced by the popular byte pair encoding (BPE) technique. This makes it possible to apply many existing techniques and algorithms to the tokenized case, such as pattern matching, equivalence checking of tokenization dictionaries, and composing tokenized languages in various ways. The construction preserves some key properties of the automaton, and we use this to establish asymptotic bounds on the state complexity of the automata that result. Finally, we demonstrate how to construct an input-deterministic (subsequential) string-to-string transducer which precisely describes the relationship between strings and their correct tokenizations.

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

↑