arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.04653cs.CLcs.AI
收藏

批处理 BPE 分词合并

Batching BPE Tokenization Merges

Alexander P. Morgan

AI总结:

本文提出开源纯 Python 实现 BatchBPE,通过安全批处理 BPE 合并并降低训练文本内存占用,使资源受限设备上训练和实验高质量分词器成为可能。

摘要:

在构建分词器词表时,Byte Pair Encoding(字节对编码)算法可以被安全地批处理,一次合并数百对 token。将该技术与降低词表训练所用文本的内存占用相结合,使在基础笔记本电脑上训练高质量分词器变得可行。本文介绍了 BatchBPE,这是这些概念的开源纯 Python 实现,目标是让尝试新的分词策略更容易,尤其是在计算和内存受限的环境中。通过训练多个 token 词表来探索批合并过程,并试验对停用词表进行预处理以及忽略数据集中最不常见的文本块,展示了 BatchBPE 的实用性和可延展性。所得文本编码长度被用作一项基本评估指标。

英文摘要:

The Byte Pair Encoding algorithm can be safely batched to merge hundreds of pairs of tokens at a time when building up a tokenizer's vocabulary. This technique combined with reducing the memory footprint of text used in vocabulary training make it feasible to train a high quality tokenizer on a basic laptop. This paper presents BatchBPE, an open-source pure Python implementation of these concepts, with the goal of making experimenting with new tokenization strategies more accessible especially in compute- and memory-constrained contexts. BatchBPE's usefulness and malleability are demonstrated through the training of several token vocabularies to explore the batch merging process and experiment with preprocessing a stop word list and ignoring the least common text chunks in a dataset. Resultant encoded lengths of texts are used as a basic evaluation metric.

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

↑