Byte pair encoding (BPE) tokenization is a popular technique for subdividing text into relevant subwords and is frequently used in large language model systems. Since the tokenization procedure is deterministic and produces regular languages, it is beneficial to characterize it in terms of finite automata to allow for further automata-aided processing, such as pattern matching. In this paper, we demonstrate how to build such automata efficiently in practice, applying a series of optimization techniques to represent them compactly.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Constructing Compact BPE Token DFAs

  • Martin Berglund,
  • Anna Jonsson,
  • Willeke Martens,
  • Brink van der Merwe

摘要

Byte pair encoding (BPE) tokenization is a popular technique for subdividing text into relevant subwords and is frequently used in large language model systems. Since the tokenization procedure is deterministic and produces regular languages, it is beneficial to characterize it in terms of finite automata to allow for further automata-aided processing, such as pattern matching. In this paper, we demonstrate how to build such automata efficiently in practice, applying a series of optimization techniques to represent them compactly.