TL;DR
This paper demonstrates that Large Language Models (LLMs) are essentially world-class, general-purpose compressors. By using arithmetic coding, the authors show that a text-trained model like Chinchilla can outperform specialized algorithms like PNG and FLAC at compressing images and audio, providing a new information-theoretic framework to understand scaling laws and tokenization.
The Problem: Prediction vs. Compression
While the AI community has been mesmerized by the "emergent" capabilities of LLMs, we often overlook the mathematical foundation they are built upon: prediction. Information theory tells us that prediction and compression are "two sides of the same coin." If you can perfectly predict the next symbol in a sequence, you can represent that sequence with zero bits of surprise.
The authors set out to bridge the gap between modern foundation models and classical compression. They ask: How well do these massive models actually compress data? Does their performance on text translate to other modalities like images or sound? And most importantly, what can the "lens of compression" teach us about why these models work (or fail)?
Methods: Turning Models into Compressors
The researchers utilize Arithmetic Coding as the bridge. Arithmetic coding is an optimal way to turn a probabilistic model (like a Transformer) into a lossless compressor. It works by partitioning a range based on the model's predicted probabilities for the next token; the more likely a token is, the larger its interval, and the fewer bits it requires to encode.
The study distinguishes between two types of compression rates:
- Raw Compression Rate: The size of the compressed data divided by the raw data size. This ignores the size of the model itself.
- Adjusted Compression Rate: This accounts for the "two-part code"—the size of the compressed data plus the size of the model parameters. This is a more honest look at the total information required to transmit the data and the "knowledge" needed to decode it.
Key Insights and Ideas
- Foundation Models are Universal: Even though models like Chinchilla are trained primarily on text, they "understand" the underlying patterns of images and audio better than domain-specific tools.
- Scaling Laws have a Twist: We usually think "bigger is better" for LLMs. However, when you account for the model size (the adjusted rate), scaling beyond a certain point actually deteriorates compression performance for a fixed dataset size. There is an optimal model size for every dataset size.
- Tokenization is Pre-Compression: The authors argue that tokenization (like BPE) is essentially a form of lossless pre-compression. While it helps fit more information into a Transformer's limited context window, it doesn't necessarily improve the fundamental compression capability of the model.
- The Gzip Generator: In a clever "reverse" experiment, they showed that
gzipcan be used as a generative model. Whilegzipproduces very noisy, incoherent images compared to an LLM, the fact that it works at all proves the deep link between compression and modeling.
Key Results
To test the "general-purpose" nature of these models, the authors used 1GB samples of text (enwik9), images (ImageNet patches), and audio (LibriSpeech).
- Raw Performance: Chinchilla 70B compressed ImageNet patches to 43.4% of their original size (beating PNG's 58.5%) and LibriSpeech to 16.4% (beating FLAC's 30.3%).
- Text Superiority: On the
enwik9text dataset, Chinchilla 70B achieved a raw compression rate of 8.3%, far outperforminggzip(32.3%) andLZMA2(23.0%). - The Cost of Size: When calculating the adjusted rate for a 1GB dataset, the massive size of LLMs makes them "worse" than
gzip. For example, Llama 2 (7B) has an adjusted rate of over 1400% because its parameters (roughly 14GB in float16) dwarf the 1GB of data being compressed.
Limitations and Future Work
The primary limitation is computational cost. While gzip is nearly instantaneous, performing arithmetic coding with a 70B parameter model is extremely slow and resource-intensive.
Furthermore, the context length of Transformers (typically 2048 tokens) limits their ability to find long-range dependencies compared to algorithms like LZMA2, which have virtually infinite context.
The authors suggest that future research should focus on finding the "sweet spot" of model size for specific data scales and exploring how to make these powerful "neural compressors" more efficient for practical use. They conclude that a model that compresses well is a model that generalizes well—making compression the ultimate benchmark for artificial intelligence.
Summary updated