arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.22958cs.ITcs.CLmath.IT
收藏

基于频率顺序的标记化以提升文本压缩

Frequency-Ordered Tokenization for Better Text Compression

Maximilian Kalcher

AI总结:

基于频率顺序的标记化通过优化词汇表结构提升文本压缩效率,适用于多种压缩算法,显著提高压缩速度和效率。

摘要:

我们提出了频率有序标记化,一种简单的预处理技术,通过利用自然语言标记的幂律频率分布(齐夫定律)来提高无损文本压缩的效率。该方法使用字对编码(BPE)对文本进行标记化,重新排列词汇表,使高频标记获得较小的整数标识符,并在编码后使用变长整数进行编码,然后将其传递给任何标准压缩器。在enwik8(100 MB维基百科)上,这种方法在zlib上提升了7.08个百分点(pp),在LZMA上提升了1.69个百分点,在zstd上提升了0.76个百分点(所有包括词汇表开销),优于经典的词替换变换。在1GB规模(enwik9)和中文、阿拉伯文文本上,收益保持一致。我们进一步表明,预处理可以加速计算成本较高的算法的压缩:包括预处理在内的总运行时间比原始zstd-22快3.1倍,比原始LZMA快2.4倍,因为预处理后的输入显著更小。该方法可以在50行代码内实现。

英文摘要:

We present frequency-ordered tokenization (FOT), a simple preprocessing technique that improves lossless text compression by exploiting the power-law frequency distribution of natural language (Zipf's law). FOT segments text into the vocabulary of a pretrained Byte Pair Encoding (BPE) tokenizer, renumbers tokens by frequency with a fixed table, and writes them with a short byte code before any standard compressor. Because the FOT stream is less than half the size of the text, compressors produce smaller output and run faster at the same time. On enwik8 (100 MB of Wikipedia), FOT reduces the compressed size by 7.96 percentage points (pp) for zlib, 2.24 pp for xz (LZMA), 1.96 pp for brotli and 1.44 pp for zstd, while making total compression, including the transform, 1.6x, 3.2x, 1.8x and 5.0x faster. Gains hold from 100 KB to 1 GB (enwik9) and across texts of diverse languages, and outperform the classical Word Replacing Transform. On enwik9, FOT with tuned xz sets a new state of the art among LZ-based compressors on the Large Text Compression Benchmark. The method can be implemented in under 50 lines of code.

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

↑