论文

AdaBPE:自适应频率阈值的分词方法,兼顾自然语言与 LaTeX 等形式语言

Adaptive Frequency Threshold Byte Pair Encoding for Mixed Natural Language and Structured Symbolic Corpora

精选理由

一篇改分词的论文:AdaBPE 能让 LaTeX 这类跨空格的结构化内容不被切碎,五个数据集上验证了效果。做 tokenizer 或训练模型的可以看看。

论文提出 AdaBPE,一种改进的 Byte Pair Encoding(BPE)分词方法。传统 BPE 把空白符当作固定边界,导致 LaTeX 这类跨空白的结构化内容被切碎。AdaBPE 根据候选 token 的长度和类型动态调整最小频率阈值,能在训练数据中占比很小时仍为 LaTeX 等领域符号分配词表容量。作者在五个覆盖 LaTeX 与自然语言的数据集上评估,编码效率和下游语言模型在领域内容上的表现均有提升,且通用语言性能不受损。

原文 · arXiv cs.LG

Adaptive Frequency Threshold Byte Pair Encoding for Mixed Natural Language and Structured Symbolic Corpora

Modern language models rely on subwording tokenization to define the discrete units of input processing, typically using methods like Byte Pair Encoding (BPE) that treat whitespace as a fixed semantic boundary. This design is inherently limited, as many meaningful concepts---including multiword expressions and the structured environments of formal languages like LaTeX---frequently span across whitespaces. While recent superword tokenization methods attempt to address this by relaxing whitespace constraints, they often rely on greedy frequency-driven merging that fails to account for token length or the specific needs of underrepresented domain-specific languages. In this paper, we introduce Adaptive Frequency Threshold Byte Pair Encoding (AdaBPE), a new tokenization method that leverages an adaptive frequent-pattern mining approach. AdaBPE features a twofold dynamicity: it adapts minimum frequency thresholds based on both the length of a candidate token, to prevent favoring frequent short patterns, and its type, to distinguish between general and formal language patterns, using LaTeX as case in point. This allows the model to efficiently allocate vocabulary capacity to domain-specific notations, such as LaTeX, even when they represent a small fraction of the training data. We evaluate AdaBPE across five datasets spanning LaTeX and natural language, showing consistent gains in encoding efficiency and downstream language-model performance on domain-specific content without compromising general-language performance.