Revisiting Data Compression with Language Modeling
Chen-Han Tsai
TL;DR
This work examines the feasibility and practical effectiveness of using large language models for lossless data compression via probabilistic modeling and arithmetic coding. It demonstrates a state-of-the-art adjusted compression rate of about $0.18$ on enwik9 without additional training and extends evaluation to non-English data and byte-stream inputs. The authors investigate context-length extension and post-training quantization (GPTQ and HQQ) to reduce model size while preserving compression performance, finding that substantial weight-precision reductions can maintain competitive $\gamma_a$. They also compare multiple byte-stream tokenization strategies, revealing that treating bytes as integers or mapped tokens yields the strongest compression, with text-oriented approaches performing comparatively poorer in adjusted metrics. Overall, the study highlights the potential and limitations of LLM-based compression across text, code, multilingual data, and raw byte streams, pointing to directions for practical, scalable data compressors specialized for compression tasks.
Abstract
In this report, we investigate the potential use of large language models (LLM's) in the task of data compression. Previous works have demonstrated promising results in applying LLM's towards compressing not only text, but also a wide range of multi-modal data. Despite the favorable performance achieved, there still remains several practical questions that pose a challenge towards replacing existing data compression algorithms with LLM's. In this work, we explore different methods to achieve a lower adjusted compression rate using LLM's as data compressors. In comparison to previous works, we were able to achieve a new state-of-the-art (SOTA) adjusted compression rate of around $18\%$ on the enwik9 dataset without additional model training. Furthermore, we explore the use of LLM's in compressing non-English data, code data, byte stream sequences. We show that while LLM's excel in compressing data in text-dominant domains, their ability in compressing non-natural text sequences still remain competitive if configured in the right way.
