We present frequency-ordered tokenization, a simple preprocessing technique that improves lossless text compression by exploiting the power-law frequency distribution of natural language tokens (Zipf's law). The method tokenizes text with Byte Pair Encoding (BPE), reorders the vocabulary so that frequent tokens receive small integer identifiers, and encodes the result with variable-length integers before passing it to any standard compressor. On enwik8 (100 MB Wikipedia), this yields improvements of 7.08 percentage points (pp) for zlib, 1.69 pp for LZMA, and 0.76 pp for zstd (all including vocabulary overhead), outperforming the classical Word Replacing Transform. Gains are consistent at 1 GB scale (enwik9) and across Chinese and Arabic text. We further show that preprocessing accelerates compression for computationally expensive algorithms: the total wall-clock time including preprocessing is 3.1x faster than raw zstd-22 and 2.4x faster than raw LZMA, because the preprocessed input is substantially smaller. The method can be implemented in under 50 lines of code.


翻译:本文提出频率排序分词技术,这是一种通过利用自然语言词汇的幂律频率分布(齐普夫定律)来提升无损文本压缩效果的简单预处理方法。该方法使用字节对编码(BPE)对文本进行分词,将词汇表重新排序以使高频词汇获得较小的整数标识符,并在将结果传递给任何标准压缩器之前使用变长整数进行编码。在enwik8(100 MB维基百科数据)上,该方法使zlib的压缩率提升了7.08个百分点(pp),LZMA提升了1.69 pp,zstd提升了0.76 pp(均包含词汇表开销),其性能超越了传统的词替换变换方法。在1 GB规模数据(enwik9)以及中文和阿拉伯文文本上的增益效果保持一致。我们进一步证明,预处理能加速计算密集型压缩算法的运行:包含预处理的总耗时比原始zstd-22快3.1倍,比原始LZMA快2.4倍,这是因为预处理后的输入数据规模显著减小。该方法可在50行代码内实现。

0
下载
关闭预览

相关内容

排序是计算机内经常进行的一种操作,其目的是将一组“无序”的记录序列调整为“有序”的记录序列。分内部排序和外部排序。若整个排序过程不需要访问外存便能完成,则称此类排序问题为内部排序。反之,若参加排序的记录数量很大,整个序列的排序过程不可能在内存中完成,则称此类排序问题为外部排序。内部排序的过程是一个逐步扩大记录的有序序列长度的过程。
文本分类算法及其应用场景研究
专知会员服务
19+阅读 · 2024年7月31日
【2020新书】预训练Transformer模型的文本排序
专知会员服务
63+阅读 · 2020年10月18日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
在Python中使用SpaCy进行文本分类
专知
24+阅读 · 2018年5月8日
NLP自然语言处理(二)——基础文本分析
乐享数据DataScientists
12+阅读 · 2017年2月7日
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
无人机与反无人机系统(书籍)
专知会员服务
1+阅读 · 今天6:45
乌克兰2026年军用无人机:现代战争如何被改变
专知会员服务
1+阅读 · 今天5:53
美陆军2026条令:安全与机动支援
专知会员服务
0+阅读 · 今天5:49
技术、多域威慑与海上战争(报告)
专知会员服务
7+阅读 · 4月13日
“在云端防御”:提升北约数据韧性(报告)
专知会员服务
4+阅读 · 4月13日
人工智能及其在海军行动中的整合(综述)
专知会员服务
3+阅读 · 4月13日
相关基金
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员