Constructing a BPE Tokenization DFA

📅 2024-05-13
🏛️ International Conference on Implementation and Application of Automata
📈 Citations: 2
Influential: 0
📄 PDF
🤖 AI Summary
Byte Pair Encoding (BPE) tokenization yields subword sequences that lack direct support for formal language operations, hindering rigorous pattern matching and compositional verification in open-vocabulary NLP systems. Method: We propose the first deterministic finite automaton (DFA) construction algorithm tailored to BPE output—treating tokenized sequences as constrained symbol strings without reconstructing original bytes or characters. Our approach introduces a novel equivalence-class partitioning scheme and transition function synthesis mechanism grounded in BPE merge rules, enabling linear-time O(n) DFA construction while preserving semantic fidelity. Contribution/Results: The resulting DFA supports efficient subword-level regular expression matching, lexicon equivalence checking, and formal language composition operations. It significantly improves both efficiency and composability of pattern recognition and formal verification in open-vocabulary NLP, establishing foundational automata infrastructure for verifiable, scalable, tokenization-aware language processing.

Technology Category

Application Category

📝 Abstract
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 designed to operate directly on tokenizations produced by the popular byte pair encoding 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.
Problem

Research questions and friction points this paper is trying to address.

Efficient DFA construction for BPE tokenization
Enabling pattern matching on tokenized text
Analyzing state complexity of tokenization automata
Innovation

Methods, ideas, or system contributions that make the work stand out.

Constructing BPE tokenization DFA efficiently
Applying existing algorithms to tokenized cases
Creating input-deterministic string-to-string transducer
🔎 Similar Papers
No similar papers found.