Constructing a BPE Tokenization DFA

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Berglund, Martin, Martens, Willeke, van der Merwe, Brink
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866909622613311488
author Berglund, Martin
Martens, Willeke
van der Merwe, Brink
author_facet Berglund, Martin
Martens, Willeke
van der Merwe, Brink
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_07671
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Constructing a BPE Tokenization DFA
Berglund, Martin
Martens, Willeke
van der Merwe, Brink
Formal Languages and Automata Theory
Computation and Language
Machine Learning
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.
title Constructing a BPE Tokenization DFA
topic Formal Languages and Automata Theory
Computation and Language
Machine Learning
url https://arxiv.org/abs/2405.07671