[Paper Review] Language Modeling Is Compression
The paper reframes prediction with lossless compression, showing large language models act as general-purpose predictors that excel at in-context compression across text, image, and audio, and analyzes scaling, tokenization, and using compressors as generative models.
It has long been established that predictive models can be transformed into lossless compressors and vice versa. Incidentally, in recent years, the machine learning community has focused on training increasingly large and powerful self-supervised (language) models. Since these large language models exhibit impressive predictive capabilities, they are well-positioned to be strong compressors. In this work, we advocate for viewing the prediction problem through the lens of compression and evaluate the compression capabilities of large (foundation) models. We show that large language models are powerful general-purpose predictors and that the compression viewpoint provides novel insights into scaling laws, tokenization, and in-context learning. For example, Chinchilla 70B, while trained primarily on text, compresses ImageNet patches to 43.4% and LibriSpeech samples to 16.4% of their raw size, beating domain-specific compressors like PNG (58.5%) or FLAC (30.3%), respectively. Finally, we show that the prediction-compression equivalence allows us to use any compressor (like gzip) to build a conditional generative model.
Motivation & Objective
- Motivate studying foundation models through the lens of lossless compression and information theory.
- Empirically evaluate offline (in-context) compression capabilities of large language models across modalities.
- Analyze scaling laws and the impact of context length and model size on compression performance.
- Show how compressors can be repurposed as conditional generative models.
- Examine the role of tokenization and data modality in compression efficiency.
Proposed method
- Use arithmetic coding with probabilistic predictions from Transformers and Chinchilla-like models to create lossless compressors.
- Evaluate compression on 1 GB samples from text (enwik9), images (ImageNet patches), and audio (LibriSpeech).
- Compare against general-purpose compressors (gzip, LZMA2) and domain-specific compressors (PNG, FLAC).
- Investigate model size vs. dataset size tradeoffs for optimal adjusted compression rates.
- Demonstrate how to sample from a compressor as a generative model conditioned on prior sequence.

Experimental results
Research questions
- RQ1Can foundation models trained primarily on text serve as general-purpose compressors across multiple data modalities?
- RQ2How do context length and model size affect in-context compression performance?
- RQ3Do tokenization schemes improve or impair compression when paired with large models?
- RQ4Can compressors be used as conditional generative models for text, image, and audio data?
- RQ5What are the scaling law implications for compression performance versus data size?
Key findings
- Chinchilla 70B achieves 43.4% compression on ImageNet patches and 16.4% on LibriSpeech, outperforming PNG and FLAC in their respective domains.
- Large foundation models provide strong in-context learning that enables competitive offline compression across text, image, and audio.
- Compression performance follows scaling trends but is limited by dataset size; beyond a point, adding parameters increases the adjusted compression rate due to model-size accounting.
- Tokenization generally does not improve raw compression rates for small models, and larger vocabularies can hurt performance for bigger models.
- Using compressors as generative models is feasible by conditioning on prior context and sampling according to conditional compression-length differences.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.